diff --git a/ecsdocs.dtx b/ecsdocs.dtx index 7f515a70078f23b73003fb3b8d3b21d8f6fa9557..2c59bc8c5fe210dbdbd08ec5c8bfe9b44a05e088 100644 --- a/ecsdocs.dtx +++ b/ecsdocs.dtx @@ -317,10 +317,18 @@ % % \begin{macrocode} \usepackage{fancyhdr} -\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}} -\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage} +% Help from https://texblog.org/2007/11/07/headerfooter-in-latex-with-fancyhdr/#comment-4783 +\fancyhead[LE]{\textrm\thepage} +\fancyhead[LO]{\fancyplain{}{\textsl{\rightmark}}} +\fancyhead[RE]{\fancyplain{}{\textsl{\leftmark}}} +\fancyhead[RO]{\textrm\thepage} \chead{}\lfoot{}\rfoot{}\cfoot{} \pagestyle{fancy} +\fancypagestyle{plain}{ + \fancyhf{} + \fancyhead[OR]{\thepage} + \renewcommand{\headrulewidth}{0pt} +} % \end{macrocode} % % \begin{macro}{\chaptermark} @@ -330,14 +338,18 @@ % Redefine \texttt{chaptermark} and \texttt{sectionmark} to set up the correct header name and produce a % banner on the output making the location of messages simpler. % +% The \textbackslash btypeout command is for console logging where chapters start +% +% \textbackslash chapapp expands to "Chapter" or "Appendix" +% % \begin{macrocode} %<*thesis|minithesis|progress|project|report|gdp> -\renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}} -\renewcommand{\sectionmark}[1]{} +\renewcommand{\chaptermark}[1]{\btypeout{\thechapter.\space #1}\markboth{\chaptername\ \thechapter.\hspace{1em}#1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection.\hspace{1em}#1}} \renewcommand{\subsectionmark}[1]{} %</thesis|minithesis|progress|project|report|gdp> %<*article> -\renewcommand{\sectionmark}[1]{\btypeout{\thesection\space #1}} +\renewcommand{\sectionmark}[1]{\btypeout{\thesection\hspace{1em}#1}} \renewcommand{\subsectionmark}[1]{} \renewcommand{\subsubsectionmark}[1]{} %</article>