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 % Headers
\usepackage{emptypage} % Remove headers and footers on empty pages \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}
}

View File

@@ -1,3 +1,9 @@
% Set PDF version to 1.7 (https://tex.stackexchange.com/a/638196)
\ExplSyntaxOn
\sys_ensure_backend:
\pdf_version_gset:n{1.7}
\ExplSyntaxOff
% Template % Template
\documentclass[twoside, a4paper, 12pt]{book} \documentclass[twoside, a4paper, 12pt]{book}
\input{config/template} \input{config/template}