TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

What do the toc related commands \@mkboth and \markboth do?

share|improve this question
It is mostly the same as \markboth, the kernel docs suggest class and package writers sometimes use \@mkboth instead as then certain packages can redefine it to do nothing. See texdoc source2e – daleif Aug 30 '14 at 15:26
Fair enough. I now edited the question to ask for \markboth as well. – Mappi Aug 30 '14 at 15:36
up vote 7 down vote accepted

Here is the definition of \markboth from the LaTeX kernel:

    \let\label\relax \let\index\relax \let\glossary\relax
    \unrestored@protected@xdef\@themark {{#1}{#2}}%
    \@temptokena \expandafter{\@themark}%

It takes two arguments, designed to aid in the setting of the headers in twoside mode - the first is set as the left page header, while the second ends up in the right page header.

In contrast, \@mkboth is used as an internal kernel tool and may take on multiple functions. From source2e (section 65.3 marking conventions, p 310):

Commands like \tableofcontents that should set the marks in some page styles use a \@mkboth command, which is \let by the pagestyle command (\ps@...) to \markboth for setting the heading or to \@gobbletwo to do nothing.

For example, the empty page style (in latex.ltx) sets


while the headings page style (in article.cls) sets

share|improve this answer
Are \markboth and \@mkboth thus only intended to be used with twoside option? – Mappi Aug 30 '14 at 17:41
@Mappi: No. Their effect will depend on the twoside option, but you can use them in both. – Werner Aug 30 '14 at 17:47

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.