Compare commits

..

9 Commits

Author SHA1 Message Date
nuluh
3cffc00feb feat: add user-defined commands for thesis metadata and year extraction 2025-05-24 02:37:55 +07:00
nuluh
6fb3c103c7 fix: adjust subsection number width in table of contents 2025-05-23 14:29:16 +07:00
nuluh
c29aab89e1 fix: adjust subsection indentation and dot separation in table of contents 2025-05-23 14:24:47 +07:00
nuluh
9d89e950ce fix: adjust spacing for table of contents and list titles 2025-05-23 14:22:47 +07:00
nuluh
f19b18ec8d feat: adjust chapter title spacing and increase section numbering depth
- Modify chapter title top spacing from 0pt to 0cm for consistency
- Set section numbering depth to 3 levels (1.1.1 format)
2025-05-23 14:20:56 +07:00
nuluh
4be018fe57 feat: Update watermark text and settings for draft mode 2025-05-23 14:17:02 +07:00
nuluh
8e6b2fbb13 feat: Update language settings and bibliography strings for Indonesian and English
Closes #81
2025-05-23 14:15:19 +07:00
nuluh
3af5a5dbb1 feat: Add documentclass scope to commit message template 2025-05-23 14:12:30 +07:00
nuluh
c8f5662977 feat(documentclass): Add packages for SVG support, indentation, and float placement 2025-05-23 14:10:40 +07:00
2 changed files with 68 additions and 19 deletions

View File

@@ -21,6 +21,7 @@
#
# Scope:
# latex (changes to thesis LaTeX)
# documentclass (LaTeX in-house document class changes)
# src (changes to Python source code)
# nb (changes to notebooks)
# ml (ML model specific changes)

View File

@@ -16,22 +16,30 @@
\RequirePackage{geometry}
\RequirePackage{setspace}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\RequirePackage{etoolbox}
\RequirePackage{tocloft}
\RequirePackage{tocbibind}
\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{hyperref}
% Polyglossia set language
\setmainlanguage{bahasai}
% \setotherlanguage{english}
+ \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."
+ }
% Conditionally load the watermark package and settings
\if@draftmark
\RequirePackage{draftwatermark}
\SetWatermarkText{Draft: \today [wip]}
\SetWatermarkColor[gray]{0.7}
\SetWatermarkFontSize{2cm}
\SetWatermarkText{nuluh/thesis (wip) draft: \today}
\SetWatermarkColor[gray]{0.8} % Opacity: 0.8 = 20% transparent
\SetWatermarkFontSize{1.5cm}
\SetWatermarkAngle{90}
\SetWatermarkHorCenter{1.5cm}
\fi
@@ -79,7 +87,10 @@
}
% Chapter formatting
\titlespacing{\chapter}{0pt}{0pt}{*1.5}
\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
\titleformat{\chapter}[display]
{\normalsize\bfseries\centering}
{BAB~\Roman{chapter}} % << display format
@@ -91,6 +102,10 @@
\titleformat{\subsection}
{\normalsize\bfseries}{\thesubsection}{1em}{}
% Section numbering depth
\setcounter{secnumdepth}{3} % Enables numbering for:
% 1 = chapters, 2 = sections, 3 = subsections
% Ensure chapter reference in TOC matches
\renewcommand{\cftchappresnum}{BAB~}
\renewcommand{\cftchapaftersnum}{\quad}
@@ -108,16 +123,22 @@
% 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{\cftbeforechapskip}{0em}
\setlength{\cftchapindent}{0pt}
\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{2.5em}
\setlength{\cftsubsecindent}{2em}
\setlength{\cftchapnumwidth}{3.5em}
\setlength{\cftsecnumwidth}{3.5em}
\setlength{\cftsecnumwidth}{2em}
\setlength{\cftsubsecnumwidth}{2.5em}
\setlength{\cftfignumwidth}{5em}
\setlength{\cfttabnumwidth}{4em}
\renewcommand \cftchapdotsep{4.5} % https://tex.stackexchange.com/a/273764
\renewcommand \cftchapdotsep{1} % Denser dots (closer together) https://tex.stackexchange.com/a/273764
\renewcommand \cftsecdotsep{1} % Apply to sections too
\renewcommand \cftsubsecdotsep{1} % Apply to subsections too
\renewcommand{\cftchapleader}{\normalfont\cftdotfill{\cftsecdotsep}}
\renewcommand{\cftchappagefont}{\normalfont}
\renewcommand{\cftfigpresnum}{\figurename~}
@@ -143,15 +164,42 @@
\renewcommand{\cftafterlottitle}{\hfill}
% \renewcommand{\cfttoctitlefont}{\bfseries\MakeUppercase}
% \renewcommand{\cftaftertoctitle}{\vskip 2em}
\makeatletter
% Extracting the Year from \today
\newcommand{\theyear}{%
\expandafter\@car\expandafter\@gobble\the\year\@nil
}
% % Apply a custom fancyhdr layout only on the first page of each \chapter, and use no header/footer elsewhere
% % \let\oldchapter\chapter
% % \renewcommand{\chapter}{%
% % \cleardoublepage
% % \pagestyle{fancyplainchapter}%
% % \oldchapter
% % \thispagestyle{fancyplainchapter} % ensure chapter start page uses it
% % \pagestyle{fancyplain}% switch for subsequent pages
% % }
% 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}
\makeatother
\endinput