From 24db478285843d3e6afa32af734e29a316f42d62 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 9 Oct 2020 14:25:06 +0200 Subject: Missing footer on first page of each chapter in LaTeX In the doxygen pdf manual we see that on the first page of each chapter the footer is missing, the same occurs in the "normal" documentation generated by doxygen. References: - https://tex.stackexchange.com/questions/566034/footer-ruler-on-first-page-in-fancyhdr-with-book - https://tex.stackexchange.com/questions/566056/footer-ruler-on-first-page-in-fancyhdr-with-book-but-not-in-part-part/ Code changes ("normal" documentation): - latexgen.cpp changes required for the "normal" documentation Code changes (doxygen manual) - doxygen_manual.sty, remove word "Part" for the Appendices. - manual.sty changes like for "normal" documentation plus patching part in case of the `\part` (here we don't want the footer or header) --- doc/doxygen_manual.tex | 1 + doc/manual.sty | 35 ++++++++++++++++++++++------------- src/latexgen.cpp | 31 ++++++++++++++++++------------- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/doc/doxygen_manual.tex b/doc/doxygen_manual.tex index 0148379..aacb573 100644 --- a/doc/doxygen_manual.tex +++ b/doc/doxygen_manual.tex @@ -171,6 +171,7 @@ Written by Dimitri van Heesch\\[2ex] \chapter{Perl Module Output}\label{perlmod}\hypertarget{perlmod}{}\input{perlmod} \chapter{Doxygen's internals}\label{arch}\hypertarget{arch}{}\input{arch} \renewcommand{\thepart}{} +\renewcommand{\partname}{} \part{Appendices} \appendix %mean that subinputfrom requires a / at the end of the path diff --git a/doc/manual.sty b/doc/manual.sty index 643bd40..fd9fd0e 100644 --- a/doc/manual.sty +++ b/doc/manual.sty @@ -8,7 +8,6 @@ % Setup fancy headings \RequirePackage{fancyhdr} -\pagestyle{fancyplain} \newcommand{\clearemptydoublepage}{% \newpage{\pagestyle{empty}\cleardoublepage}% } @@ -18,18 +17,28 @@ \renewcommand{\sectionmark}[1]{% \markright{\thesection\ #1}% } -\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} -\fancyhead[CE]{\fancyplain{}{}} -\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} -\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} -\fancyhead[CO]{\fancyplain{}{}} -\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} -\fancyfoot[LE]{\fancyplain{}{}} -\fancyfoot[CE]{\fancyplain{}{}} -\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen @VERSION@ }} -\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen @VERSION@ }} -\fancyfoot[CO]{\fancyplain{}{}} -\fancyfoot[RO]{\fancyplain{}{}} + +% Headers & footers +\pagestyle{fancyplain} +\renewcommand{\footrulewidth}{0.4pt} +% +\fancypagestyle{fancyplain}{ +\fancyhf{} +\fancyhead[LE, RO]{\bfseries\thepage} +\fancyhead[LO]{\bfseries\rightmark} +\fancyhead[RE]{\bfseries\leftmark} +\fancyfoot[LO, RE]{\bfseries\scriptsize Generated by Doxygen @VERSION@ } +} +% +\fancypagestyle{plain}{ +\fancyhf{} +\fancyfoot[LO, RE]{\bfseries\scriptsize Generated by Doxygen @VERSION@ } +\renewcommand{\headrulewidth}{0pt}} +% +\pagestyle{fancyplain} +% +\usepackage{xpatch} +\xpatchcmd{\part}{plain}{empty}{}{} % Define caption that is also suitable in a table \makeatletter diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 3343c1a..1d55dd6 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -666,19 +666,24 @@ static void writeDefaultHeaderPart1(FTextStream &t) t << "% Headers & footers\n" "\\usepackage{fancyhdr}\n" "\\pagestyle{fancyplain}\n" - "\\fancyhead[LE]{\\fancyplain{}{\\bfseries\\thepage}}\n" - "\\fancyhead[CE]{\\fancyplain{}{}}\n" - "\\fancyhead[RE]{\\fancyplain{}{\\bfseries\\leftmark}}\n" - "\\fancyhead[LO]{\\fancyplain{}{\\bfseries\\rightmark}}\n" - "\\fancyhead[CO]{\\fancyplain{}{}}\n" - "\\fancyhead[RO]{\\fancyplain{}{\\bfseries\\thepage}}\n" - "\\fancyfoot[LE]{\\fancyplain{}{}}\n" - "\\fancyfoot[CE]{\\fancyplain{}{}}\n" - "\\fancyfoot[RE]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n" - "\\fancyfoot[LO]{\\fancyplain{}{\\bfseries\\scriptsize " << genString << " Doxygen }}\n" - "\\fancyfoot[CO]{\\fancyplain{}{}}\n" - "\\fancyfoot[RO]{\\fancyplain{}{}}\n" - "\\renewcommand{\\footrulewidth}{0.4pt}\n"; + "\\renewcommand{\\footrulewidth}{0.4pt}\n" + "%\n" + "\\fancypagestyle{fancyplain}{\n" + "\\fancyhf{}\n" + "\\fancyhead[LE, RO]{\\bfseries\\thepage}\n" + "\\fancyhead[LO]{\\bfseries\\rightmark}\n" + "\\fancyhead[RE]{\\bfseries\\leftmark}\n" + "\\fancyfoot[LO, RE]{\\bfseries\\scriptsize " << genString << " Doxygen }\n" + "}\n" + "%\n" + "\\fancypagestyle{plain}{\n" + "\\fancyhf{}\n" + "\\fancyfoot[LO, RE]{\\bfseries\\scriptsize " << genString << " Doxygen }\n" + "\\renewcommand{\\headrulewidth}{0pt}}\n" + "%\n" + "\\pagestyle{fancyplain}\n" + "%\n"; + if (!Config_getBool(COMPACT_LATEX)) { t << "\\renewcommand{\\chaptermark}[1]{%\n" -- cgit v0.12