Files
itc.pidi-3-docs/pidi-thesis.cls
T

247 lines
6.4 KiB
OpenEdge ABL

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{pidi-thesis}[2025/09/03 v1.0 PidI Thesis Class]
\newif\if@times
\newif\if@calibri
\newif\if@arial
\@timestrue % default
\DeclareOption{times}{\@timestrue \@arialfalse \@calibrifalse}
\DeclareOption{calibri}{\@calibritrue \@arialfalse \@timesfalse}
\DeclareOption{arial}{\@arialtrue \@calibrifalse \@timesfalse}
% pass through unknown options to base class if needed
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
% size depends on font choice: Times (12pt) vs sans (11pt)
\if@times
\LoadClass[12pt,a4paper]{report}
\else
\LoadClass[11pt,a4paper]{report}
\fi
% --- Packages
\RequirePackage[a4paper,left=3cm,right=2.5cm,top=3cm,bottom=2.5cm,headsep=1cm,footskip=10mm,includehead,includefoot]{geometry}
\RequirePackage{float}
\RequirePackage{iftex}
\RequirePackage{microtype}
\RequirePackage{setspace}
\RequirePackage{graphicx}
\RequirePackage{booktabs}
\RequirePackage{tabularx}
\RequirePackage{caption}
\RequirePackage{titlesec}
\RequirePackage{enumitem}
\RequirePackage{fancyhdr}
\RequirePackage{hyperref}
\RequirePackage{xcolor}
\RequirePackage[ngerman,english]{babel}
\RequirePackage{csquotes}
\RequirePackage{transparent}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{changepage}
\RequirePackage{listings}
\RequirePackage{minted}
\RequirePackage{pdfpages}
\RequirePackage{longtable}
\RequirePackage[htt]{hyphenat}
% Code highlighting
\usemintedstyle{default}
% Fonts: sans (Arial/Calibri) in 11pt, or Times New Roman 12pt
\ifPDFTeX
\if@times
\RequirePackage{newtxtext}
\else
\RequirePackage[scaled=0.95]{helvet}
\renewcommand{\familydefault}{\sfdefault}
\fi
\else
\RequirePackage{fontspec}
\if@times
\setmainfont{TimesNewerRoman-Regular.otf}[
BoldFont = TimesNewerRoman-Bold.otf,
ItalicFont = TimesNewerRoman-Italic.otf,
BoldItalicFont = TimesNewerRoman-BoldItalic.otf
]
\else
\if@calibri
\setmainfont{Calibri}
\else
\setmainfont{Arial}
\fi
\fi
\fi
% Line spacing
\setstretch{1.3}
% Paragraph spacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt}
% Headings: bold + clear visual hierarchy
\titleformat{\chapter}{\bfseries\LARGE}{\thechapter\quad}{0pt}{}
\titlespacing*{\chapter}{0pt}{*2}{*1}
\titleformat{\section}{\bfseries\Large}{\thesection\quad}{0pt}{}
\titlespacing*{\section}{0pt}{*1.5}{*0.8}
\titleformat{\subsection}{\bfseries\large}{\thesubsection\quad}{0pt}{}
\titlespacing*{\subsection}{0pt}{*1.2}{*0.6}
% Emphasis should be bold as per spec
\renewcommand{\emph}[1]{\textbf{#1}}
% Captions a bit tighter
\captionsetup{font=small,labelfont=bf}
% Lists tighter by default
\setlist{itemsep=3pt plus 1pt, topsep=6pt}
% Header & footer: page number bottom-center; optional header with short title
\pagestyle{fancy}
\fancyhf{} % clear
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% Redefine 'plain' style to ensure chapter starting pages also use bottom-center numbering
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
% Optional header content command; placed 1cm above text via headsep=1cm
\newcommand{\shorthead}{}
\fancyhead[L]{\shorthead}
\newcommand{\headerlogo}{}
\fancyhead[R]{\IfFileExists{\headerlogo}{\includegraphics[height=1em]{\headerlogo}}{}}
\renewcommand{\headrulewidth}{0.4pt}
% Hyperref setup
\hypersetup{
pdftitle={},
pdfauthor={},
colorlinks=true,
linkcolor=[rgb]{0.0,0.2,0.6},
citecolor=[rgb]{0.0,0.2,0.6},
urlcolor=[rgb]{0.0,0.2,0.6}
}
% --- Meta fields
\newcommand{\thesistitle}{}
\newcommand{\thesisshorttitle}{}
\newcommand{\authorname}{}
\newcommand{\matrikel}{}
\newcommand{\degree}{}
\newcommand{\institution}{}
\newcommand{\faculty}{}
\newcommand{\course}{Praktikum in der Industrie (PidI 3)}
\newcommand{\company}{}
\newcommand{\advisor}{}
\newcommand{\daterange}{}
\newcommand{\submissiondate}{}
\newcommand{\setthesismeta}[9]{%
\renewcommand{\thesistitle}{#1}%
\renewcommand{\thesisshorttitle}{#2}%
\renewcommand{\authorname}{#3}%
\renewcommand{\matrikel}{#4}%
\renewcommand{\degree}{#5}%
\renewcommand{\institution}{#6}%
\renewcommand{\faculty}{#7}%
\renewcommand{\company}{#8}%
\renewcommand{\advisor}{#9}%
}
\newcommand{\setdates}[2]{%
\renewcommand{\daterange}{#1}%
\renewcommand{\submissiondate}{#2}%
}
% Update header and pdf meta when title/author set
\AtBeginDocument{%
\renewcommand{\shorthead}{\thesisshorttitle}%
\hypersetup{pdftitle=\thesistitle, pdfauthor=\authorname}%
}
% Title page per spec, clean & simple
\newcommand{\companylogo}{}
\newcommand{\unilogo}{}
\newcommand{\maketitlepage}{%
\begin{titlepage}
\newcommand{\hlogo}{1.5cm}
\centering
{\bfseries\LARGE \thesistitle\par}
\vspace{2em}
{\Large \course\par}
\vspace{2em}
{\large \textbf{Autor/in:} \authorname \\
\textbf{Matrikelnummer:} \matrikel \par}
\vspace{1em}
{\large \textbf{Studiengang/Abschluss:} \degree \par}
\vspace{1em}
{\large \textbf{Hochschule:} \institution \\
\textbf{Fakultät/Bereich:} \faculty \par}
\vspace{1em}
{\large \textbf{Partnerunternehmen:} \company \\
\textbf{Betreuer/in im Unternehmen:} \advisor \par}
\vspace{2em}
\includegraphics[height=\hlogo]{\companylogo}
\hfill
\includegraphics[height=\hlogo]{\unilogo}
\vfill
{\large \textbf{Tätigkeitszeitraum:} \daterange \par}
\vspace{0.5em}
{\large \textbf{Abgabedatum:} \submissiondate \par}
\addcontentsline{toc}{chapter}{Titelseite}
\end{titlepage}
}
% Confirmation page (Bescheinigung)
\newcommand{\confirmationpage}{%
\chapter*{Bescheinigung}
Hiermit wird bestätigt, dass \textbf{\authorname} das Praktikum \textbf{\course} im Partnerunternehmen \textbf{\company} im Zeitraum \textbf{\daterange} selbständig durchgeführt hat. Es wurden mindestens \textbf{24 Manntage} an dem Projekt gearbeitet. Der Einsatz von KI beschränkt sich maximal auf die erlaubten Zwecke.
\vspace{4em}
\begin{tabularx}{\textwidth}{X X}
\hrulefill & \hrulefill \\
Ort, Datum & Unterschrift Betreuer/in \\
\end{tabularx}
\addcontentsline{toc}{chapter}{Bescheinigung}
\clearpage
}
% Abstract & declarations convenience
\newcommand{\frontmatterpages}{%
\pagenumbering{roman}
\maketitlepage
\renewcommand*\contentsname{Inhaltsangabe}
\tableofcontents
\addcontentsline{toc}{chapter}{Inhaltsangabe}
\confirmationpage
\input{frontmatter/usage-of-ai}
\input{frontmatter/abstract}
\input{frontmatter/acknowledgments}
\clearpage
\pagenumbering{arabic}
}
% Bibliography (biblatex expected)
\newcommand{\printrefs}{%
\clearpage
\addcontentsline{toc}{chapter}{Literaturverzeichnis}
\printbibliography
}