2

In standard classes book.cls and report.cls we find

\newcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }

and

\newcommand\listoffigures{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    }

In article.cls

\newcommand\tableofcontents{%
    \section*{\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \@starttoc{toc}%
    }

and

\newcommand\listoffigures{%
    \section*{\listfigurename}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lof}%
    }

and in documentation we read

The code for \@mkboth is placed inside the heading to avoid any influence on vertical spacing after the heading (in some cases). For other commands, such as \listoffigures below this has been changed from the LATEX2.09 version as it will produce a serious bug if used in two-column mode (see, pr/3285). However \tableofcontents is always typeset in one-column mode in these classes, therefore the somewhat inconsistent setting has been retained for compatibility reasons.

Question Can any one please explain a bit this paragraph, in particular in some cases (so if there is an example)

and However \tableofcontents is always typeset in one-column


Update - Main questions

  1. Why \@mkboth is placed inside the heading for \tableofcontents?
  2. Why the two codes \tableofcontents and \listoffigures are differents?

Answers (what i understand)

\@mkboth is placed inside the heading to avoid any influence on vertical spacing after the heading (in some cases)

OK I can see the point here, but then the 2nd question come: why we don't do same for \listoffigures?

For other commands, such as \listoffigures below this has been changed from the LATEX2.09 version as it will produce a serious bug if used in two-column mode (see, pr/3285).

Here I can't see! and next lines confuse me more.

  • I can't see any difference regarding one-column or two-column. – touhami Jul 9 '16 at 20:36
  • \@mkboth is no fixed command actually. Depending on page style it is \markboth or a \@gobbletwo etc, via \let – user31729 Jul 9 '16 at 20:46
  • @ChristianHupfer thanks, I am trying to understand why the codes are differents and documentation confuse me more (well it's my english) – touhami Jul 9 '16 at 21:02
  • Perhaps you should ask David Carlisle or Joseph Wright in chat, they should know more on this. I think it's some kind of a relict – user31729 Jul 9 '16 at 21:05

Your Answer

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

Browse other questions tagged or ask your own question.