blob: 1c4504706f790105f5228599a491ad3c85286074 (
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
|
% Requires \newdimen\gap, \newcount\cols, adjusts to \newdimen\width
\newdimen\fullhsize\fullhsize=\width \advance\fullhsize by -2in%1 in margin
\def\fullline{\hbox to \fullhsize}%%modify \makeheadline\makefootline
\def\widthline{\hbox to \width}
\def\fullcenter#1{\fullline{\hfil #1\hfil}}
\def\makeheadline{\vbox to 0pt{\vskip -22.5pt \fullline{%
\vbox to 8.5pt{}\the\headline}\vss}\nointerlineskip}
\def\makefootline{\baselineskip24pt\lineskiplimit0pt \fullline{\the%
\footline}}
\newcount\defs\defs=\cols\advance\defs by -1
\hsize=\fullhsize \divide\hsize by \cols\advance\hsize by -\gap
\newcount\col
\let\isnum\ifnum
\def\newb@x{\alloc@4\box\chardef\insc@unt}
\loop\expandafter\newb@x\csname col\number\col\endcsname\advance\col
by 1\isnum\col<\defs\repeat
\col=0
\output={%
\ifnum\col<\defs
\expandafter\global\expandafter\setbox\csname col\number\col\endcsname\fullbox
\global\advance\col by 1%
\else \global\col=0\shipout\vbox{\makeheadline
\fullline{%
\loop\isnum\col<\defs\expandafter\box\csname col\number\col\endcsname\hfil
\advance\col by 1\repeat\fullbox}
\makefootline}
\fi
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
\def\fullbox{\hbox{{\expandafter}\expandafter\ifx\csname color\endcsname\relax%is color defined?
\else\colorbox{colo}{\columnbox}\fi}}
\def\columnbox{\leftline{\vbox to \vsize{\vfil}\pagebody}}
|