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

I'm writing a LaTeX document with book as document class and compiled with pdflatex. TexLive version is latest 2012.

For introduction (and conclusions) chapter, I'm using:

\chapter*{Introduction \markboth{INTRODUCTION}{}}
\addcontentsline{toc}{chapter}{\hspace{12pt} Introduction}
  • chapter* because I want it to be non-numbered
  • \markboth because otherwise header is not "INTRODUCTION" but "CONTENTS" instead (cf. header and chapter* for example)
  • \addcontentsline to have it appear in the table of contents

But if I reference it using \nameref{intro} in another chapter (\chapter{my chapter}) then the header of that chapter becomes "INTRODUCTION" instead of "CHAPTER 1 - MY CHAPTER".

Note that if I don't use \markboth for the Introduction the header of chapter 1 is correct but the header for the Introduction is not (it becomes "CONTENTS").

Of course if just after the \nameref{} in chapter 1, I call \markboth{CHAPTER 1 - MY CHAPTER}{} then the chapter 1 header is correct again but this is obviously not practical.

Here is a minimal code showing the problem :


% nameref is buggy, when used, header names for chapter in which it is used are wrong
% if previous chapter is a chapter
% even version from 2012/07/31 is buggy ...



%\markboth is needed otherwise header is "CONTENTS" instead of "INTRODUCTION" because this is a chapter*{}, not a chapter{}
\chapter*{Introduction \markboth{INTRODUCTION}{}}
\addcontentsline{toc}{chapter}{\hspace{12pt} Introduction}
\chapter{On the use of Foo in Bar}
And here if I namereference the \nameref{intro} it will break the nice header.
%And here if I namereference the \nameref{intro} with a \markboth{CHAPTER 1 - On the use of Foo in Bar}{} it will do what I need but it is *not* practical at all.

\chapter{On the use of Bar in Foo}
\chapter*{Conclusions \markboth{CONCLUSIONS}{}}
\addcontentsline{toc}{chapter}{\hspace{12pt} Conclusions}
\chapter{And here too}
blabla with a nameref. to the \nameref{chap1}. cause the same problem, header that should read "CHAPTER 3 - AND HERE TOO" is replaced by "INTRODUCTION".

share|improve this question
putting \markboth outside of the chapter{} fixes the issue. I'll answer my own question as soon as stackexchange lets me do it (i.e. in 8 hours) – alexis Aug 7 '12 at 16:55
up vote 2 down vote accepted

\chapter*{Introduction \markboth{INTRODUCTION}{}}

What is the title? The whole argument:

Introduction \markboth{INTRODUCTION}{}

What happens, if \nameref is used? The whole title including \markboth is called and the execution of \markboth changed your header.


  • Put \markboth after \chapter*:

  • Since version 2009/12/08 v2.34 package nameref uses package gettitlestring. This package knows a title extract method using expansion that allows to filter stuff out, see package documentation of gettitlestring.


During title string extraction macro \markboth removes its arguments and calls unskip to get rid of the previous space.

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.