blob: 917ee68d03ba0d9d41bacddb4a3aa13125c6d617 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
%\hoffset=-0.1in
%\voffset=-2pc
%\raggedbottom
%\hsize=39pc %\vsize=59pc
%\maxdepth=2.2pt \parindent=1pc
%\vsize=720pt
%\hsize=6.5in
%\baselineskip12pt
%\parskip0pt
%\parindent1em
%\hfuzz1.5pt
%\tolerance2000
%\hyphenation{Post-Script}
% Page layout
\newdimen\pagewidth \newdimen\pageheight \newdimen\ruleht
\newdimen\colwidth \newdimen\bigcolheight\newdimen\gutter
\gutter=0.3in%better as 0.4in
%\colwidth=3.1in%19pc
\colwidth=\hsize
\advance\colwidth by-\gutter
\divide\colwidth by 2\relax
%\bigcolheight=1450pt%120pc
\bigcolheight=\vsize
\advance\bigcolheight by\bigcolheight
\advance\bigcolheight by 10pt
\pagewidth=\hsize \pageheight=\vsize \ruleht=.5pt
\abovedisplayskip=6pt plus 3pt minus 1pt
\belowdisplayskip=6pt plus 3pt minus 1pt
\abovedisplayshortskip=0pt plus 3pt
\belowdisplayshortskip=4pt plus 3pt
\newinsert\botins
\def\afoot{\strut\egroup}
\def\botpic#1{\par
\insert\botins\bgroup\hsize=\pagewidth
\offinterlineskip
\interlinepenalty100 \let\par=\endgraf
\leftskip=0pt \rightskip=0pt
\splittopskip=10pt plus 1pt minus 1pt \floatingpenalty=20000
\medskip{#1}\medskip\egroup}
\skip\botins=12pt plus 2pt minus 4pt % space added when footnote is present
\count\botins=2000 % footnote magnification factor (1 to 1)
\dimen\botins=36pc % maximum footnotes per page
\def\toppic#1{\par
\insert\topins\bgroup\hsize=\pagewidth
\interlinepenalty100 \let\par=\endgraf
\offinterlineskip
\leftskip=0pt \rightskip=0pt
\splittopskip=10pt plus 1pt minus 1pt \floatingpenalty=20000
\medskip{#1}\medskip\egroup}
\skip\topins=12pt plus 2pt minus 4pt % space added when footnote is present
\count\topins=2000 % footnote magnification factor (1 to 1)
\dimen\topins=36pc % maximum footnotes per page
\newinsert\margin
\dimen\margin=\maxdimen
%\count\margin=0 \skip\margin=0pt % marginal inserts take up no space
\newif\iftitle
\def\titlepage{\global\titletrue} % for pages without headlines
%\def\rhead{{}}
\def\leftheadline{\hbox to \pagewidth{%
\vbox to 10pt{}% strut to position the baseline
\sl\rhead\hfill\lhead % running head flush left
}}
\def\rightheadline{\hbox to \pagewidth{%
\vbox to 10pt{}% strut to position the baseline
\sl\rhead\hfill\lhead % running head flush left
}}
\def\onepageout#1{\shipout\vbox{ % here we define one page of output
\offinterlineskip % butt the boxes together
\vbox to 2pc{ % this part goes on top of the 44pc pages
\iftitle % the next is used for title pages
\global\titlefalse % reset the titlepage switch
\setcornerrules % for camera alignment
\else\ifodd\pageno \rightheadline\else\leftheadline\fi\fi
\vfill} % this completes the \vbox to 3pc
\vbox to \pageheight{
\ifvoid\margin\else % marginal info is present
\rlap{\kern31pc\vbox to 0pt{\kern4pt\box\margin \vss}}\fi
\ifvoid\topins\else % top note info is present
%\hrule height\ruleht width\pagewidth \kern-\ruleht \kern3pt
\unvbox\topins
\vskip\skip\topins \kern-3pt
%\hrule height\ruleht width\pagewidth \kern-\ruleht \kern3pt
\vskip\skip\topins \kern-3pt
\fi
#1 % now insert the main information
\vfill
\ifvoid\botins\else % bot note info is present
\vskip\skip\botins \kern-3pt
%\hrule height\ruleht width\pagewidth \kern-\ruleht \kern3pt
\unvbox\botins
\vskip\skip\botins \kern-3pt
%\hrule height\ruleht width\pagewidth \kern-\ruleht \kern3pt
\fi
\boxmaxdepth=\maxdepth
} % this completes the \vbox to \pageheight
}
\advancepageno}
\def\setcornerrules{\hbox to \pagewidth{\vrule width 1pc height\ruleht
\hfil \vrule width 1pc}
\hbox to \pagewidth{\llap{\sevenrm(page \folio)\kern1pc}%
\vrule height1pc width\ruleht depth 0pt
\hfil \vrule width\ruleht depth 0pt}}
\output{\onepageout{\unvbox255}}
\newbox\partialpage
\newdimen\savesize
\def\begindoublecolumns{\begingroup
\savesize=\vsize
\output={\global\setbox\partialpage=\vbox{\unvbox255\bigskip}}\eject
\output={\doublecolumnout} \hsize=\colwidth \vsize=\bigcolheight
\advance\vsize by -2\ht\partialpage
\advance\vsize by -2\ht\botins
\advance\vsize by -2\ht\topins
\pagegoal=\vsize}
\def\enddoublecolumns{\output={\balancecolumns}\eject
\global\output={\onepageout{\unvbox255}}
\global\vsize=\savesize
\endgroup \pagegoal=\vsize}
\def\doublecolumnout{%
% \splitmaxdepth=\maxdepth
\dimen0=\pageheight
\advance\dimen0 by-\ht\partialpage
\advance\dimen0 by-\ht\botins
\advance\dimen0 by-\ht\topins
\splittopskip=\topskip
\setbox0=\vsplit255 to\dimen0
\setbox2=\vsplit255 to\dimen0
\onepageout\pagesofar
\global\vsize=\bigcolheight
\unvbox255 \penalty\outputpenalty}
\def\pagesofar{\unvbox\partialpage
\wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
\def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen0=\ht0
\advance\dimen0 by\topskip \advance\dimen0 by-\baselineskip
\divide\dimen0 by2 \splittopskip=\topskip
{\vbadness=10000 \loop \global\setbox3=\copy0
\global\setbox1=\vsplit3 to\dimen0
\ifdim\ht3>\dimen0 \global\advance\dimen0 by1pt \repeat}
\setbox0=\vbox to\dimen0{\unvbox1}
\setbox2=\vbox to\dimen0
% {\unvbox3}
{\dimen2=\dp3 \unvbox3 \kern-\dimen2 \vfil}
\global\output={\balancingerror}
\pagesofar}
\newhelp\balerrhelp{Please change the page into one that works.}
\def\balancingerror{\errhelp=\balerrhelp
\errmessage{Page can't be balanced}
\onepageout{\unvbox255}}
|