I am using the following fancyhdr package to operate with headers in my paper:


If now I want to change the header in the chapter (the chapter names are too long) then I write \chapter[chapter short name]{full name of chapter} and the same with sections

but such formula gives me "chapter short name" in table of contents. How to change the headers with no changing the original names in table of contents?

  • You can use load titlesec with the toctitles option for that (possibly you might have to load titleps in the place of fanyhdr for headers and footers – not tested).
    – Bernard
    Feb 26, 2021 at 11:01

2 Answers 2


You can use \chaptermark{...} to set the header.

\sectionmark is trickier since it appears on the same page. It is designed to show the first section, and since \section calls \sectionmark, the default name is the first section. So I created \mysection which does not call \sectionmark.


  \ifx\empty\temp\relax \edef\temp{#2}\fi


\chapter[Short title]{Long title}
\chaptermark{Short header}


\mysection[Short section title]{Long section title}
\sectionmark{Short section header}


  • Okay, that's it. \chaptermark (similarly \sectionmark) does not change the title in table of contents. Thank You very much!
    – mwrooo
    Feb 26, 2021 at 14:22
  • Update: okay it works almost: the long section title is on the page where the section starts, despite sectionmark function...
    – mwrooo
    Feb 26, 2021 at 14:27
  • Another solution is to run \sectionmark before \section. If \section causes a pagebreak, stick a \par\pagebreak or \needspace in front. Feb 27, 2021 at 2:41

The memoir class (a superset of book and report) provides for ToC, header, and regular sectional commands through two optional arguments. For example:


You must log in to answer this question.

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