MWE is below:



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


I want to have


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?

  • Would using \chapter*{Introduction} solve your problem?
    – Ricardo
    May 13 '13 at 17:23
  • Can you please add more information for the example? What's the purpose of \currentchapter?
    – egreg
    May 13 '13 at 17:32

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

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




\section{A section}


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.

  • Sorry Sorry !!! I was totally exhausted when I posted this question that I was in a hurry and I was not clear enough. I want to use the chapter name in the header and I know that \leftmark gives me the chapter name. but, it also gives me an unwanted word - the chapter number. I just want the chapter name and want to remove the chapter number from the command \leftmark. I have made come edit to the code that I posted above(it was actually the methods I tried to get this result)
    – newbie
    May 13 '13 at 17:59
  • @newbie: But that's exactly what titleps provides in my answer. \chaptertitle gives only the chapter title (no number and no CHAPTER prefix). So no need to be sorry...
    – Werner
    May 13 '13 at 18:03
  • Big thanks.. Thanks for the example pictures also.. LIFESAVER answer.. Works PERFECT
    – newbie
    May 13 '13 at 18:05
  • This is exactly what I need except that I would like centered headers, where should I change the code? Jul 31 '15 at 21:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.