1

enter image description hereI 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}
    \fancyhead[L]{Text here}
    \fancyhead[R]{\slshape \leftmark}
    \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

7
  • I cannot compile your example: "! Undefined control sequence. l.10 \titlespacing"
    – Clément
    Jun 11, 2014 at 13:27
  • Woops - forgot the titlesex package. Apologies Jun 11, 2014 at 14:01
  • And the graphicx and xcolor packages as well…
    – Clément
    Jun 11, 2014 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, 2014 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 Jun 11, 2014 at 14:15

1 Answer 1

1

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
\renewcommand*\bib@heading{%
  \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}

Putting this together your get:

Revised sample

\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}
\fancyhead[L]{Text here}
\fancyhead[R]{\slshape \leftmark}
\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
\renewcommand*\bib@heading{%
  \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.

Sample outut

\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}
\fancyhead[L]{Text here}
\fancyhead[R]{\slshape \leftmark}
\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}
2
  • 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 Jun 11, 2014 at 14:54
  • Updated: just use \markboth... Jun 11, 2014 at 15:02

You must log in to answer this question.

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