[Tex/LaTex] Header: no number for references page

fancyhdrheader-footer

How can I make sure that the references page has no number in the header (i. e., I still want a header, but without a number).

enter image description here

MWE with the problem:

\documentclass[]{article}
\usepackage{fancyhdr}
\fancyhf{} % clear the headers
\fancyhead[LE,RO]{%
   % We want italics
   \itshape
   % The chapter number only if it's greater than 0
   \ifnum\value{section}>0  \thesection. \fi
   % The chapter title
   \leftmark}

\fancyfoot[C]{\thepage}

\fancypagestyle{plain}{
  \renewcommand{\headrulewidth}{0pt}
  \fancyhf{}
  \fancyfoot[C]{\thepage}
}

\setlength{\headheight}{14.5pt}
\pagestyle{fancy}
\begin{document}

\section{Example}

\clearpage

\renewcommand{\thepage}{}


\begin{thebibliography}{99}


\end{thebibliography} 


\end{document}

Best Answer

Define a new page style, say, bib like

\fancypagestyle{bib}{
  \fancyhf{}
  \fancyhead[LE,RO]{%
   % We want italics
   \itshape
   % The chapter title
   \leftmark}
   \fancyfoot[C]{\thepage}
}

without the section number and then just before \begin{thebibliography}{99} issue \pagestyle{bib}

Code:

\documentclass[]{article}
\usepackage{fancyhdr}
\fancyhf{} % clear the headers
\fancyhead[LE,RO]{%
   % We want italics
   \itshape
   % The chapter number only if it's greater than 0
   \ifnum\value{section}>0  \thesection. \fi
   % The chapter title
   \leftmark}

\fancyfoot[C]{\thepage}

%%% this is not needed as this does nothing. plain page style is exactly this one.
%\fancypagestyle{plain}{
%  \renewcommand{\headrulewidth}{0pt}
%  \fancyhf{}
%  \fancyfoot[C]{\thepage}
%}

\fancypagestyle{bib}{
  \fancyhf{}
  \fancyhead[LE,RO]{%
   % We want italics
   \itshape
   % The chapter title
   \leftmark}
   \fancyfoot[C]{\thepage}
}

\setlength{\headheight}{14.5pt}
\pagestyle{fancy}
\begin{document}

\section{Example}

\clearpage

%\renewcommand{\thepage}{}
\pagestyle{bib}

\begin{thebibliography}{99}


\end{thebibliography}


\end{document}

enter image description here