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.

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

share|improve this question
    
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

2 Answers 2

up vote 2 down vote accepted

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
\def\ps@headings{%
    \let\@oddfoot\@empty
    \def\@oddhead{\bfseries{\rightmark}\hfil\thepage}%
    \let\@mkboth\markboth
    \def\chaptermark##1{%
      \markright {\MakeUppercase{%
        \ifnum \c@secnumdepth >\m@ne
            \@chapapp\ \thechapter. \ %
        \fi
        ##1}}}
}
\makeatother
\pagestyle{headings}

\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

share|improve this answer
    
Do I edit this in report.cls/sty directly? –  Richard Durr Jun 4 '11 at 15:39
1  
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

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}}{}}
\def\@oddhead{\rightmark\hfil\thepage}
\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).

share|improve this answer
1  
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

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.