ltpage.dtx

Johannes Braams  David Carlisle  Alan Jeffrey
Leslie Lamport  Frank Mittelbach  Chris Rowley

Rainer Schöpf

1995/07/20

1 Page styles and related commands

1.1 Page Style Commands

\pagestyle{⟨style⟩} : sets the page style of the current and succeeding pages to style

\thispagestyle{⟨style⟩} : sets the page style of the current page only to style. To define a page style style, you must define \ps@style to set the page style

parameters.

HOW A PAGE STYLE MAKES RUNNING HEADS AND FEET:

   The \ps@. . . command defines the macros \@oddhead, \@oddfoot, \@evenhead,

and \@evenfoot to define the running heads and feet. (See output routine.) To make headings determined by the sectioning commands, the page style defines

the commands \chaptermark, \sectionmark, etc., where \chaptermark{⟨text⟩}

is called by \chapter to set a mark. The \...mark commands and the \...head macros are defined with the help of the following macros.

(All the \...mark commands should be initialized to no-ops.)

1.2 marking conventions

L^{A}TEX extends TeX’s \mark facility by producing two kinds of marks a ‘left’ and a ‘right’ mark, using the following commands: \markboth{⟨left⟩}{⟨right⟩} : Adds both marks. \markright{⟨right⟩} : Adds a ’right’ mark. \leftmark : Used in the output routine, gets the current ‘left’ mark. Works like

TeX’s \botmark.

\rightmark : Used in the output routine, gets the current ‘right’ mark. Works like TeX’s \firstmark. The marking commands work reasonably well for right marks ‘numbered within’ left marks—e.g., the left mark is changed by a \chapter command and the right mark is changed by a \section command. However, it does produce somewhat anomalous results if 2 \markboth’s occur on the same page.

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.

1 ⟨∗2ekernel⟩

\pagestyle
 2 \def\pagestyle#1{%
 3 \@ifundefined{ps@#1}%
 4  \undefinedpagestyle
 5  {\@nameuse{ps@#1}}}
\thispagestyle
 6 \def\thispagestyle#1{%
 7 \@ifundefined{ps@#1}%
 8  \undefinedpagestyle
 9  {\global\@specialpagetrue\gdef\@specialstyle{#1}}}

Default Initializations

\ps@empty
10 \def\ps@empty{%
11 \let\@mkboth\@gobbletwo\let\@oddhead\@empty\let\@oddfoot\@empty
12 \let\@evenhead\@empty\let\@evenfoot\@empty}
\ps@plain
13 \def\ps@plain{\let\@mkboth\@gobbletwo
14  \let\@oddhead\@empty\def\@oddfoot{\reset@font\hfil\thepage
15  \hfil}\let\@evenhead\@empty\let\@evenfoot\@oddfoot}
\@leftmark \@rightmark We implement \@leftmark and \@rightmark in terms of already defined com-

mands to save token space. We can’t get rid of them since they are sometimes used in applications.

16 \let\@leftmark\@firstoftwo
17 \let\@rightmark\@secondoftwo
\markboth \markright test for \@nobreak added 15 Apr 86 in \markboth and \markright letting \label

and \index to \relax added 22 Feb 86 so these commands can appear in sectioning command arguments RmS 91/06/21 Same for \glossary

18 \def\markboth#1#2{\gdef\@themark{{#1}{#2}}{%
19  \let\protect\@unexpandable@protect
20  \let\label\relax \let\index\relax \let\glossary\relax
21  \mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}
22 \def\markright#1{{\let\protect\@unexpandable@protect
23  \let\label\relax \let\index\relax \let\glossary\relax
24  \expandafter\@markright\@themark
25  {#1}\mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}

\@markright \leftmark \rightmark
26 \def\@markright#1#2#3{\gdef\@themark{{#1}{#3}}}
27 \def\leftmark{\expandafter\@leftmark\botmark{}{}}
28 \def\rightmark{\expandafter\@rightmark\firstmark{}{}}

Initialization

\@themark
29 \def\@themark{{}{}}

\mark We initialize the internal TEX \mark when we reach \begin{document}. Initialization in the format would not survive.

30 %\AtBeginDocument{\mark{{}{}}}

OTHER —–

\raggedbottom :Typesets pages with no vertical stretch, so they have their natural height instead of all being exactly the same height. (Uses a space of .0001fil to avoid interfering with the 1fil space of \newpage.)

\flushbottom : Inverse of \raggedbottom - makes all pages the same height.

\sloppy : Resets TeX’s parameters so it accepts worse line and page breaks, and slightly more overfull boxes.

\fussy : Resets TeX’s parameters to their normal finnicky values.

\raggedbottom
31 \def\raggedbottom{%
32 \def\@textbottom{\vskip \z@ \@plus.0001fil}\let\@texttop\relax}
\flushbottom
33 \def\flushbottom{%
34 \let\@textbottom\relax \let\@texttop\relax}

Default definitions

\sloppy \sloppy will never (well, hardly ever) produce overfull boxes, but may produce underfull ones. (14 June 85) A sloppypar environment is equivalent to

{\par \sloppy ... \par}.
35 \def\sloppy{%
36 \tolerance 9999%
37 \emergencystretch 3em%
38 \hfuzz .5\p@
39 \vfuzz\hfuzz}

sloppypar
40 \def\sloppypar{\par\sloppy}
41 \def\endsloppypar{\par}
\fussy
42 \def\fussy{%
43 \emergencystretch\z@
44 \tolerance 200%
45 \hfuzz .1\p@
46 \vfuzz\hfuzz}

\overfullrule L^{A}TEX default is no overfull box rule. Changed by document class option.

47 \overfullrule 0pt

48 ⟨/2ekernel⟩