0

For my thesis I currently use MiKTeX and the report class in order to fulfill the needs of my university, and they also demand page specific headers and footers. This should be achieved by using the fancyhdr package.

What I want is a right-aligned page number in the footer, together with a blank header, and that for each page, except for the

  • title page, and the
  • affidavit.

Those just have to be blank. I know that page numbers are centered by default for new chapter pages, but that's not what I need. Roman and arabic page numbering should be taken into account of course.

PS: I've read that fancyhdr and the geometry package (which I also currently use) don't go well together. Should I therefore use an alternative to the fancyhdr package?

  • You can usr scrlayer-scrpage or titleps instead, but the claim is wrong. Fancyhdr and geometry work fine together. You just have to load geometry first. Where did you read that? – Johannes_B Oct 30 '17 at 9:22
  • You don't NEED to use fancyhdr, it is just easier. Sigh, I suppose you want me to make you an MWE as well. – John Kormylo Oct 30 '17 at 14:18
  • For you the matter might seem straightforward, but I struggle with the correct implementation of the page specific headers and footers. No one asked for an MWE, but since you already put effort in your answer, I thank you for that. – neuronalbit Oct 30 '17 at 16:31
1

Since \chapter uses \thispagestyle{plain}, you can redefine the plain pagestyle.

\documentclass{report}
\makeatletter
\def\ps@plain{\let\@mkboth\@gobbletwo
  \let\@oddhead\@empty
  \def\@oddfoot{\reset@font\hfill\thepage}% page number on right
  \let\@evenhead\@empty
  \let\@evenfoot\@oddfoot}
\makeatother
\begin{document}
\chapter{First}
Some text here.
\end{document}

No page number.

\documentclass{report}
\makeatletter
\let\ps@plain=\ps@empty
\makeatother
\begin{document}
\chapter{First}
Some text here.
\end{document}
  • With your answer in mind, how would someone suppress the page numbering for specific pages, as initially asked. Also what if I want to add a horizontal line? This solution also doesn't consider pages beside those with chapters on it, the page number still gets centered. – neuronalbit Oct 30 '17 at 16:40
  • Ah, so you want a totally blank plain pagestyle. Come to think of it, \let\ps@plain=\ps@empty would be simpler. – John Kormylo Oct 31 '17 at 2:27
  • If you want a line below the header, use fancyhdr and \fancypagestyle{plain}{\fancyhead{}\fancyfoot{}} – John Kormylo Oct 31 '17 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.