From 7998a17a226e08075e2f8be4305c22ba35ef4ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 8 Sep 2021 13:42:26 +0200 Subject: [PATCH] add fancyfoot option to print section in footer --- mkessler-script.cls | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/mkessler-script.cls b/mkessler-script.cls index 122ccb2..2622463 100644 --- a/mkessler-script.cls +++ b/mkessler-script.cls @@ -10,6 +10,9 @@ \DeclareOption{show version}{\showversiontrue} \DeclareOption{hideversion}{\showversionfalse} +\newif\iffancyfoot\fancyfootfalse +\DeclareOption{fancyfoot}{\fancyfoottrue} + \newif\ifgitversion\gitversionfalse \DeclareOption{git}{\gitversiontrue} @@ -124,29 +127,32 @@ %SOFTWARE. %%%% These are the fancy headers -\RequirePackage{fancyhdr} -\pagestyle{fancy} -% LE: left even -% RO: right odd -% CE, CO: center even, center odd +\iffancyfoot + \RequirePackage{fancyhdr} + \pagestyle{fancy} -\fancyhead[RO,LE]{\@lecture} % Right odd, Left even -\fancyhead[RE,LO]{} % Right even, Left odd + % LE: left even + % RO: right odd + % CE, CO: center even, center odd -\fancyfoot[RO,LE]{\thepage} % Right odd, Left even -\fancyfoot[RE,LO]{} % Right even, Left odd -\fancyfoot[C]{\leftmark} % Center + \fancyhead[RO,LE]{} % Right odd, Left even + \fancyhead[RE,LO]{} % Right even, Left odd -\makeatother + \fancyfoot[RO,LE]{} % Right odd, Left even + \fancyfoot[RE,LO]{} % Right even, Left odd + \fancyfoot[C]{\leftmark} % Center -%%No fancy headers in the appendix (as there is no lecture) -\let\oldappendix\appendix -\renewcommand\appendix{ - \oldappendix - \fancyhead[RO,LE]{} - \renewcommand{\headrulewidth}{0pt} -} + \makeatother + + %%No fancy headers in the appendix (as there is no lecture) + \let\oldappendix\appendix + \renewcommand\appendix{ + \oldappendix + \fancyhead[RO,LE]{} + \renewcommand{\headrulewidth}{0pt} + } +\fi % Fix some stuff % %http://tex.stackexchange.com/questions/76273/multiple-pdfs-with-page-group-included-in-a-single-page-warning