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.

The text in my fancyhead is written in small caps. I would like to have it not in small caps. How can I do?

This is my fancyhead:

\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}

something like that:

enter image description here

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

To get a format similar to the one in the example page, you can do like this:

\documentclass[a4paper]{book}
\usepackage{fancyhdr}

\pagestyle{fancy}

\makeatletter
\DeclareRobustCommand{\format@sec@number}[2]{{\normalfont\upshape#1}#2}
\renewcommand{\chaptermark}[1]{%
  \markboth{\format@sec@number{\ifnum\c@secnumdepth>\m@ne\@chapapp\ \thechapter. \fi}{#1}}{}}
\renewcommand{\sectionmark}[1]{%
  \markright{\format@sec@number{\ifnum\c@secnumdepth>\z@\thesection. \fi}{#1}}}
\makeatother

\fancyhf{}
\fancyhead[RE]{\itshape\nouppercase{\leftmark}}
\fancyhead[LO]{\itshape\nouppercase{\rightmark}}
\fancyhead[LE,RO]{\thepage}

I assume two-sided printing. Here are the header for an even and an odd page.

enter image description here

enter image description here

share|improve this answer
add comment

Use \nouppercase:

\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\nouppercase{\sl{\rightmark}}}}
\rhead[\fancyplain{}{\nouppercase{\sl{\leftmark}}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}

I prefer the use of \itshape over \sl and \rmfamily over \rm

\usepackage{lipsum,fancyhdr}
\lhead[\rmfamily\thepage]{\fancyplain{}{\itshape\nouppercase\rightmark}}
\rhead[\fancyplain{}{\itshape\nouppercase\leftmark}]{\rmfamily\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}

In this case \rmfamily looks superfluous.

share|improve this answer
1  
Using \itshape or \rmfamily is not only a personal preference; the two letter commands should never be used: they exist only for compatibility with older documents and document classes may not implement them. –  egreg Dec 18 '12 at 8:41
    
The replacement for \sl is \slshape, not \itshape. –  Andrew Swann Dec 18 '12 at 9:55
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.