summaryrefslogtreecommitdiff
path: root/macros/text1/macros/fixcol.tex
blob: 02f3402583e9e276f76620118464324a50e7b0f8 (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
% FILE HAS BEEN CONVERTED TO 2.03
%
%     MULTIPLE COLUMN FORMATS FIXED MODE, two and three column
%     Harvey 1/29/86
%
\catcode`*=11 \catcode`@=11
%
\global\let\newcolumn=\np              % new column in fixed mode is the
\global\let\nc=\np                     % same as newpage in single column
%
\gdef\pagebody{\vbox to\vsize{\boxmaxdepth=\maxdepth
    \pagecontents\vfill}}% redefine from plain.tex to add vfil
                                     % prevents underfull vbox in last column
%
\gdef\flexibleformat{\write16{<TEXT1> Warning! You can't change to%
 flexible format while in fixed format. }}%
 
%
\gdef\full*pgw{\hbox to \the\*txtw}%    Output box to full pagewidth
%
\gdef\*colbox{\leftline{\pagebody}}%    TeXbook definition
%
\gdef\*page{% MAKEPAGE, *mkpg, ships out the complete page body
    \*badj                        % check for binding offset
    \if*title\shipout             % titlepage, no headline
       \vbox{\*pgmat %                    page template
       \makefootline}
       \notitlepage
    \else\shipout\vbox{ %           normal page with head and footlines
         \makeheadline %
         \*pgmat %                  page template
         \makefootline}
    \fi
     \ifnum\*pcount>0 \*blkpg\fi %  call for empty page, BLANK PAGE MACRO
     \advancepageno}% END, makepage routine
%
\gdef\*fixtwc{% BEGIN TWO COLUMNS FIXED FORMAT---set-up
    \if*plain \par\vfill\eject \fi   % new page prevents mixed formats
    \if*dbl\e*fixtwc\fi              % end any active double columns
    \if*tpl \par\vfill\eject \fi     % new page prevents mixed multicolumn format
                                     % vfil eject prevents mixing formats
    \def\*fixout{% TWO COLUMN OUTPUT, Fixed method
        \if L\lr                     % if column indicator is left
           \global\setbox\*lftcol=\*colbox % first column page
           \global\let\lr=R          % switch to second column
        \else                        % print page and reset column indicator
           \*page                    % format actual double column page
           \global\let\lr=L          % switch to first column
        \fi
        \ifnum\outputpenalty>-20000  % do nothing if no insert material
        \else\dosupereject\fi        % flush any held over material
        }% End, normal fixed mode two column output routine
%
    \def\*pgmat{% PAGEMAT, formats columns and rules
       \D=\the\*twcgut \D=.5\D       % split gutter width in half
       \full*pgw{\box\*lftcol        % print left column
       \hskip\D\vrule width\the\*clrw\hskip\D % gutter and rule
       \*colbox\hfil}                % print right column and fill
       }% END, pagemat
%
    \def\newpage{\par\supereject     % fills remainder of page with white
       \if R\lr \null\vfill\eject\fi}% space and goes to next page
    \let\np=\newpage
%
    \begingroup % BEGIN DOUBLE COLUMNS, fixed method
    \tolerance=6400                  % line breaking tolerance
    \hbadness=6400                   % message tolerance
    \brokenpenalty=0                 % setting these penalties to zero prevents
    \clubpenalty=0                   % strange page breaks that might otherwise
    \widowpenalty=0
    \hyphenpenalty=0
    \exhyphenpenalty=0
    \hsize=\the\*twcw                % set column width
    \let\lr=L                        % set switch to left (L) % begin with left
    \output={\*multout}              % fixed format output rou  tine
    \global\*plainfalse              % plainoutput indicator false
    \global\*dbltrue}% END FIXED TWO COLUMN FORMAT---set-up
\global\let\twc=\*fixtwc
%
\gdef\e*fixtwc{\par\supereject % END FIXED TWO COLUMN FORMAT, called
    \if R\lr \null\vfill\eject\fi    % from onecolumn
    \endgroup                        % two column fixed formatting ends
    \global\*dblfalse                % fixed double column indicator false
    \global\*plaintrue}%               plainoutput indicator true
%
\gdef\*fixthc{% BEGIN THREE COLUMNS FIXED FORMAT---set-up
    \if*plain \par\vfill\eject\fi    % new page prevents mixed formats
    \if*tpl\e*fixthc\fi              % end any active triple columns
    \if*dbl \par\vfill\eject\fi      % new page prevents mixed multicolumn formatting
%
    \def\*fixout{% THREE COLUMN OUTPUT, Fixed method
       \if L\lr                      % if column indicator is left
       \global\setbox\*lftcol=\*colbox
       \global\let\lr=M              % switch to middle column
       \else\if M\lr                 % if middle column indicator is true
          \global\setbox\*midcol=\*colbox
          \global\let\lr=R           % switch column indicator to right
             \else
                \*page               % make the page
                \global\let\lr=L     % reset column indicator to left
             \fi\fi %
        \ifnum\outputpenalty>-20000 %  no held over material
        \else\dosupereject\fi}%        eject held over insertions
%
    \def\*pgmat{% PAGEMAT, *pgmat, the page template routine
       \D=\the\*thcgut \D=.5\D       % half gutter width on each side of rule
       \full*pgw{\box\*lftcol        % print leftcolumn
                 \hskip\D\vrule width\the\*clrw\hskip\D % rule and gut.
                 \box\*midcol        % print middle column
       \if*norule \hskip2\D          % supress rule on empty page call
       \else                         % else set rules normally
          \hskip\D\vrule width\the\*clrw\hskip\D\fi % rule and gut.
          \*colbox\hfil}             %  print right column and fil
          \global\*norulefalse
       }% END, Pagemat
%
    \def\newpage{\par\supereject
       \if M\lr \null\vfill\eject
          \null\vfill\eject\global\*noruletrue\fi % supress column rules
       \if R\lr \null\vfill\eject\global\*noruletrue\fi}
    \let\np=\newpage
%
    \begingroup % BEGIN THREE COLUMNS, fixed method
    \widowpenalty=0
    \clubpenalty=0
    \brokenpenalty=0
    \hyphenpenalty=0
    \exhyphenpenalty=0
    \tolerance=9400
    \hbadness=9400
    \hsize=\the\*thcw                % column width = three column width  tokens
    \let\lr=L                        % set column switch to left column
    \output={\*multout}              % fixed format output routine
    \global\*plainfalse              % plainoutput indicator false
    \global\*tpltrue}                % end 3 col fixed format
\global\let\thc=\*fixthc             %      reset abbreviation for (thc)
%
\gdef\e*fixthc{\par\supereject       % end 3 columns fixed mode
    \if M\lr \null\vfill\eject \null\vfill\eject\fi % called from
    \if R\lr \null\vfill\eject\fi    % onecolumn
    \endgroup                        % three column fixed formatting indicator f
    \global\*tplfalse                % end triple column indicator
    \global\*plaintrue}%               plainoutput indicator true
%
\gdef\*multout{\*badj
              \*fixout
    }% end fixed format output routine
 
\gdef\onecolumn{\if*dbl\e*fixtwc\fi   % end double column formatting
               \if*tpl\e*fixthc\fi   % end triple column formatting
               \global\output={\*mkpg} % set single column output
    }%  end multiple column formatting
\global\let\oc=\onecolumn
%
\catcode`*=12 \catcode`@=3