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] 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