1

I maintain a class file which I inherited and which contained the following page style in the inherited code:

\newcommand{\ps@bottom}{%
    \let\@mkboth\markboth
    \renewcommand{\@oddhead}{}%
    \renewcommand{\@evenhead}{\@oddhead}
    \renewcommand{\@oddfoot}{\hfil\thepage\hfil}
    \renewcommand{\@evenfoot}{\@oddfoot}
}

Recently I've been making some modifications to the class file which have run into a conflict with the first line in this page style. When I removed that line, my modifications worked and the page style seems, at first glance to still be working fine too. Before I make such a change permanent though, I'd like to understand the implications of removing that line. Put another way, what's the difference in the expected behavior of the above page style and this one:

\newcommand{\ps@bottom}{%
    \renewcommand{\@oddhead}{}%
    \renewcommand{\@evenhead}{\@oddhead}
    \renewcommand{\@oddfoot}{\hfil\thepage\hfil}
    \renewcommand{\@evenfoot}{\@oddfoot}
}

1 Answer 1

2

The difference is that one defines \@mkboth and the other does not. Whether that makes any functional difference depends on whether \@mkboth is called anywhere and that depends on details you have not shown.

\@mkboth is not called by any command in the latex format but is used by the standard classes.

For example article class defines

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

so the table of contents sets marks or not depending on whether \@mkboth is \markboth or \@gobbletwo

The headings page style sets it to \markboth the empty page style sets it to \@gobbletwo for example.

1
  • So it’s a simple matter of checking how \@mkboth is used elsewhere in the class file and the report class (from which this class file is derived). Excuse me while I go bang my head against the desk before doing some greping. Commented Oct 22, 2018 at 13:12

You must log in to answer this question.

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