Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

First of all: this is the first time that I use LaTeX.

I have these commands that create my header:

\usepackage[headsepline,plainheadsepline]{scrpage2}    
\pagestyle{scrheadings}

\clearscrheadfoot %clear everything
\ohead[\rightmark ~$\vert$ \pagemark]{\rightmark ~$\vert$ \pagemark} %define header for beginning of chapter and "normal" pages
\renewcommand{\chaptermark}[1]{\markright{\ #1}} %??
\setheadsepline{1pt} %set size of sep-line

Everything works as intended, except: On the pages containing the bibliography or the ToC, the name of the chapter is in upper case letters, and elsewhere it is as in the chapter headline.

How can I change that so that the chapter title is not formatted to upper case in the ToC and bibliography?

PS: It would be great if you also could explain the second last line. I understand what it does, but I don't know where \chaptermark is used and thus why it affects the header...

share|improve this question

migrated from stackoverflow.com Apr 11 '12 at 20:22

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 7 down vote accepted

Your problem description points to a "feature" in the LaTeX standard classes like book and report: Headers for standard chapters are formatted using \chaptermark which in turn calls the \MakeUppercase macro which does exactly what it name suggests. Your redefinition of \chaptermark removes \MakeUppercase for standard chapters. However, \MakeUppercase is hard-coded into the header of the ToC and the bibliography. Solution: Use the nouppercase option of scrpage2 which disables \MakeUpperCase in the header.

\documentclass{book}

\usepackage[headsepline,plainheadsepline,nouppercase]{scrpage2}
\pagestyle{scrheadings}

\clearscrheadfoot %clear everything
\ohead[\rightmark ~$\vert$ \pagemark]{\rightmark ~$\vert$ \pagemark} %define header for beginning of chapter and "normal" pages
\renewcommand{\chaptermark}[1]{\markright{\ #1}} %??
\setheadsepline{1pt} %set size of sep-line

\usepackage{lipsum}

\begin{document}

\tableofcontents

\chapter{foo}

\lipsum[1-12]

\addtocontents{toc}{\protect\newpage}

\chapter{bar}

\lipsum[1-12]

\end{document}
share|improve this answer
    
That was exactly what I needed! Thank you! –  Daniel Arnreich Apr 11 '12 at 21:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.