From bbfc6bc635a60b04992f9d31735b832dd69be76f Mon Sep 17 00:00:00 2001
From: lordkekz <lordkekz@lkekz.de>
Date: Tue, 7 Jan 2025 12:45:14 +0100
Subject: [PATCH 1/5] feat: Make thesis type a variable instead of option

Use `\ThesisSetType{Bachelor}` or similar to set the exact kind of thesis
you're writing. The class options `bachelor` and `master` have been
removed.
---
 mluthesis.cls | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/mluthesis.cls b/mluthesis.cls
index 66b287b..b552d09 100644
--- a/mluthesis.cls
+++ b/mluthesis.cls
@@ -19,18 +19,6 @@
 \RequirePackage{xifthen}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Options
-\newcommand{\thesistype}{}
-\DeclareOption{bachelor}{%
-\renewcommand{\thesistype}{Bachelor}%
-}
-\DeclareOption{master}{%
-\renewcommand{\thesistype}{Master}%
-}
-\ExecuteOptions{bachelor} % default
-
-\ProcessOptions
-
 % Font
 \RequirePackage{libertine}
 \RequirePackage{sourcecodepro}
@@ -69,6 +57,9 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % Variables
+\newtoks\thesistype
+\newcommand{\ThesisSetType}[1]{\global\thesistype{#1}}
+
 \newtoks\thesistitle
 \newcommand{\ThesisSetTitle}[1]{\global\thesistitle{#1}}
 
@@ -154,7 +145,7 @@
 \newtoks\thesisdeclarationtext
 \newtoks\thesisfrontmatterkeywords
 \global\thesisfrontpagecourse{Degree Programme }
-\global\thesisfrontpagetypename{\thesistype's Thesis}
+\global\thesisfrontpagetypename{\the\thesistype's Thesis}
 \global\thesisfrontpagestudentnumber{Matriculation Number}
 \global\thesisfrontpageborn{Born \the\thesisauthordateofbirth{} in \the\thesisauthorplaceofbirth}
 \global\thesisfrontpagesupervisor{Referee}
@@ -168,7 +159,7 @@
 \global\thesisfrontmatterkeywords{Keywords}
 \IfGerman{%
   \global\thesisfrontpagecourse{Studiengang }
-  \global\thesisfrontpagetypename{\thesistype arbeit}
+  \global\thesisfrontpagetypename{\the\thesistype arbeit}
   \global\thesisfrontpagestudentnumber{Matrikelnummer}
   \global\thesisfrontpageborn{geb.\ am:\ \the\thesisauthordateofbirth{} in %
     \the\thesisauthorplaceofbirth}
-- 
GitLab


From 74f5c7ca307bdd6ebbf82ef4ef81a2202227264f Mon Sep 17 00:00:00 2001
From: lordkekz <lordkekz@lkekz.de>
Date: Wed, 15 Jan 2025 14:46:46 +0100
Subject: [PATCH 2/5] Improve frontpage supervisor list

1. Numbers are now hidden if it's exactly one Supervisor.
   `\ThesisSetSupervisors{Just One}` leads to:
   "Referee: Just One"
   `\ThesisSetSupervisors{{First One},{Then Another}}` leads to:
   "1. Referee: First One\\2. Referee: Then Another"
2. It's now possible to override the label if your thesis type
   needs a different one.
   `\ThesisOverrideSupervisorLabel{Betreuer}` changes the label:
   "1. Betreuer: First One\\2. Betreuer: Then Another"
---
 mluthesis.cls | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/mluthesis.cls b/mluthesis.cls
index b552d09..70d620e 100644
--- a/mluthesis.cls
+++ b/mluthesis.cls
@@ -66,6 +66,9 @@
 \newtoks\thesisauthor
 \newcommand{\ThesisSetAuthor}[1]{\global\thesisauthor{#1}}
 
+\newtoks\thesissupervisorlabeloverride
+\newcommand{\ThesisOverrideSupervisorLabel}[1]{\global\thesissupervisorlabeloverride{#1}}
+
 \newtoks\thesissupervisors
 \newcommand{\ThesisSetSupervisors}[1]{\global\thesissupervisors{#1}}
 
@@ -148,7 +151,7 @@
 \global\thesisfrontpagetypename{\the\thesistype's Thesis}
 \global\thesisfrontpagestudentnumber{Matriculation Number}
 \global\thesisfrontpageborn{Born \the\thesisauthordateofbirth{} in \the\thesisauthorplaceofbirth}
-\global\thesisfrontpagesupervisor{Referee}
+\global\thesisfrontpagesupervisor{\ifthenelse{\value{\the\thesissupervisorlabeloverride}}{\the\thesissupervisorlabeloverride}{Referee}}
 \global\thesisfrontpagedateofsubmission{Submission date}
 \global\thesisdeclarationtitle{Declaration}
 \global\thesisdeclarationtext{%
@@ -163,7 +166,7 @@
   \global\thesisfrontpagestudentnumber{Matrikelnummer}
   \global\thesisfrontpageborn{geb.\ am:\ \the\thesisauthordateofbirth{} in %
     \the\thesisauthorplaceofbirth}
-  \global\thesisfrontpagesupervisor{Gutachter}
+  \global\thesisfrontpagesupervisor{\ifthenelse{\value{\the\thesissupervisorlabeloverride}}{\the\thesissupervisorlabeloverride}{Gutachter}}
   \global\thesisfrontpagedateofsubmission{Datum der Abgabe}
   \global\thesisdeclarationtitle{Erkl\"arung}
   \global\thesisdeclarationtext{Hiermit versichere ich, dass ich diese Arbeit %
@@ -172,12 +175,19 @@
   \global\thesisfrontmatterkeywords{Schl\"usselworte}
 }{}
 
+\RequirePackage{xstring}
+\newcommand*{\commalength}[1]{%
+  \StrCount{#1,}{,}%
+}
+
 % Frontpage
 \newcounter{supervisors}
+\newcounter{supervisorsPrecount}
 \newcommand{\printsupervisor}[1]{%
   \ifthenelse{\value{supervisors}=0}{}{\\}%
   \addtocounter{supervisors}{1}%
-  \arabic{supervisors}. \the\thesisfrontpagesupervisor:
+  \ifthenelse{\value{supervisorsPrecount}=1}{}{\arabic{supervisors}.}
+  \the\thesisfrontpagesupervisor:
   #1
 }
 \renewcommand{\maketitle}{
@@ -207,6 +217,7 @@
 
   \vspace{1em}
   \makeatletter%
+  \@for \name:=\the\thesissupervisors\do{\stepcounter{supervisorsPrecount}}%
   \@for \name:=\the\thesissupervisors\do{\printsupervisor{\name}}%
   \makeatother%
 
-- 
GitLab


From 5f6f15dd1c975e649108a69a4546c999a3f7fd48 Mon Sep 17 00:00:00 2001
From: lordkekz <lordkekz@lkekz.de>
Date: Wed, 15 Jan 2025 15:58:39 +0100
Subject: [PATCH 3/5] Fix and simplify supervisor handling

---
 mluthesis.cls | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/mluthesis.cls b/mluthesis.cls
index 70d620e..fcffc88 100644
--- a/mluthesis.cls
+++ b/mluthesis.cls
@@ -66,8 +66,9 @@
 \newtoks\thesisauthor
 \newcommand{\ThesisSetAuthor}[1]{\global\thesisauthor{#1}}
 
-\newtoks\thesissupervisorlabeloverride
-\newcommand{\ThesisOverrideSupervisorLabel}[1]{\global\thesissupervisorlabeloverride{#1}}
+% We can directly set the token register which is properly declared later, since the
+% class's initialization happens before the document's override is called.
+\newcommand{\ThesisOverrideSupervisorLabel}[1]{\global\thesisfrontpagesupervisor{#1}}
 
 \newtoks\thesissupervisors
 \newcommand{\ThesisSetSupervisors}[1]{\global\thesissupervisors{#1}}
@@ -151,7 +152,7 @@
 \global\thesisfrontpagetypename{\the\thesistype's Thesis}
 \global\thesisfrontpagestudentnumber{Matriculation Number}
 \global\thesisfrontpageborn{Born \the\thesisauthordateofbirth{} in \the\thesisauthorplaceofbirth}
-\global\thesisfrontpagesupervisor{\ifthenelse{\value{\the\thesissupervisorlabeloverride}}{\the\thesissupervisorlabeloverride}{Referee}}
+\global\thesisfrontpagesupervisor{Referee}
 \global\thesisfrontpagedateofsubmission{Submission date}
 \global\thesisdeclarationtitle{Declaration}
 \global\thesisdeclarationtext{%
@@ -166,7 +167,7 @@
   \global\thesisfrontpagestudentnumber{Matrikelnummer}
   \global\thesisfrontpageborn{geb.\ am:\ \the\thesisauthordateofbirth{} in %
     \the\thesisauthorplaceofbirth}
-  \global\thesisfrontpagesupervisor{\ifthenelse{\value{\the\thesissupervisorlabeloverride}}{\the\thesissupervisorlabeloverride}{Gutachter}}
+  \global\thesisfrontpagesupervisor{Gutachter}
   \global\thesisfrontpagedateofsubmission{Datum der Abgabe}
   \global\thesisdeclarationtitle{Erkl\"arung}
   \global\thesisdeclarationtext{Hiermit versichere ich, dass ich diese Arbeit %
-- 
GitLab


From d0dfd1991ffe51d9b0e2086425911203f914d7b7 Mon Sep 17 00:00:00 2001
From: lordkekz <lordkekz@lkekz.de>
Date: Sat, 18 Jan 2025 13:08:53 +0100
Subject: [PATCH 4/5] Add sample thesis

---
 .gitattributes             |  2 +
 mlu-siegel-transparent.png |  3 ++
 sample.bib                 | 29 ++++++++++++++
 sample.pdf                 |  3 ++
 sample.tex                 | 79 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 116 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 mlu-siegel-transparent.png
 create mode 100644 sample.bib
 create mode 100644 sample.pdf
 create mode 100644 sample.tex

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..5b2719d
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.pdf filter=lfs diff=lfs merge=lfs -text
+mlu-siegel-transparent.png filter=lfs diff=lfs merge=lfs -text
diff --git a/mlu-siegel-transparent.png b/mlu-siegel-transparent.png
new file mode 100644
index 0000000..4fe2b10
--- /dev/null
+++ b/mlu-siegel-transparent.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fb52f397154714d00bffb2e7a8ca1d024e8234900c2769fb6427e1c889869a64
+size 100447
diff --git a/sample.bib b/sample.bib
new file mode 100644
index 0000000..b4c36ad
--- /dev/null
+++ b/sample.bib
@@ -0,0 +1,29 @@
+% stolen from https://latex-tutorial.com/tutorials/bibtex/
+
+@article{ARTICLE:1,
+	AUTHOR = "John Doe",
+	TITLE = "Title",
+	JOURNAL = "Journal",
+	YEAR = "2017",
+}
+@book{DUMMY:1,
+	AUTHOR = "John Doe",
+	TITLE = "The Book without Title",
+	PUBLISHER = "Dummy Publisher",
+	YEAR = "2100",
+}
+@inbook{BOOK:2,
+	AUTHOR = "John Doe",
+	TITLE = "The Book without Title",
+	PUBLISHER = "Dummy Publisher",
+	YEAR = "2100",
+	PAGES = "100-200",
+}
+@misc{WEBSITE:1,
+	HOWPUBLISHED = "\url{http://example.com}",
+	AUTHOR = "Intel",
+	TITLE = "Example Website",
+	MONTH = "Dec",
+	YEAR = "1988",
+	NOTE = "Accessed on 2012-11-11",
+}
diff --git a/sample.pdf b/sample.pdf
new file mode 100644
index 0000000..28197ce
--- /dev/null
+++ b/sample.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54e8bfe81e0c17acd4d6e5eba92d346c21303e0dec7cfcf82688738709a89145
+size 521006
diff --git a/sample.tex b/sample.tex
new file mode 100644
index 0000000..48a6442
--- /dev/null
+++ b/sample.tex
@@ -0,0 +1,79 @@
+\documentclass[english]{mluthesis} % Supported languages: english, german
+
+\usepackage{hyperref}
+\usepackage{natbib, doi}
+\usepackage{graphicx}
+\usepackage{amsmath}
+\usepackage{csquotes}
+\MakeOuterQuote{"}
+
+\usepackage{lipsum} % for lorem ipsum sample text
+
+%%%%% DOKUMENTINFO %%%%%
+\ThesisSetType{Bachelor} % Bachelor, Master, Seminar, ...
+\ThesisSetTitle{Why mluthesis is the last thesis you'll need}
+\ThesisSetAuthor{Sam Student}
+\ThesisSetSubmissionDate{14}{03}{2100} % DD-MM-YYYY
+\ThesisSetLocation{Halle (Saale)}
+\ThesisSetStudentNumber{12345678}
+\ThesisSetDateOfBirth{01}{01}{2000} % DD-MM-YYYY
+\ThesisSetPlaceOfBirth{Musterstadt}
+\ThesisSetUniversity{Martin-Luther-Universität Halle-Wittenberg}
+\ThesisSetFaculty{Naturwissenschaftliche Fakultät III: Institut für Informatik}
+\ThesisSetCourseName{Computer Science}
+
+% You can override your language's default label for supervisors.
+% e.g. for a Seminar thesis, put "Betreuer" instead of "Gutachter" in german.
+% \ThesisOverrideSupervisorLabel{Adviser} 
+
+% This is a list, seperated with commata.
+% If you only put one entry, the numbers will be omitted.
+\ThesisSetSupervisors{{Prof. Professor McProfessorface}, {Dr. Noonien Soong}}
+
+% This puts the MLU sigil on the title page.
+\ThesisSetLogo{\includegraphics[width=\linewidth]{mlu-siegel-transparent.png}}
+
+\begin{document}
+\maketitle
+
+\pagebreak
+\tableofcontents
+
+\pagebreak
+\chapter*{Abstract}
+\lipsum[2-3]
+
+\chapter{Introduction}
+\lipsum[5-7]
+
+\chapter{Background}
+\lipsum[7-8]
+
+\chapter{Method of Comparison}
+\lipsum[5-7]
+
+\chapter{Comparison}
+\lipsum[13-15]
+
+\chapter{Discussion}
+\lipsum[5-6]
+
+\section{Results}
+\lipsum[5-6]
+
+\section{Threats To Validity}
+\lipsum[4-5]
+
+\chapter{Conclusion and Further Research Questions}
+\lipsum[7-10]
+
+\chapter{Related Work}
+\lipsum[5-7]
+
+\nocite{*}
+\bibliographystyle{plainnat}
+\bibliography{sample} % uses file sample.bib
+
+\declaration
+
+\end{document}
-- 
GitLab


From d06ffdfb65cc74bde0016115871fd86aa41be1df Mon Sep 17 00:00:00 2001
From: lordkekz <lordkekz@lkekz.de>
Date: Tue, 21 Jan 2025 13:52:41 +0100
Subject: [PATCH 5/5] cls: minor fixes; sample: Use biblatex instead of bibtex

---
 .gitattributes |  2 +-
 mluthesis.cls  |  4 ++--
 sample.pdf     |  4 ++--
 sample.tex     | 14 ++++++++------
 4 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 5b2719d..4952350 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,2 @@
 *.pdf filter=lfs diff=lfs merge=lfs -text
-mlu-siegel-transparent.png filter=lfs diff=lfs merge=lfs -text
+*.png filter=lfs diff=lfs merge=lfs -text
diff --git a/mluthesis.cls b/mluthesis.cls
index fcffc88..ce6782b 100644
--- a/mluthesis.cls
+++ b/mluthesis.cls
@@ -8,7 +8,7 @@
 \ProvidesClass{mluthesis}[2020/04/20 v1.0]
 
 % Load base class (scrbook).
-\LoadClass[a4paper,12pt,oneside,bibliography=totoc,chapterprefix=true,appendixprefix=true]{scrbook}
+\LoadClass[a4paper,12pt,oneside,bibliography=nottotoc,chapterprefix=true,appendixprefix=true]{scrbook}
 
 % Encoding:
 \RequirePackage[utf8]{inputenc}
@@ -274,7 +274,7 @@
 % Pass default options to hyperref class, if loaded.
 \newcommand{\hyperoptions}{
   colorlinks=false,
-  pageanchor=false
+  pageanchor=true
 }
 \newcommand{\hyperpdfoptions}{
   pdftex,
diff --git a/sample.pdf b/sample.pdf
index 28197ce..0981de6 100644
--- a/sample.pdf
+++ b/sample.pdf
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:54e8bfe81e0c17acd4d6e5eba92d346c21303e0dec7cfcf82688738709a89145
-size 521006
+oid sha256:67be6396d7b3954a0008988048b7397808fef35f0d5ea0135a310112427e7aed
+size 532190
diff --git a/sample.tex b/sample.tex
index 48a6442..9d703e4 100644
--- a/sample.tex
+++ b/sample.tex
@@ -1,11 +1,14 @@
 \documentclass[english]{mluthesis} % Supported languages: english, german
 
-\usepackage{hyperref}
-\usepackage{natbib, doi}
-\usepackage{graphicx}
 \usepackage{amsmath}
 \usepackage{csquotes}
 \MakeOuterQuote{"}
+\usepackage{graphicx}
+\usepackage{hyperref}
+
+\usepackage{biblatex}
+\addbibresource{sample.bib}
+\usepackage{doi}
 
 \usepackage{lipsum} % for lorem ipsum sample text
 
@@ -28,7 +31,7 @@
 
 % This is a list, seperated with commata.
 % If you only put one entry, the numbers will be omitted.
-\ThesisSetSupervisors{{Prof. Professor McProfessorface}, {Dr. Noonien Soong}}
+\ThesisSetSupervisors{{Prof. McProfessorface},{Dr. Noonien Soong}}
 
 % This puts the MLU sigil on the title page.
 \ThesisSetLogo{\includegraphics[width=\linewidth]{mlu-siegel-transparent.png}}
@@ -71,8 +74,7 @@
 \lipsum[5-7]
 
 \nocite{*}
-\bibliographystyle{plainnat}
-\bibliography{sample} % uses file sample.bib
+\printbibliography
 
 \declaration
 
-- 
GitLab