3

I would like to include the chapter number only (i.e. without the word "chapter"), and its title on the left header on a page.

So far, I have used the following code:

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markright{\chaptername\ \ #1}{}}
\lhead[\fancyplain{}{}]{\fancyplain{}{\bfseries\rightmark}}
\chead[\fancyplain{}{}]{\fancyplain{}{}}
\rhead[\fancyplain{}{}]{\fancyplain{}{\bfseries\thepage}}

It is not exactly what I want, though:

  • I have the bolded page number on the top right as desired;
  • I have the bolded chapter name on the top left as desired;

But:

  • I also have the word "Chapter" appearing before the chapter name, and no number

What I would like to appear in the header is, for example:

2 Blabla

  • 1
    Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Fran May 6 '15 at 19:22
4

\chaptername inserts the word Chapter. What you want is

\renewcommand{\chaptermark}[1]{\markright{\thechapter\ #1}{}}

Here is a minimal example:

enter image description here

\documentclass{report}
\usepackage{fancyhdr,lipsum}
\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{\markright{\thechapter\ #1}{}}
\fancyhf{}% Clear header/footer
\fancyhead[L]{\bfseries\rightmark}
\fancyhead[R]{\bfseries\thepage}

\begin{document}
\chapter{A chapter}
\lipsum[1-50]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy