diff --git a/latex/skripsi.cls b/latex/skripsi.cls index f17fb36..045991e 100644 --- a/latex/skripsi.cls +++ b/latex/skripsi.cls @@ -14,6 +14,8 @@ % section number depth and tocdepth \DeclareStringOption[3]{sectiondepth} \DeclareStringOption[3]{tocdepth} +% cover page style +\DeclareStringOption[default]{cover} % default is 'custom' % Add complementary options for the "no" versions \DeclareComplementaryOption{noprimarytitle}{primarytitle} @@ -182,37 +184,115 @@ {\normalsize\bfseries}{\thesubsection}{1em}{} % Section numbering depth +\makeatletter \setcounter{secnumdepth}{\skripsikvopt@sectiondepth} +\makeatother % Ensure chapter reference in TOC matches \renewcommand{\cftchappresnum}{\MakeUppercase\chaptername~} \renewcommand{\cftchapaftersnum}{\quad} - % Redefine \maketitle % Save the original \maketitle before redefining it +\makeatletter \let\original@maketitle\maketitle \renewcommand{\maketitle}{% \ifskripsikvopt@primarytitle - \IfFileExists{frontmatter/maketitle.tex}{% - \input{frontmatter/maketitle}% - }{% - % Fallback to original \maketitle - \ClassWarning{skripsi.cls}{File frontmatter/maketitle.tex not found, using default maketitle}% + % Check if user explicitly wants default + \ifdefstring{\skripsikvopt@cover}{legacy}{% + % Use original book \maketitle \original@maketitle + \IfFileExists{frontmatter/maketitle.tex}{% + \ClassWarning{skripsi.cls}{Omit 'cover=legacy' option to use user-defined primary cover page 'frontmatter/maketitle.tex'} + }{}% + }{% + % Try to use user's custom file first + \IfFileExists{frontmatter/maketitle.tex}{% + \input{frontmatter/maketitle}% + \ClassWarning{skripsi.cls}{Using user-defined cover page 'frontmatter/maketitle.tex'}% + }{% + % embedded version + {\begin{titlepage} + \centering + \vspace*{1cm} + + {\fontsize{14pt}{16pt}\selectfont \textbf{\MakeUppercase{Tugas Akhir (EMBED)}}\par} + \vspace{1.5cm} + + {\fontsize{14pt}{16pt}\selectfont \textbf{\MakeUppercase{\thetitle}}\par} + \vspace{1.5cm} + + \includegraphics[width=5cm]{frontmatter/img/logo.png} + \vspace{1.5cm} + + \textbf{Disusun oleh:} \\ + {\fontsize{14pt}{16pt}\selectfont \textbf{\theauthor}} \\ + {\fontsize{14pt}{16pt}\selectfont \textbf{\theauthorid}} \\ + + \vfill + + {\fontsize{12pt}{14pt}\selectfont + \textbf{\MakeUppercase\theprogram} \\ + \textbf{\MakeUppercase\thefaculty} \\ + \textbf{\MakeUppercase\theuniversity} \\ + \textbf{\theyearofsubmission} + } + + \end{titlepage}% + } + }% }% + \else + \IfFileExists{frontmatter/maketitle.tex}{% + \ClassWarning{skripsi.cls}{Omit 'noprimarytitle' option to use user-defined cover page 'frontmatter/maketitle.tex'}% + }{}% \fi \ifskripsikvopt@secondarytitle \clearpage \IfFileExists{frontmatter/maketitle_secondary.tex}{% \input{frontmatter/maketitle_secondary}% + \ClassWarning{skripsi.cls}{Using user-defined secondary cover page} }{% - \ClassWarning{skripsi.cls}{File frontmatter/maketitle_secondary.tex not found, skipping}% + { + \begin{titlepage} + \centering + {\fontsize{14pt}{16pt}\selectfont \textbf{\MakeUppercase{Tugas Akhir (Embed)}}\par} + \vspace{1.5cm} + + {\fontsize{14pt}{16pt}\selectfont \textbf{\MakeUppercase{\thetitle}}\par} + \vspace{1cm} + {\normalsize\selectfont Diajukan guna melengkapi persyaratan untuk memenuhi gelar Sarjana Teknik di Program Studi Teknik Sipil, Fakultas Teknik, Universitas Muhammadiyah Yogyakarta\par} + \vspace{1.5cm} + + \includegraphics[width=5cm]{frontmatter/img/logo.png} + \vspace{1.5cm} + + + \textbf{Disusun oleh:} \\ + {\fontsize{14pt}{16pt}\selectfont \textbf{\theauthor}} \\ + {\fontsize{14pt}{16pt}\selectfont \textbf{\theauthorid}} \\ + + + \vfill + + {\fontsize{12pt}{14pt}\selectfont + \textbf{\MakeUppercase\theprogram} \\ + \textbf{\MakeUppercase\thefaculty} \\ + \textbf{\MakeUppercase\theuniversity} \\ + \textbf{\theyearofsubmission} + } + \end{titlepage}% + } + \ClassWarning{skripsi.cls}{File frontmatter/maketitle_secondary.tex not found, using embedded secondary cover page}% }% + \else + \IfFileExists{frontmatter/maketitle_secondary.tex}{% + \ClassWarning{skripsi.cls}{Omit 'nosecondarytitle' option to use user-defined secondary cover page 'frontmatter/maketitle_secondary.tex'}% + }{}% \fi } - +\makeatother % Chapter & Section format % thanks to https://latex.org/forum/viewtopic.php?p=83118&sid=a22ccb456531faabf65070c18af69680#p83118 for elegant solution \makeatletter @@ -267,10 +347,10 @@ \renewcommand{\cftloftitlefont}{\hfill\bfseries\MakeUppercase} \renewcommand{\cftafterloftitle}{\hfill} \renewcommand{\cftlottitlefont}{\hfill\bfseries\MakeUppercase} -\renewcommand{\cftafterlottitle}{\hfill} - % TOC depth +\makeatletter \setcounter{tocdepth}{\skripsikvopt@tocdepth} +\makeatother % Defines a new glossary called “notation” \newglossary[nlg]{notation}{not}{ntn}{Notation}