TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I format the header on every page displaying the title of the current chapter? In one of my chapters the title is too long so it is running out of the page.

Here's a minimal example of my document:


\chapter{Very long title}

Here's a screenshot of my problem:

enter image description here

share|improve this question
up vote 27 down vote accepted

Another alternative might be:

\chapter[medium-length title for TOC, if wanted]{full title name}
\chaptermark{short title for running headers}
share|improve this answer

You could provide a shorter chapter title via the optional argument to \chapter:

\chapter[<short title>]{<long title>}

Note that this will also influence the entry in the table of contents.

share|improve this answer
Thank you for your answer! I read this somewhere before... I think I have to leave the title as it is for the TOC :-/ is it a good idea to try a double line header? – strauberry Aug 21 '11 at 19:14
@Stefan thank you for that hint, I used chaptermark now – strauberry Aug 21 '11 at 19:54

The solution that seems to work in every situation (even with math) is:

\chapter[\texorpdfstring{TOC title \( inline math A \)
    }{TOC in pdf bookmarks}
]{\chaptermark{header} Chapter title \( inline math A \)}

In this solution the pdf bookmarks are defined by \texorpdfstring{#1}{#2}, where #1 is the title inside the pdf document while #2 is the pdf bookmark.

The [shorter] heading is defined by \chaptermark{header}. The repeated command is not a typo, but it is needed in order to have the right behaviour in every situation (do not ask why since I do not have any idea, just by tentative; if you know the reason, please comment.)

Important: the solution also works with \section, just change \chaptermark with \sectionmark.

Disclaimer: I wrote the blog post.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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