blob: 616109d34ea0e9cc086025fa0c84e6f3b21b51ea (
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
|
\newbox\indexbox
\newbox\leftcol
\newbox\rightcol
\newbox\indexintro
\splittopskip=0pt
\dimpuba=\vsize \advance\dimpuba by -10pt
\def\firstpage{\setbox\leftcol=\vsplit\indexbox to \dimpube
\setbox\rightcol=\vsplit\indexbox to \dimpube
\line{\vtop{\vskip\splittopskip\unvbox\leftcol}\hfil
\vtop{\unvbox\rightcol}}%
}
\def\fullpage{\setbox\leftcol=\vsplit\indexbox to \dimpuba
\setbox\rightcol=\vsplit\indexbox to \dimpuba
\line{\vtop{\vskip\splittopskip\unvbox\leftcol}\hfil
\vtop{\unvbox\rightcol}}\vfil\break}
\def\lastpage{\setbox\leftcol=\vsplit\indexbox to .5\ht\indexbox
\setbox\rightcol=\vsplit\indexbox to .5\ht\indexbox
\line{\vtop{\vskip\splittopskip\unvbox\leftcol}\hfil
\vtop{\unvbox\rightcol}}\vfil}
\def\makeindex#1#2{%
\setbox\indexbox=\vbox{\parskip=0pt
\everypar={\hangindent=1em \hangafter=1}%
\linepenalty=200 \hsize=.45\hsize \rightskip=0pt plus 1em
\parindent=0pt
\obeylines \input #1 }%
\dimpube=#2
\begingroup
\vbadness=10000
\firstpage
\loop \ifdim\ht\indexbox>2\dimpuba \fullpage \repeat
\lastpage
\endgroup
}
|