summaryrefslogtreecommitdiff
path: root/macros/text1/macros/fixcol.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/text1/macros/fixcol.tex')
-rw-r--r--macros/text1/macros/fixcol.tex155
1 files changed, 155 insertions, 0 deletions
diff --git a/macros/text1/macros/fixcol.tex b/macros/text1/macros/fixcol.tex
new file mode 100644
index 0000000000..02f3402583
--- /dev/null
+++ b/macros/text1/macros/fixcol.tex
@@ -0,0 +1,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