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?

3
  • 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
    Commented Oct 30, 2017 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. Commented Oct 30, 2017 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. Commented Oct 30, 2017 at 16:31

1 Answer 1

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}
3
  • 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. Commented Oct 30, 2017 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. Commented Oct 31, 2017 at 2:27
  • If you want a line below the header, use fancyhdr and \fancypagestyle{plain}{\fancyhead{}\fancyfoot{}} Commented Oct 31, 2017 at 3:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .