2

Since days I am trying to remove the header on a page but to keep the page number. Here is my working example. The issue is that, when I remove the header using: \thispagestyle{plain}, it also removes the page number. My first page is working correct except for the missing number. The second page is correct.

\documentclass[a4paper,11pt]{article}
\usepackage[ngerman]{babel} 
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}} % set the \leftmark
\fancyhf{}
\fancyhead[L]{\leftmark} % 1. sectionname
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0.0pt}%
}
\begin{document}
\section{Titel}
\thispagestyle{plain}
\lipsum[2-10]
\end{document}
1

When you issue \fancyhf{} it clears both the header and the footer. So, in your redefinition of the plain style, you're clearing whatever header and footer exist(ed). Re-establish the footer by including \fancyfoot[C]{\thepage} as part of the redefinition:

\documentclass{article}
\usepackage{lipsum,fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}} % set the \leftmark
\fancyhf{}% Clear header/footer
\fancyhead[L]{\leftmark} % 1. sectionname
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{% Redefine plain pages tyle
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0.0pt}%
  \fancyfoot[C]{\thepage}
}
\begin{document}
\section{Titel}
\thispagestyle{plain}
\lipsum[2-10]
\end{document}
  • Bingo, this was exactly what I was looking for. In the meantime I found a solution and it worked as well. Thank you from Ecuador. – German Sep 23 '14 at 4:07

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.