Add headers

This commit is contained in:
2024-06-28 17:34:07 +02:00
parent a0e9332d12
commit 4228d7d479
2 changed files with 20 additions and 0 deletions

View File

@@ -20,3 +20,17 @@
% Headers
\usepackage{emptypage} % Remove headers and footers on empty pages
\usepackage{etoolbox} % Patching commands
\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % Use fancy headers and footers
\fancyhf{} % Clear headers and footers
\fancyhead[LO, RE]{\small\leftmark} % Chapter in the left on odd pages and right on even pages
\fancyfoot[C]{\thepage} % Page number in the center
\appto\mainmatter{
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername~\thechapter~--\ #1}{}}
\fancyhead[RE]{\small\rightmark}
\fancyhead[LO]{\small\leftmark}
}