-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path2col.tex
55 lines (39 loc) · 1.1 KB
/
2col.tex
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
54
55
% last change 2016-11-20
% from the TeXbook, p. 257
\newdimen\fullhsize
\fullhsize\hsize
\def\fullline{\hbox to\fullhsize}
\ifx\plainmakeheadline\undefined
% ensure that we do this only once!
\let\plainmakeheadline\makeheadline
\let\plainmakefootline\makefootline
\fi
% the text width spans both columns, as far as
% head- and footlines are concerned
\def\textwideline{\hbox to\fullhsize}
\def\makeheadline{{\let\line\textwideline\plainmakeheadline}}
\def\makefootline{{\let\line\textwideline\plainmakefootline}}
% space between the two columns — can be changed
% immediately after loading 2col
\def\gutter#1{\hsize\fullhsize
\advance\hsize-#1
\hsize.5\hsize
}
\gutter{1.5pc}
\let\lr=L
\newbox\leftcolumn
\output={\if L\lr
\global\setbox\leftcolumn=\columnbox
\global\let\lr=R\else
\doubleformat
\global\let\lr L\fi
\ifnum\outputpenalty>-20000 \else
\dosupereject\fi}
\def\doubleformat{\shipout\vbox{\makeheadline
\fullline{\box\leftcolumn\hfil\columnbox}%
\makefootline}\advancepageno}
\def\columnbox{\leftline{\pagebody}}
% \bye cleans up.
\outer\def\bye{\vfill\supereject
\if R\lr\null\vfill\eject\fi
\end}