1

I am using the fancyhdr package to create the headers and footers in my document. I wanted to display the chapter name on the left side of the page, so I defined my header like this:

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lhead{\textcolor{deepgray}{\begin{myfont} \chaptername \end{myfont}}}
\renewcommand{\footrulewidth}{0.1pt}
\cfoot{\textcolor{deepgray}{\begin{myfont} \textbf{\thepage} \end{myfont}}}

Where the deepgray color was defined as:

\definecolor{deepgray}{RGB}{147,147,147}

And myfont is:

\newenvironment{myfont}{\sffamily\selectfont}{\par}

But instead of displaying the chapter name in the header, all I get is the text "Capítulo", which is "Chapter" in Portuguese (the language used in my document). I tried changing the language to English and I got the same thing, but now the header only says "Chapter".

0

1 Answer 1

1

\chaptername is the command to show the word Chapter in different languages, according to the language passed to babel package.

Instead, use \leftmark.

Also I suggest you to replace \par by \rmfamily on myfont environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .