# fancy header on bibliography first page

I have used a different first page for all my chapters in my thesis which are defined using:

    \titlespacing*{\chapter}{0cm}{3cm}{0.5cm}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\scalebox{5}{\color{gray}\Huge\thechapter}}{2cm}{\Huge}


I want my bibliography section to be no different, but I cannot get my fancy header to show up properly on the first page of this section. I think this is a complete MWE for this problem

    \documentclass[12pt,a4paper,numbers=noenddot]{scrreprt}
\usepackage{cite}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\huge\thechapter}{15pt}{\huge}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}

\titlespacing*{\chapter}{0cm}{3cm}{0.5cm}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\scalebox{5}{\color{gray}\Huge\thechapter}}{2cm}{\Huge}

\begin{document}
\chapter{1}
some text \cite{reference1}
\chapter{References}\thispagestyle{empty}
\hrulefill\\
\clearpage

\renewcommand{\bibname}{}
\titlespacing*{\chapter}{0cm}{-3cm}{0.5cm}
\small
\bibliographystyle{IEEEtran}
\bibliography{IEEEfull,library}

\end{document}


I hope someone can help

Cheers

• I cannot compile your example: "! Undefined control sequence. l.10 \titlespacing" – Clément Jun 11 '14 at 13:27
• Woops - forgot the titlesex package. Apologies – Magiclamarshmallow Jun 11 '14 at 14:01
• And the graphicx and xcolor packages as well… – Clément Jun 11 '14 at 14:01
• I managed to compile your example, but I'm not sure what of what you want. Both titles looks really similar to me. Maybee a snapshot, a non-empty bibliography or some further explanations could help ? – Clément Jun 11 '14 at 14:04
• Hey Clément, I've added an image, you can see there is no fancy header on the first page of the references section. This is what I am trying to get. The fancy header shows on the second and subsequent pages *EDIT I've managed to get a part of the header to work by using \renewcommand{\bibname}{\protect\thispagestyle{fancy}} This doesn't print the chapter name in the right header though – Magiclamarshmallow Jun 11 '14 at 14:15

New solution It is probably best to redefine the \bib@heading command of scrrpt to do the formatting for you. By default the main work is done by simpy \chapter*{\bibname} you can replace this with your styling:

\chapter{\bibname}
\thispagestyle{empty}
\hrulefill\clearpage


by putting the following in your preamble.

\makeatletter
\ifbib@leveldown
\section*{\bibname}%
\ifx\@mkboth\@gobble\else\markright{\MakeMarkcase{\bibname}}\fi
\else
\chapter{\bibname}
\thispagestyle{empty}
\hrulefill\clearpage
%
\@mkboth{\MakeMarkcase{\bibname}}{\MakeMarkcase{\bibname}}%
\fi
}%
\makeatother


You can then issue the \small command in the hook \AfterBibliographyPreamble and redefine the bibname to References via:

\renewcommand{\bibname}{References}
\AfterBibliographyPreamble{\small}


\documentclass[12pt,a4paper,numbers=noenddot]{scrreprt}

\usepackage{cite}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\huge\thechapter}{15pt}{\huge}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}

\titlespacing*{\chapter}{0cm}{3cm}{0.5cm}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\scalebox{5}{\color{gray}\Huge\thechapter}}{2cm}{\Huge}

\makeatletter
\ifbib@leveldown
\section*{\bibname}%
\ifx\@mkboth\@gobble\else\markright{\MakeMarkcase{\bibname}}\fi
\else
\chapter{\bibname}
\thispagestyle{empty}
\hrulefill\clearpage
%
\@mkboth{\MakeMarkcase{\bibname}}{\MakeMarkcase{\bibname}}%
\fi
}%
\makeatother

\renewcommand{\bibname}{References}
\AfterBibliographyPreamble{\small}

\usepackage{lipsum} %for dummy text

\begin{document}
\chapter{One}

\nocite{*}
\lipsum[1-20]

\bibliographystyle{IEEEtran}
\bibliography{IEEEfull,xampl}

\end{document}


Original solution As you are using scrrpt there is a convenient hook \AfterBibliographyPreamble you can use, in this case, to specify the page style for this first page and to give the name of the running header.

\documentclass[12pt,a4paper,numbers=noenddot]{scrreprt}
\usepackage{cite}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\huge\thechapter}{15pt}{\huge}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{}
\fancyfoot[R]{\thepage}

\titlespacing*{\chapter}{0cm}{3cm}{0.5cm}
\titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\scalebox{5}{\color{gray}\Huge\thechapter}}{2cm}{\Huge}

\usepackage{lipsum} %for dummy text

\begin{document}
\chapter{One}

\nocite{*}
\lipsum[1-20]

\chapter{References}\thispagestyle{empty}
\hrulefill\\

\clearpage

\renewcommand{\bibname}{}
\titlespacing*{\chapter}{0cm}{-3cm}{0.5cm}
\small
\AfterBibliographyPreamble{\thispagestyle{fancy}\markboth{REFERENCES}{REFERENCES}}
\bibliographystyle{IEEEtran}
\bibliography{IEEEfull,xampl}

\end{document}

• That's great Andrew, thank you. 1 small problem though, the chapter name (References) doesn't show up in the right hand header. Any ideas? I've quickly tried using \chaptermark{References}, but this doesn't work – Magiclamarshmallow Jun 11 '14 at 14:54
• Updated: just use \markboth... – Andrew Swann Jun 11 '14 at 15:02