feat(latex): create thesis class and initial document structure with title page and macros
This commit is contained in:
95
latex/thesis.cls
Normal file
95
latex/thesis.cls
Normal file
@@ -0,0 +1,95 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesClass{thesis}[2025/05/10 Bachelor Thesis Class]
|
||||
|
||||
\LoadClass[a4paper,12pt]{report}
|
||||
|
||||
% Load common packages
|
||||
\RequirePackage{fontspec}
|
||||
\RequirePackage{titlesec}
|
||||
\RequirePackage{fancyhdr}
|
||||
\RequirePackage{geometry}
|
||||
\RequirePackage{setspace}
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{hyperref}
|
||||
\RequirePackage{etoolbox}
|
||||
\RequirePackage{tocloft}
|
||||
|
||||
% Page layout
|
||||
\geometry{margin=1in}
|
||||
\setlength{\parskip}{0.5em}
|
||||
\setlength{\parindent}{0pt}
|
||||
\onehalfspacing
|
||||
|
||||
% Fonts
|
||||
\defaultfontfeatures{Ligatures=TeX}
|
||||
\setmainfont{Times New Roman}
|
||||
\setsansfont{Arial}
|
||||
\setmonofont{Courier New}
|
||||
|
||||
% Metadata commands
|
||||
\newcommand{\studentname}{}
|
||||
\newcommand{\studentid}{}
|
||||
\newcommand{\thesistitle}{}
|
||||
\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}%
|
||||
}
|
||||
|
||||
% Header and footer
|
||||
\pagestyle{fancy}
|
||||
\fancyhf{}
|
||||
\fancyhead[R]{\nouppercase{\rightmark}}
|
||||
\fancyhead[L]{\nouppercase{\leftmark}}
|
||||
\fancyfoot[C]{\thepage}
|
||||
|
||||
% Chapter formatting
|
||||
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter.}{1em}{}
|
||||
\titlespacing*{\chapter}{0pt}{-10pt}{20pt}
|
||||
|
||||
% Redefine \maketitle
|
||||
\renewcommand{\maketitle}{\input{frontmatter/maketitle}}
|
||||
|
||||
% Chapter & Section format
|
||||
\renewcommand{\cftchapfont}{\bfseries\MakeUppercase}
|
||||
\renewcommand{\cftsecfont}{}
|
||||
\renewcommand{\cftsubsecfont}{\itshape}
|
||||
|
||||
% Dot leaders, spacing, indentation
|
||||
\setlength{\cftbeforechapskip}{1em}
|
||||
\setlength{\cftchapindent}{0pt}
|
||||
\setlength{\cftsecindent}{1.5em}
|
||||
\setlength{\cftsubsecindent}{3em}
|
||||
\setlength{\cftchapnumwidth}{3em}
|
||||
\setlength{\cftsecnumwidth}{3.5em}
|
||||
\setlength{\cftsubsecnumwidth}{4.5em}
|
||||
|
||||
% Title styling
|
||||
\renewcommand{\contentsname}{\hfill\bfseries\normalsize DAFTAR ISI\hfill}
|
||||
\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
|
||||
}
|
||||
|
||||
|
||||
|
||||
\endinput
|
||||
Reference in New Issue
Block a user