latex: Match with Overleaf current work

This commit is contained in:
Rifqi D. Panuluh
2025-07-17 14:15:01 +00:00
parent 80d4a66925
commit 16c171fb46
47 changed files with 4035 additions and 278 deletions

View File

@@ -2,9 +2,14 @@
\ProvidesClass{thesis}[2025/05/10 Bachelor Thesis Class]
\newif\if@draftmark \@draftmarkfalse
\@draftmarkfalse
\newif\if@primarytitle \@primarytitletrue
\newif\if@secondarytitle \@secondarytitletrue
\DeclareOption{draftmark}{\@draftmarktrue}
\DeclareOption{noprimarytitle}{\@primarytitlefalse}
\DeclareOption{nosecondarytitle}{\@secondarytitlefalse}
\ProcessOptions \relax
\LoadClass[a4paper,12pt,oneside]{book}
@@ -17,29 +22,66 @@
\RequirePackage{geometry}
\RequirePackage{setspace}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\RequirePackage{svg}
\RequirePackage{etoolbox}
\RequirePackage{tocloft}
\RequirePackage{tocbibind}
\RequirePackage{indentfirst}
\RequirePackage{float}
\RequirePackage{amsmath,amsfonts,amssymb}
\RequirePackage{svg} % Allows including SVG images directly
\RequirePackage{indentfirst} % Makes first paragraph after headings indented
\RequirePackage{float} % Provides [H] option to force figure/table placement
\RequirePackage[style=apa, backend=biber]{biblatex}
\RequirePackage[style=apa,%
% dateabbrev=false,% when false, don't abbreviate months/year divisions
% julian=true,% convert dates before gregorianstart to Julian Calendar
% gregorianstart=1582-10-15,% Default
% alldates=short,%
% alldates=ymd,% Year-Month-Day format
% alldates=iso,% ISO8601 format
% alldatesusetime=true, % print time components in non-compact date ranges
% alltimes=12h,%
alltimes=24h,% prints 24 hour format times (default)
% alltimes=24hcomp,% prints 24 hour compressed format times
% seconds=true,% uncomment to print seconds
% timezones=true,% uncomment to print timezones
datezeros=false,% pad date components with zeros?
dateera=secular,% prints BCE/CE controlled by dateerauto, datezeros
% dateera=christian,% prints BC/AD controlled by dateerauto, datezeros
% dateera=astronomical,% prints astronomical dates, controlled by datezeros
dateeraauto=600,% Sets the max year ceiling for automatic printing of era
% abbreviate=false,% prints full date localisation strings
dateuncertain=true,%
datecirca=true,%
sorting=none,%
backend=biber]{biblatex}
\RequirePackage{hyperref}
\RequirePackage[acronym, nogroupskip, toc]{glossaries}
% \RequirePackage{glossaries-extra}
% \RequirePackage{hyperxmp}
% Polyglossia set language
\setdefaultlanguage[variant=indonesian]{malay} % Proper Indonesian language setup
\setotherlanguage{english} % Enables English as secondary language
\DefineBibliographyStrings{english}{% % Customizes bibliography text
andothers={dkk\adddot}, % Changes "et al." to "dkk."
pages={hlm\adddot}, % Changes "pp." to "hlm."
}
\setdefaultlanguage[variant=indonesian]{malay}
\setotherlanguage{english}
% Change "Bibliography" to "Daftar Pustaka" for book class
% \DefineBibliographyStrings{english}{%
% andothers={dkk\adddot},
% pages ={hlm\adddot},
% }
% \DefineBibliographyStrings{english}{
% bibliography = {Daftar Pustaka},
% }
% \DefineBibliographyStrings{american-apa}{%
% bibliography = {Daftar Pustaka},
% }
% \renewcommand{\bibname}{DAFTAR PUSTAKA}
% Conditionally load the watermark package and settings
\if@draftmark
\RequirePackage{draftwatermark}
\SetWatermarkText{nuluh/thesis (wip) [draft: \today]}
\SetWatermarkColor[gray]{0.8} % Opacity: 0.8 = 20% transparent
\SetWatermarkText{nuluh/thesis (wip)[draft: \today)}
\SetWatermarkColor[gray]{0.8}
\SetWatermarkFontSize{1.5cm}
\SetWatermarkAngle{90}
\SetWatermarkHorCenter{1.5cm}
@@ -50,6 +92,7 @@
% Page layout
\geometry{left=4cm, top=3cm, right=3cm, bottom=3cm}
\setlength{\parskip}{0.5em}
% \setlength{\parindent}{0pt}
\onehalfspacing
% Fonts
@@ -58,45 +101,19 @@
\setsansfont{Arial}
\setmonofont{Courier New}
\makeatletter
% Extracting the Year from \today
\newcommand{\theyear}{%
\expandafter\@car\expandafter\@gobble\the\year\@nil
}
% Metadata commands
% \input{metadata}
% Declare internal macros as initially empty
\newcommand{\@authorid}{}
\newcommand{\@firstadvisor}{}
\newcommand{\@secondadvisor}{}
\newcommand{\@headdepartement}{}
\newcommand{\@headdepartementid}{}
\newcommand{\@faculty}{}
\newcommand{\@program}{}
\newcommand{\@university}{}
\newcommand{\@yearofsubmission}{}
% \newcommand{\setthesisinfo}[7]{%
% \renewcommand{\thesistitle}{#1}%
% \renewcommand{\studentname}{#2}%
% \renewcommand{\studentid}{#3}%
% \renewcommand{\program}{#4}%
% \renewcommand{\faculty}{#5}%
% \renewcommand{\university}{#6}%
% \renewcommand{\yearofsubmission}{#7}%
% }
% Define user commands to set these values.
\newcommand{\authorid}[1]{\gdef\@authorid{#1}}
\newcommand{\firstadvisor}[1]{\gdef\@firstadvisor{#1}}
\newcommand{\secondadvisor}[1]{\gdef\@secondadvisor{#1}}
\newcommand{\headdepartement}[1]{\gdef\@headdepartement{#1}}
\newcommand{\headdepartementid}[1]{\gdef\@headdepartementid{#1}}
\newcommand{\faculty}[1]{\gdef\@faculty{#1}}
\newcommand{\program}[1]{\gdef\@program{#1}}
\newcommand{\university}[1]{\gdef\@university{#1}}
\newcommand{\yearofsubmission}[1]{\gdef\@yearofsubmission{#1}}
% Now expose robust the getters to access the values
\newcommand{\theauthorid}{\@authorid}
\newcommand{\thefirstadvisor}{\@firstadvisor}
\newcommand{\thesecondadvisor}{\@secondadvisor}
\newcommand{\theheaddepartement}{\@headdepartement}
\newcommand{\theheaddepartementid}{\@headdepartementid}
\newcommand{\thefaculty}{\@faculty}
\newcommand{\theprogram}{\@program}
\newcommand{\theuniversity}{\@university}
\newcommand{\theyearofsubmission}{\@yearofsubmission}
\makeatother
% % Header and footer
\fancypagestyle{fancy}{%
\fancyhf{}
@@ -115,9 +132,7 @@
}
% Chapter formatting
\titlespacing{\chapter}{0pt}{0cm}{*1.5} % 0pt0cm: same value, different unit
% 0pt = no space above chapter title
% *1.5 = 1.5× line spacing after title
\titlespacing{\chapter}{0pt}{0cm}{*1.5}
\titleformat{\chapter}[display]
{\normalsize\bfseries\centering}
@@ -131,25 +146,41 @@
{\normalsize\bfseries}{\thesubsection}{1em}{}
% Section numbering depth
\setcounter{secnumdepth}{3} % Enables numbering for:
% 1 = chapters, 2 = sections, 3 = subsections
\setcounter{secnumdepth}{3}
% Ensure chapter reference in TOC matches
\renewcommand{\cftchappresnum}{BAB~}
\renewcommand{\cftchapaftersnum}{\quad}
% Redefine \maketitle
\renewcommand{\maketitle}{%
\if@primarytitle
\input{frontmatter/maketitle}%
\fi
\if@secondarytitle
\clearpage
\input{frontmatter/maketitle_secondary}%
\fi
}
% Chapter & Section format
% thanks to https://latex.org/forum/viewtopic.php?p=83118&sid=a22ccb456531faabf65070c18af69680#p83118 for elegant solution
\makeatletter
\patchcmd{\l@chapter}
{\cftchapfont #1}% original
{\cftchapfont{#1}}% patched
{}{} % success/failure handlers
\makeatother
\renewcommand{\cftchapfont}{\normalsize\MakeUppercase}
% \renewcommand{\cftsecfont}{}
% \renewcommand{\cftsubsecfont}{\itshape}
% \renewcommand{\thesection}{\textup{\Roman{chapter}}.\arabic{section}}
% Dot leaders, spacing, indentation
\setlength{\cftbeforetoctitleskip}{0cm} % Space above "DAFTAR ISI" title
\setlength{\cftbeforeloftitleskip}{0cm} % Space above "DAFTAR GAMBAR" title
\setlength{\cftbeforelottitleskip}{0cm} % Space above "DAFTAR TABEL" title
\setlength{\cftbeforetoctitleskip}{0cm}
\setlength{\cftbeforeloftitleskip}{0cm}
\setlength{\cftbeforelottitleskip}{0cm}
\setlength{\cftbeforechapskip}{0em}
\setlength{\cftchapindent}{0pt}
\setlength{\cftsecindent}{0em}
@@ -180,25 +211,19 @@
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
% Table of Content (TOC) Title styling
% Table of Content (TOC, LoF, LoT) Title styling
% \renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\cfttoctitlefont}{\hfill\bfseries\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill} % https://tex.stackexchange.com/a/255699/394075
% List of Figures (LOF) Title styling
\renewcommand{\cftloftitlefont}{\hfill\bfseries\MakeUppercase}
\renewcommand{\cftafterloftitle}{\hfill}
% List of Tables (LOT) Title styling
\renewcommand{\cftlottitlefont}{\hfill\bfseries\MakeUppercase}
\renewcommand{\cftafterlottitle}{\hfill}
% \renewcommand{\cfttoctitlefont}{\bfseries\MakeUppercase}
% \renewcommand{\cftaftertoctitle}{\vskip 2em}
% Defines a new glossary called notation
\newglossary[nlg]{notation}{not}{ntn}{Notation}
% Define the header for the location column
\providecommand*{\locationname}{Location}
% Define the new glossary style called 'mylistalt' for main glossaries
% Define the new glossary style called 'mylistalt'
\makeatletter
\newglossarystyle{mylistalt}{%
% start the list, initializing glossaries internals
@@ -225,8 +250,10 @@
}%
}
% Define the header for the location column
\providecommand*{\locationname}{Location}
% Define the new glossary style 'altlong3customheader' for notation
% Define the new glossary style 'altlong3customheader'
\newglossarystyle{altlong3customheader}{%
% The glossary will be a longtable environment with three columns:
% 1. Symbol (left-aligned)
@@ -271,7 +298,7 @@
\fi
}
% Define a new style 'supercol' based on 'super' for acronyms glossaries
% Define a new style 'supercol' based on 'super'
\newglossarystyle{supercol}{%
\setglossarystyle{super}% inherit everything from the original
% override just the main-entry format:
@@ -290,8 +317,8 @@
}
\makeatother
% A new command that enables us to enter bi-lingual (Bahasa Indonesia and English) terms
% syntax: \addterm[options]{label}{Bahasa Indonesia}{Bahasa Indonesia first use}{English}{Bahasa Indonesia
% A new command that enables us to enter bi-lingual (Slovene and English) terms
% syntax: \addterm[options]{label}{Slovene}{Slovene first use}{English}{Slovene
% description}
\newcommand{\addterm}[6][]{
\newglossaryentry{#2}{
@@ -305,9 +332,9 @@
}
% A new command that enables us to enter (English) acronyms with bi-lingual
% (Bahasa Indonesia and English) long versions
% syntax: \addacronym[options]{label}{abbreviation}{Bahasa Indonesia long}{Bahasa Indonesia first
% use long}{English long}{Bahasa Indonesia description}
% (Slovene and English) long versions
% syntax: \addacronym[options]{label}{abbreviation}{Slovene long}{Slovene first
% use long}{English long}{Slovene description}
\newcommand{\addacronym}[7][]{
% Create the main glossary entry with \newacronym
% \newacronym[key-val list]{label}{abbrv}{long}
@@ -330,7 +357,7 @@
}
}
% Change the text of the cross-reference links to the Bahasa Indonesia long version.
% Change the text of the cross-reference links to the Slovene long version.
\renewcommand*{\glsseeitemformat}[1]{\emph{\acrlong{#1}}.}
% % Apply a custom fancyhdr layout only on the first page of each \chapter, and use no header/footer elsewhere
@@ -343,4 +370,58 @@
% % \pagestyle{fancyplain}% switch for subsequent pages
% % }
\makeatletter
% Extracting the Year from \today
\newcommand{\theyear}{%
\expandafter\@car\expandafter\@gobble\the\year\@nil
}
% Declare internal macros as initially empty
\newcommand{\@authorid}{}
\newcommand{\@firstadvisor}{}
\newcommand{\@secondadvisor}{}
\newcommand{\@headdepartement}{}
\newcommand{\@headdepartementid}{}
\newcommand{\@faculty}{}
\newcommand{\@program}{}
\newcommand{\@university}{}
\newcommand{\@yearofsubmission}{}
% Define user commands to set these values.
\newcommand{\authorid}[1]{\gdef\@authorid{#1}}
\newcommand{\firstadvisor}[1]{\gdef\@firstadvisor{#1}}
\newcommand{\secondadvisor}[1]{\gdef\@secondadvisor{#1}}
\newcommand{\headdepartement}[1]{\gdef\@headdepartement{#1}}
\newcommand{\headdepartementid}[1]{\gdef\@headdepartementid{#1}}
\newcommand{\faculty}[1]{\gdef\@faculty{#1}}
\newcommand{\program}[1]{\gdef\@program{#1}}
\newcommand{\university}[1]{\gdef\@university{#1}}
% \newcommand{\yearofsubmission}[1]{\gdef\@yearofsubmission{#1}}
% Now expose robust the getters to access the values
\newcommand{\theauthorid}{\@authorid}
\newcommand{\thefirstadvisor}{\@firstadvisor}
\newcommand{\thesecondadvisor}{\@secondadvisor}
\newcommand{\theheaddepartement}{\@headdepartement}
\newcommand{\theheaddepartementid}{\@headdepartementid}
\newcommand{\thefaculty}{\@faculty}
\newcommand{\theprogram}{\@program}
\newcommand{\theuniversity}{\@university}
% Ensure title/author/date get expanded correctly in hypersetup
% \hypersetup{
% pdftitle={\@title},
% pdfauthor={\@author},
% pdfdate={\@date},
% pdfsubject={Bachelor Thesis},
% pdfkeywords={structural health monitoring, machine learning, stft, vibration, signal},
% pdfpublisher={Universitas Muhammadiyah Yogyakarta},
% pdfcontactemail={rifqi.damar.ft21@mail.umy.ac.id},
% pdflicenseurl={https://github.com/nuluh/thesis/blob/main/LICENSE},
% pdflang={id},
% pdfcreator={XeLaTeX with hyperref and hyperxmp},
% pdfproducer={TeX Live 2024},
% pdftrapped=False
% }
\makeatother
\endinput