[Tex/LaTex] Formatting headers in the book class

book-designfancyhdrheader-footer

I am using the book class for my thesis. In every page that is not the beginning of a chapter, LaTeX writes the number and name of the chapter in the header. Is there any simple (emphasis on the simple) way to remove it? I'd like to have simple headers, with nothing on them but the page number.

MWE

\documentclass[10pt]{book}
\usepackage{blindtext}
\usepackage[a4paper]{geometry}
\usepackage{fancyhdr}

\fancyhead[LE,RO]{\thepage}
\fancyfoot{}
%\fancyhead[RO,LE]{\thepage}
%\fancyhead[LO]{\leftmark}
%\fancyhead[RE]{\rightmark}

\cfoot{} % get rid of the page number 

\pagestyle{fancy}

\begin{document}
  \blinddocument
\end{document}

Best Answer

Solution with nothing

\documentclass[12pt,a4paper]{book}
\usepackage{blindtext} % just for the example

\renewcommand{\chaptermark}[1]{}
\renewcommand{\sectionmark}[1]{}
\makeatletter
\renewcommand{\@mkboth}[2]{}
\makeatother

\begin{document}

\blinddocument

\end{document}

Explanation

The text in the headers is controlled by the argument given to \chaptermark and \sectionmark, which are emitted automatically when \chapter or \section are processed.

For the “special units” such as the table of contents and the bibliography, LaTeX uses \@mkboth, an internal variant of those commands, so we need to disable it, too.

Comment

Of course the methods with packages such as fancyhdr, titleps or scrlayer-scrpage (the newer version of scrpage2) are more powerful. But for “no header” this method is much easier.

Related Question