Header Footer – How to Remove ‘Chapter 1.’ from ‘Chapter 1. Introduction’ Using \leftmark

chaptersfancyhdrheader-footer

MWE is below:

\documentclass{report}
\usepackage{fancyhdr}
%\newcommand{\currentchapter}{}
%\let\oldchapter\chapter
%\renewcommand{\oldchapter}[1]{\oldchapter{#1}\renewcommand{\currentchapter}{#1}}

%\renewcommand{\sectionmark}[1]{\markright{#1}}

%\renewcommand{\chaptermark}[1]{\markboth{\textbf{#1}}{}} \rhead{\leftmark} 

\fancypagestyle{newstyle}{
\fancyhf{}
\fancyhead[LE]{{\nouppercase{\leftmark}}}
\fancyhead[RO]{{\nouppercase{\rightmark}}}
}
\begin{document}

I want to have

'Introduction'

in place of

'Chapter 1. Introduction'

as the header for my pages inside the document.
So, is there a command set I can use instead of \leftmark to get the desired results? Or can I redefine \leftmark in any way to get the desired results?

Best Answer

The problem with your current (re)definition of \chapter is that it removes the ability to use \chapter*{<title>} or \chapter[<ToC entry>]{<title>}. While this may not be a problem in your case, a general approach/solution would be preferred.

titleps provides built-in access to the titles of sectional units via \chaptertitle, \sectiontitle, etc.:

enter image description here

\documentclass[twoside]{report}
\usepackage{titleps,lipsum}% http://ctan.org/pkg/{titleps,lipsum}
\newpagestyle{newstyle}{
  \setheadrule{.4pt}% Header rule
  \sethead[\chaptertitle]% even left
    []% even centre
    [\thepage]% even right
    {\thepage}% odd left
    {}% odd centre
    {\sectiontitle}% odd right
}

\pagestyle{newstyle}

\begin{document}

\chapter{Introduction}
\lipsum[1-10]

\section{A section}
\lipsum[2-20]

\end{document}

In fact, even though the above does not use fancyhdr, the switch to titleps is fairly straight forward. See titleps for fancyhdr users. The advantage should be obvious, since the interface provided by titleps is clear and avoids hacking into the page marks to extract content.