From 42a00a3d6a58b936abb0dfc152623153009569d3 Mon Sep 17 00:00:00 2001 From: Jannik Dunkelau <jannik.dunkelau@hhu.de> Date: Thu, 20 Aug 2020 12:24:11 +0200 Subject: [PATCH] Add appendix sections to header marks --- hhuthesis.cls | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hhuthesis.cls b/hhuthesis.cls index 1757fd9..3114972 100644 --- a/hhuthesis.cls +++ b/hhuthesis.cls @@ -156,10 +156,16 @@ \let\section\appendix@section } \newcommand{\appendixpagename}{\iflanguage{ngerman}{Anhang}{Appendices}} -\newcommand\appendix@section[1]{% +\newcommand{\appendix@section}[2][\@nil]{% \refstepcounter{section}% - \orig@section*{\appendixname{}~\thesection\hspace{1em}#1}% - \addcontentsline{toc}{section}{\appendixname{}~\thesection\hspace{1em}#1}% + \orig@section*{\thesection\hspace{1em}#2}% + \def\tmp{#1}% + \ifx\tmp\@nnil% % Puts the optional short title into the ToC if not empty + \addcontentsline{toc}{section}{\appendixname{}~\thesection\hspace{1em}#2}% + \else% + \addcontentsline{toc}{section}{\appendixname{}~\thesection\hspace{1em}#1}% + \fi% + \markboth{\thesection\hspace{1em}\MakeUppercase{#2}}{}% } \let\orig@section\section -- GitLab