summaryrefslogtreecommitdiff
path: root/info/examples/tlc3/example-sources/5-3-5.ltx
blob: e7518f0056580941cfd1bd1b4325ed995d982d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%%
%% The LaTeX Companion, 3ed
%%
%% Example 5-3-5 on page I-395 in "\LaTeX {}'s new mark mechanism".
%%
%% Copyright (C) 2022 Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%%
%% See https://www.latex-project.org/lppl.txt for details.
%%

\documentclass{tlc3exa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{201.0pt}

  \setlength\textheight{11\baselineskip}
  \addtolength\textheight{\topskip}

  % for the book examples we shorten the vertical spaces
  \addtolength\headsep{-12pt} % shortened for the book
  \addtolength\footskip{-12pt} % shortened for the book
  \raggedright % as these examples are so small

%% show second page

%StartShownPreambleCommands
\NewMarkClass{pmark}
\usepackage{lipsum,fancyhdr}
\pagestyle{fancy} \fancyhf{}
\newcommand\sample[1]{S-#1:%
  \InsertMark{pmark}{S-#1} \lipsum[1][#1]}
\chead{first: | \TopMark[first-column]{pmark}
      | \FirstMark[first-column]{pmark}
      | \LastMark[first-column]{pmark} |
     --- last: | \TopMark[last-column]{pmark}
      | \FirstMark[last-column]{pmark}
      | \LastMark[last-column]{pmark} |}
\cfoot{page: | \TopMark{pmark}
      | \FirstMark{pmark} | \LastMark{pmark} |
    ---  previous:
        \FirstMark[previous-page]{pmark}}
%StopShownPreambleCommands

\begin{document}
\sample{1}  % first page not shown!
\twocolumn \sample{2} \sample{3} \sample{4}
\sample{5} \sample{6} \sample{7} \sample{8}
\sample{9} \sample{10} \ldots
\end{document}