# How can I format the header without italics in reports without using fancyhdr?

I am writing a report. I set \pagestyle{headings} which looks well, but formats the chapter in italics instead of normalfont. How can I change this to normalfont or boldfont, without using fancyhdr?

Here is an example how it looks:

KAPITEL 5. INSTALLATION UND BENUTZUNG                             26

And here is an example how it should look:

KAPITEL 5. INSTALLATION UND BENUTZUNG                             26

-
Why is fancyhdr to be avoided? –  egreg Jun 4 '11 at 15:34
Welcome to tex.sx! A tip: you can use backticks  to mark your inline code‌​. –  doncherry Jun 4 '11 at 15:38
@egreg Minimalism. –  Richard Durr Jun 4 '11 at 15:53

You have to modify the internal heading definition. Do you use the option twoside? Please provide a minimal example.

The solution for onside:

\documentclass{report}
\makeatletter
\let\@oddfoot\@empty
\let\@mkboth\markboth
\def\chaptermark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter. \ %
\fi
##1}}}
}
\makeatother

\begin{document}
\setcounter{chapter}{4}
\chapter{Installation und Benutzung}
\clearpage
\mbox{}
\end{document}


You are writing in German. You should use a KOMA class like scrreprt. Why don't you use a package like scrpage2 or fancyhdr

-
Do I edit this in report.cls/sty directly? –  Richard Durr Jun 4 '11 at 15:39
You can copy the code into your header –  Marco Daniel Jun 4 '11 at 15:40
Worked beautifully, thank you very much :) –  Richard Durr Jun 4 '11 at 15:52
koma destroys the pre-existing layout somehow and I do not like its look. Additionally, I want the changes to be portable to other documents easily, that do not use koma. –  Richard Durr Jun 4 '11 at 15:57
@Marco: you forgot the modification to the font in your edited example? Also, \pagestyle{headings} should go after the modificatition of \ps@headings. –  Gonzalo Medina Jun 4 '11 at 16:06
show 1 more comment

This is the definition of \chaptermark in report.cls for the headings page style (one sided):

\def\chaptermark#1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter. \ %
\fi
#1}}}


Your needs seem to be twofold: "KAPITEL 1." bold and the chapter title medium face. There's also the definition of \@oddhead to keep in mind:

\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%


We have to change the way both commands act:

\makeatletter
\def\chaptermark#1{%
\markboth {\MakeUppercase{%
{\bfseries\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter.} \ %
\fi
#1}}{}}
\newcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{%
{\bfseries\MakeUppercase\contentsname}}
{{\bfseries\MakeUppercase\contentsname}}}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother


A similar adjustment should be done also to the definition of thebibliography and theindex (if you use them).

-
When I reread the question and noticed that only \chaptername and \thechapter were to be boldfaced, I was going to edit my answer just to give this solution. –  Gonzalo Medina Jun 4 '11 at 16:13
@Gonzalo: it seems that this doesn't bother the OP. –  egreg Jun 4 '11 at 16:15