3

I am trying change the page header in scrbook so that it contains upper case letters. To do so, I am using fancyhdr which gives me the required look for all the chapters.

enter image description here

Unfortunately there is a problem with the page header in the bibliography that still contains lower case letters.

enter image description here

How can I change this, so that it looks like this?

enter image description here

I know that if use book instead of scrbook everythink works fine, but since I am using a lot of other things from scrbook this is really an unwanted option. Usually scrpage2 is recommended for the use with KOMA-script, but I don't know a way to have upper case letters in the page headers there.

Here is my code

    \begin{filecontents}{mybib.bib}
    @article{Smith2000,
    author = {Smith, John},
    journal = {Journal A},
    number = {1},
    pages = {1--38},
    title = {{Science}},
    volume = {1},
    year = {2000}
    }
    \end{filecontents}

    \documentclass{scrbook}
    \usepackage{biblatex}
    \usepackage{blindtext}
    \bibliography{mybib}
    \usepackage{fancyhdr}

    \makeatletter{%
    \fancyhead[L]{\leftmark}%
    \fancyhead[R]{\thepage}%
    }\makeatother
    \pagestyle{fancy}


    \begin{document}
    \chapter{Test}
    \blindtext[5]
    \cite{Smith2000}
    \printbibliography
    \blindtext[5]
    \end{document}

3 Answers 3

5

If you don't want to switch from fancyhdr to scrpage2, add \MakeUppercase to the argument of \fancyhead.

\begin{filecontents}{mybib.bib}
@article{Smith2000,
author = {Smith, John},
journal = {Journal A},
number = {1},
pages = {1--38},
title = {{Science}},
volume = {1},
year = {2000}
}
\end{filecontents}

\documentclass{scrbook}
\usepackage{biblatex}
\usepackage{blindtext}
\bibliography{mybib}
\usepackage{fancyhdr}

\fancyhead[L]{\MakeUppercase{\leftmark}}
\fancyhead[R]{\thepage}
\pagestyle{fancy}


\begin{document}
\chapter{Test}
\blindtext[5]
\cite{Smith2000}
\printbibliography
\blindtext[5]
\end{document}
4
  • after researching quite some time I didnt't expect the answer to be that simple, thanks
    – maetra
    Oct 15, 2011 at 14:19
  • adding the babel package to this actually produces the error: You haven't defined the language yet.
    – maetra
    Oct 17, 2011 at 7:50
  • @maetra: You need to specify at least one language option, e.g., \usepackage[ngerman,english]{babel}. (The last language is regarded as the document's default language.)
    – lockstep
    Oct 17, 2011 at 14:39
  • that is actually what I did, adding the line \usepackage[ngerman, english]{babel} without this babel works fine. But I found a solution that also works with babel.
    – maetra
    Oct 18, 2011 at 6:48
9

Here the way to use the package scrpage2:

\usepackage[automark]{scrpage2}
\clearscrheadings
\ohead{\MakeUppercase{\headmark}}
\pagestyle{scrheadings}

The same method is used by fancyhdr to get capital letters.

To disable slanted use :\addtokomafont{pagehead}{\normalfont} (Thanks to lockstep)

2
  • 1
    You may add \addtokomafont{pagehead}{\normalfont} to disable slanted.
    – lockstep
    Oct 15, 2011 at 9:32
  • thanks Marco, I take a closer look at scrpage now
    – maetra
    Oct 15, 2011 at 14:21
1

Another solution that works fine with the babel package is the following code from Markus Kohm

   \newcommand*{\MarkBoth}{}
   \let\MarkBoth\markboth
   \renewcommand*{\markboth}[2]{\MarkBoth{\MakeUppercase{#1}}{\MakeUppercase{#2}}}

You must log in to answer this question.

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