[Tex/LaTex] Number and title of chapter on left heading

header-footer

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

Best Answer

\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}