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.
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhead[RO,LE]{\small\sf\color{black}\rightmark}
\fancyhead[LO,RE]{\small\tt\color{black}\leftmark}

or

\renewcommand{\chaptermark}[1]{\markboth{\small\tt\color{black}\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\small\sf\color{black}\thesection\ #1}}
\fancyhead[RO,LE]{\rightmark}
\fancyhead[LO,RE]{\leftmark}

?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Use the first variant. The second variant will, possibly among other things, not account for your header changes in the table of contents:

\documentclass{book}

\usepackage{fancyhdr}
\pagestyle{fancy}
% GOOD
% \renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
% \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
% \fancyhead[RO,LE]{\small\sffamily\rightmark}
% \fancyhead[LO,RE]{\small\ttfamily\leftmark}
% BAD
\renewcommand{\chaptermark}[1]{\markboth{\small\ttfamily\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\small\sffamily\thesection\ #1}}
\fancyhead[RO,LE]{\rightmark}
\fancyhead[LO,RE]{\leftmark}

\usepackage{blindtext}

\begin{document}

\tableofcontents

\blinddocument

\end{document}

(The blindtext package is only used to add some dummy text to the example.)

EDIT: Replaced LaTeX 2.09 commands \sf and \tt with \sffamily resp. \ttfamily.

share|improve this answer
    
thanks. It is useful info for my life. –  xport Jan 17 '11 at 13:03

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.