Compare commits

...

32 Commits

Author SHA1 Message Date
nuluh
190cd0904e fix(latex): fix merge conflicts 2025-05-12 00:45:30 +07:00
nuluh
6105da57f0 Merge branch 'latex/57-feat-add-dynamic-page-style-for-chapter-page' into latex/initial-template 2025-05-12 00:36:34 +07:00
nuluh
63da3b6308 fix(latex): remove titlepage environment from frontmattersection macro to make the \frontmatter and \mainmatter pagination number type change properly
Closes #57
2025-05-12 00:31:24 +07:00
nuluh
5634776d26 fix(latex): fix wrong endorsement content by moving it into approval sheet 2025-05-12 00:08:40 +07:00
nuluh
e65026f9ca feat(latex): add originality statement content 2025-05-12 00:06:24 +07:00
nuluh
eb1d2a87b4 refactor(latex): move figure numbering declaration 2025-05-11 23:05:13 +07:00
nuluh
1f275fad42 feat(latex): add figure and table numbering to include chapter numbern arabic despite the chapter number using roman and dummy figures to test 2025-05-11 22:57:26 +07:00
nuluh
07ed6a9a13 fix(latex): reorder document structure by moving \frontmatter and \mainmatter for proper page numbering 2025-05-11 22:54:02 +07:00
nuluh
1b20376700 Merge branch 'latex/initial-template' into latex/57-feat-add-dynamic-page-style-for-chapter-page 2025-05-11 22:15:40 +07:00
nuluh
104b72e624 fix(latex): remove second \hfill in the \cftaftertoctitle to fix the \contentsname with book document class 2025-05-11 22:15:05 +07:00
nuluh
e9568583e4 fix(latex): change document class from report to book for having access to \frontmatter, \mainmatter, and \backmatter 2025-05-11 22:13:46 +07:00
nuluh
ae201d61fa Merge branch 'latex/initial-template' into latex/57-feat-add-dynamic-page-style-for-chapter-page 2025-05-11 21:56:14 +07:00
nuluh
921dc9245c fix(latex): add draft watermark functionality with conditional loading 2025-05-11 19:32:13 +07:00
nuluh
bf3c43639d fix(latex): update page layout margins to 3cm for all sides 2025-05-11 18:26:46 +07:00
nuluh
f38d44df1d fix(latex): add dummy introductory chapter and sections for doing unittest of new implemented page number and chapter numbering 2025-05-11 13:00:53 +07:00
nuluh
5c70d7db51 fix(latex): ensure fancyplain page style preset is applied before content inclusion so it use top right number for non-first-page chapter 2025-05-11 12:54:55 +07:00
nuluh
702760cc5e fix(latex): assign fancyhdr preset page style to frontmatter section macro 2025-05-11 12:52:52 +07:00
nuluh
43a0f40182 fix(latex): creating header and footer styles preset 2025-05-11 12:51:23 +07:00
nuluh
92a7143d90 fix(latex): update frontmatter section command to correctly add TOC entries as chapters 2025-05-11 11:38:53 +07:00
nuluh
5e08d4f8c6 fix(latex): remove custom table of contents command since it doesnt give any effects when directly \renewcommand without through packages 2025-05-11 11:21:50 +07:00
nuluh
907f725fa7 fix(latex): remove redundant command for chapter dot separation in TOC 2025-05-11 11:13:20 +07:00
nuluh
676b2b1a87 fix(latex): remove accidental prefix 'chapter' string in TOC and fix the section numbering to keep using chapter's counter in arabic instead of inherited in roman 2025-05-11 11:12:50 +07:00
nuluh
e0fbc23257 fix(latex): ensure TOC and references respect custom numbering by redefining \thechapter to preserve the roman in TOC 2025-05-11 11:09:24 +07:00
nuluh
39f966e71b chore(latex): clarify comment for TOC title styling in thesis class 2025-05-11 10:56:32 +07:00
nuluh
740680d1c7 fix(latex): fix \contentsname to keep the title centered by adding dummy second \hfill in the \cftaftertoctitle when using \fancypagestyle or other fancyhdr effects 2025-05-11 10:45:42 +07:00
nuluh
2db5170366 fix(latex): correct chapter dot leaders and page font in table of contents to be all normalfont for all level instead of bfseries 2025-05-11 10:41:40 +07:00
nuluh
f83b890055 fix(latex): add tocbibind package to include toc itself in the toc and give dot leaders to it. 2025-05-11 10:23:30 +07:00
nuluh
7820dd580a feat(latex): add endorsement page with committee approval details and department head information 2025-05-11 08:37:19 +07:00
nuluh
6c0fb67b86 refactor(latex): refactor metadata commands for thesis information and load from external file to implement reusability 2025-05-11 01:08:49 +07:00
nuluh
792ed64027 fix(latex): adjust section number width in table of contents for best desired looks 2025-05-11 00:48:57 +07:00
nuluh
c57a916a1a fixlatex): fix chapter formatting and spacing in thesis class to be aligned at before chapter number and restyle \chapter to be centered and use hardcoded prefix "BAB" following with roman numbering 2025-05-10 18:50:41 +07:00
nuluh
ca668ffc5f feat(latex): add endorsement and originality statements to the document 2025-05-10 17:39:36 +07:00
8 changed files with 261 additions and 48 deletions

View File

@@ -0,0 +1,25 @@
\chapter{PENDAHULUAN}
\section{Latar Belakang}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consequat lectus dolor, a commodo odio suscipit nec. Aliquam posuere elit eget tellus dapibus, auctor ornare mi porttitor. Donec auctor aliquet nisl, quis convallis ligula rutrum id. Duis tortor ipsum, scelerisque vestibulum viverra eu, maximus vel mi. Nullam volutpat nunc et varius tempor. Vivamus convallis mi eros, aliquam semper dui tincidunt a. Morbi nunc dui, accumsan ac arcu nec, condimentum efficitur mauris. Etiam sed mauris semper, volutpat justo eu, placerat mauris. Suspendisse at erat eu arcu gravida mattis et id nunc. Aliquam malesuada magna odio, ac dictum erat vestibulum a. Mauris vel nisi sit amet elit tempor bibendum sit amet a velit. Morbi dignissim facilisis placerat.\par
\begin{figure}
\centering
\includegraphics[width=0.5\linewidth]{frontmatter/img/slice1.jpg}
\caption{Enter Caption}
\label{fig:enter-label}
\end{figure}
Pellentesque vel accumsan lorem, id vulputate metus. Nulla mollis orci ante, et euismod erat venenatis eget. Proin tempus lobortis feugiat. Fusce vitae sem quis lacus iaculis dignissim ut eget turpis. Vivamus ut nisl in enim porttitor fringilla vel et mauris. Mauris quis porttitor magna. Pellentesque molestie viverra arcu at tincidunt. Maecenas non elit arcu.\par
Etiam feugiat enim sit amet tortor interdum lobortis. Curabitur elementum faucibus sapien. Morbi eget facilisis lorem. In sed suscipit metus. Etiam porttitor, libero sit amet sodales hendrerit, libero dolor hendrerit nulla, sed convallis risus leo posuere metus. Cras gravida ac elit viverra ultrices. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Maecenas dictum urna elit, nec eleifend nulla mattis sit amet. Pellentesque suscipit metus vitae leo suscipit, a vehicula quam pretium. Sed eu est ut risus convallis hendrerit a vulputate justo. Nulla sollicitudin quam ut risus euismod, quis consequat dui mattis. Mauris id eros varius, pellentesque quam quis, venenatis tellus. Nulla vitae condimentum nisl. Vestibulum suscipit scelerisque dui, non posuere purus finibus nec. Nulla ultrices felis quis vestibulum porta. Suspendisse potenti.\par
Nam tempus tincidunt interdum. Pellentesque at ligula ac massa semper efficitur vitae non ante. Suspendisse potenti. Cras vitae interdum erat, nec facilisis urna. Nulla commodo porttitor tellus non posuere. Vestibulum tristique ut urna quis porttitor. Sed pellentesque lectus sit amet ultrices aliquam. Aliquam erat volutpat. Nam dictum eu erat a mollis. Donec eget nulla vel risus aliquet suscipit sed at libero.\par
Maecenas hendrerit pharetra bibendum. Donec ut tortor ac augue aliquam ullamcorper nec id eros. Quisque consectetur elementum ipsum vitae posuere. Sed ultricies ipsum nibh, vitae volutpat neque bibendum at. Morbi dictum metus eu bibendum malesuada. Nam scelerisque purus erat, id dictum nisl pretium vitae. Curabitur finibus commodo dui ac molestie. In sed sem ac dui dapibus ullamcorper. Aenean molestie nulla eu lorem maximus hendrerit. Vivamus viverra velit dolor, in vehicula eros facilisis at. Vivamus in rhoncus sem.
\section{Lingkup Penelitian}
\section{Tujuan Penelitian}
\section{Manfaat Penelitian}
% \subsubsection{Dolor}

View File

@@ -0,0 +1,14 @@
\chapter{TINJAUAN PUSTAKA DAN LANDASAN TEORI}
\section{Tinjauan Pustaka}
\begin{figure}[!ht]
\centering
\includegraphics[width=0.5\linewidth]{frontmatter/img/slice1.jpg}
\caption{Enter Caption}
\label{fig:enter-label}
\end{figure}
\section{Dasar Teori}
\subsection{Short-Time Fourier Transform}
\subsection{Machine Learning}
% \subsubsection{Dolor}

View File

@@ -0,0 +1,64 @@
% frontmatter/endorsement.tex
\setmainfont{Times New Roman}
\begin{center}
\textbf{\Large LEMBAR PERSETUJUAN TUGAS AKHIR} \\[0.5em]
\textit{APPROVAL SHEET}
\end{center}
\vspace{1em}
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{llp{10cm}}
\textbf{Judul} & : & \thesistitle \\
\textit{Title} & & \\
\textbf{Mahasiswa} & : & \studentname \\
\textit{Student} & & \\
\textbf{Nomor Mahasiswa} & : &\studentid \\
\textit{Student ID.} & & \\
\textbf{Dosen Pembimbing} & : & 1. \firstadvisor \\
\textit{Advisors} & & 2. \secondadvisor
\end{tabular}
\vspace{1em}
\textbf{Telah disetujui oleh Tim Penguji:} \\
\textit{Approved by the Committee on Oral Examination}
\vspace{1em}
\begin{tabular}{lp{5cm}}
\textbf{\firstadvisor} &:
% \vspace{2cm} % signature space
% \\[1em] % pull up next row
\\
\textit{Ketua Tim Penguji} &
\noindent\makebox[5cm]{\hrulefill}\\[-0.5em]
\textit{\small Chair} & \small Yogyakarta, \dotfill 2020
\\
\textbf{\secondadvisor} &:
% \vspace{2cm} % signature space
% \\[1em] % pull up next row
\\
\textit{Ketua Tim Penguji} &
\noindent\makebox[5cm]{\hrulefill}\\[-0.5em]
\textit{\small Chair} & \small Yogyakarta, \dotfill 2020 \\
\end{tabular}
\vspace{1em}
\noindent
\textbf{Diterima dan disetujui sebagai persyaratan untuk memperoleh gelar Sarjana Teknik} \\
\textit{Accepted in partial fulfillment of the requirements for the degree of Bachelor of Engineering}
\vspace{2em}
\begin{center}
\textbf{Ketua Program Studi} \\
\textit{Head of Department}
\end{center}
\vspace{3em}
\begin{center}
\textbf{\headdepartement} \\
NIK. \headdepartementid
\end{center}

View File

@@ -0,0 +1,7 @@
% frontmatter/endorsement.tex
\setmainfont{Times New Roman}
\chapter*{LEMBAR PENGESAHAN TUGAS AKHIR}
\begin{center}
{\normalsize\textit{ENDORSEMENT SHEET}}
\end{center}

View File

@@ -0,0 +1,39 @@
% frontmatter/originality.tex
\setmainfont{Times New Roman}
\chapter*{PERNYATAAN KEASLIAN}
% \begin{center}
% {\normalsize\textit{ORIGINALITY STATEMENT}}
% \end{center}
Saya yang bertanda tangan di bawah ini:
\renewcommand{\arraystretch}{1.2}
\begin{center}
\begin{tabular}{llp{10cm}}
\textbf{Nama} & : & \studentname \\
\textbf{Nomor Mahasiswa} & : & \studentid \\
\textbf{Judul} & : & \thesistitle \\
\end{tabular}
\end{center}
Menyatakan dengan sebenarnya bahwa tugas akhir ini merupakan karya says sendiri. Apabila terdapat karya orang lain yang saya kutip, maka saya akan mencantumkan sumber secara jelas. Jika dikemudian hari ditemukan dengan ketidakbenaran dalam pernyataan in, maka saya bersedia menerima sanksi dengan aturan yang berlaku. Demikian pernyataan ini saya buat tanpa ada paksaan dari pihak mana pun.\par
\begin{flushright}
\begin{minipage}{0.5\textwidth}
\centering
Yogyakarta, \today \\[1em]
Yang membuat pernyataan, \\[0.5cm] % space for signature
% Materai box
\hspace*{-2cm}% shift the box slightly left
\begin{tabular}{@{}c@{}}
\fbox{
\begin{minipage}[c][2cm][c]{2.5cm}
\centering
Materai\\
6000
\end{minipage}
}
\end{tabular}
\\[1cm]
% \rule{6cm}{0.4pt} % signature line
Rifqi Damar Panuluh
\end{minipage}
\end{flushright}

View File

@@ -1,4 +1,4 @@
\documentclass{thesis}
\documentclass[draftmark]{thesis}
% Title Information
\setthesisinfo
@@ -18,9 +18,14 @@
\begin{document}
\maketitle
\frontmatter
\setcounter{page}{1}
\theendorsementpage{toc}
\originalitystatement{toc}
\tableofcontents
\clearpage
\mainmatter
\pagestyle{fancyplain}
% Include content
\include{content/abstract}
\include{content/introduction}

11
latex/metadata.tex Normal file
View File

@@ -0,0 +1,11 @@
\newcommand{\studentname}{Rifqi Damar Panuluh}
\newcommand{\studentid}{20210110224}
\newcommand{\thesistitle}{Prediksi Lokasi Kerusakan dengan Machine Learning}
\newcommand{\firstadvisor}{Ir. Muhammad Ibnu Syamsi, Ph.D.}
\newcommand{\secondadvisor}{}
\newcommand{\headdepartement}{Puji Harsanto, S.T. M.T., Ph.D.}
\newcommand{\headdepartementid}{19740607201404123064}
\newcommand{\faculty}{Fakultas Teknik}
\newcommand{\program}{Teknik Sipil}
\newcommand{\university}{Universitas Muhammadiyah Yogyakarta}
\newcommand{\yearofsubmission}{2025}

View File

@@ -1,7 +1,12 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{thesis}[2025/05/10 Bachelor Thesis Class]
\LoadClass[a4paper,12pt]{report}
\newif\if@draftmark
\@draftmarkfalse
\DeclareOption{draftmark}{\@draftmarktrue}
\ProcessOptions \relax
\LoadClass[a4paper,12pt,oneside]{book}
% Load common packages
\RequirePackage{fontspec}
@@ -13,9 +18,20 @@
\RequirePackage{hyperref}
\RequirePackage{etoolbox}
\RequirePackage{tocloft}
\RequirePackage{tocbibind}
% Conditionally load the watermark package and settings
\if@draftmark
\RequirePackage{draftwatermark}
\SetWatermarkText{Draft: \today [wip]}
\SetWatermarkColor[gray]{0.7}
\SetWatermarkFontSize{2cm}
\SetWatermarkAngle{90}
\SetWatermarkHorCenter{1.5cm}
\fi
% Page layout
\geometry{margin=1in}
\geometry{left=3cm, top=3cm, right=3cm, bottom=3cm}
\setlength{\parskip}{0.5em}
\setlength{\parindent}{0pt}
\onehalfspacing
@@ -27,13 +43,7 @@
\setmonofont{Courier New}
% Metadata commands
\newcommand{\studentname}{}
\newcommand{\studentid}{}
\newcommand{\thesistitle}{}
\newcommand{\faculty}{}
\newcommand{\program}{}
\newcommand{\university}{}
\newcommand{\yearofsubmission}{}
\input{metadata}
\newcommand{\setthesisinfo}[7]{%
\renewcommand{\thesistitle}{#1}%
@@ -45,64 +55,102 @@
\renewcommand{\yearofsubmission}{#7}%
}
% Header and footer
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\nouppercase{\rightmark}}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}
% % Header and footer
\fancypagestyle{fancy}{%
\fancyhf{}
\fancyhead[R]{\nouppercase{\rightmark}}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}
}
\fancypagestyle{fancyplainfrontmatter}{%
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage}
}
\fancypagestyle{fancyplain}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\thepage}
}
% Chapter formatting
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter.}{1em}{}
\titlespacing*{\chapter}{0pt}{-10pt}{20pt}
\titlespacing{\chapter}{0pt}{0pt}{*1.5}
\titleformat{\chapter}[display]
{\normalsize\bfseries\centering}
{BAB~\Roman{chapter}} % << display format
{1ex}
{\MakeUppercase}
\titleformat{\section}
{\normalsize\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalsize\bfseries}{\thesubsection}{1em}{}
% Ensure chapter reference in TOC matches
\renewcommand{\cftchappresnum}{BAB~}
\renewcommand{\cftchapaftersnum}{\quad}
% \titlespacing*{\chapter}{0pt}{-10pt}{20pt}
% Redefine \maketitle
\renewcommand{\maketitle}{\input{frontmatter/maketitle}}
% Chapter & Section format
\renewcommand{\cftchapfont}{\bfseries\MakeUppercase}
\renewcommand{\cftsecfont}{}
\renewcommand{\cftsubsecfont}{\itshape}
\renewcommand{\cftchapfont}{\normalsize\MakeUppercase}
% \renewcommand{\cftsecfont}{}
% \renewcommand{\cftsubsecfont}{\itshape}
% \renewcommand{\thesection}{\textup{\Roman{chapter}}.\arabic{section}}
% Dot leaders, spacing, indentation
\setlength{\cftbeforechapskip}{1em}
\setlength{\cftbeforechapskip}{0em}
\setlength{\cftchapindent}{0pt}
\setlength{\cftsecindent}{1.5em}
\setlength{\cftsubsecindent}{3em}
\setlength{\cftchapnumwidth}{3em}
\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{2.5em}
\setlength{\cftchapnumwidth}{3.5em}
\setlength{\cftsecnumwidth}{3.5em}
\setlength{\cftsubsecnumwidth}{4.5em}
\setlength{\cftsubsecnumwidth}{2.5em}
\renewcommand \cftchapdotsep{4.5} % https://tex.stackexchange.com/a/273764
\renewcommand{\cftchapleader}{\normalfont\cftdotfill{\cftsecdotsep}}
\renewcommand{\cftchappagefont}{\normalfont}
% Title styling
\renewcommand{\contentsname}{\hfill\bfseries\normalsize DAFTAR ISI\hfill}
\renewcommand{\cfttoctitlefont}{\bfseries\MakeUppercase}
% Ensure TOC and References Respect Custom Numbering
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand\thesection{\arabic{chapter}.\arabic{section}}
% Change figure numbering to include chapter (e.g., Figure 1.1, 1.2...)
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
% Table of Content (TOC) Title styling
\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\cfttoctitlefont}{\hfill\bfseries\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill} % https://tex.stackexchange.com/a/255699/394075
% \renewcommand{\cfttoctitlefont}{\bfseries\MakeUppercase}
% \renewcommand{\cftaftertoctitle}{\vskip 2em}
\renewcommand{\tableofcontents}{
\clearpage
\pagestyle{plain} % Roman page number, centered bottom
\pagenumbering{roman}
\setcounter{page}{viii} % Optional: sync with expected numbering
\addcontentsline{toc}{chapter}{DAFTAR ISI}
\oldtableofcontents
\clearpage
\pagenumbering{arabic}
\setcounter{page}{1} % Start chapter 1 at page 1
}
% Frontmatter Macro (Toggle TOC Inclusion)
\newcommand{\frontmattersection}[3]{%
\begin{titlepage}
\centering
\ifstrequal{#1}{toc}{\section*{#2}\addcontentsline{toc}{section}{#2}}{\section*{#2}}%
% \begin{titlepage}
\ifstrequal{#1}{toc}{\thispagestyle{fancyplainfrontmatter}\addcontentsline{toc}{chapter}{#2}}{\chapter*{#2}}%
\input{frontmatter/#3}
\end{titlepage}
% \end{titlepage}
\clearpage
}
% Wrapper Command for Each Page
\newcommand{\theendorsementpage}[1]{\frontmattersection{#1}{Pengesahan}{endorsement}}
\newcommand{\originalitystatement}[1]{\frontmattersection{#1}{Pernyataan Keaslian}{originality}}
\newcommand{\theacknowledgementpage}[1]{\frontmattersection{#1}{LEMBAR PERNYATAAN}{acknowledgement}}
\newcommand{\theapprovalpage}[1]{\frontmattersection{#1}{LEMBAR PERSETUJUAN}{approval}}
\newcommand{\theendorsementpage}[1]{\frontmattersection{#1}{LEMBAR PENGESAHAN}{endorsement}}
\newcommand{\originalitystatement}[1]{\frontmattersection{#1}{PERNYATAAN KEASLIAN}{originality}}
% % 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
% % }
\endinput