diff --git a/config/template.tex b/config/template.tex index a3727f5..5c37846 100644 --- a/config/template.tex +++ b/config/template.tex @@ -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} +} diff --git a/main.tex b/main.tex index 14f031c..4570644 100644 --- a/main.tex +++ b/main.tex @@ -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 \documentclass[twoside, a4paper, 12pt]{book} \input{config/template}