home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex31 / inputs.lzh / tugbot.sty < prev    next >
Text File  |  1987-09-23  |  44KB  |  1,121 lines

  1. %                       *****     TUGBOT86.STY    *****        8 Jul 87, bb
  2. %
  3. %       WARNING -- UNDER CONSTRUCTION
  4. %
  5. %       This file contains the TeX82 instructions for preparing a document
  6. %       in TUGboat format.  It is based on the TeX80 TUGboat format and on
  7. %       AMSPPT.STY (AMS-TeX82).  It is compatible with, but does not
  8. %       require (or load) AMS-TeX.  It assumes that PLAIN.TEX is preloaded.
  9. %
  10. %       This version differs in significant ways from the production version
  11. %       used at the AMS to generate the published TUGboat; particular
  12. %       features of the production version address idiosyncracies of the
  13. %       Alphatype CRS typesetter, used to prepare camera copy, which are not
  14. %       relevant to output prepared on, e.g., a laser printer.
  15. %
  16. %       Explicit registers:
  17. %               Counters:       0 = \pageno (PLAIN)
  18. %                               1 = \xcol -- column on page (values 1 or 2)
  19. %                               2 = \spoolno -- sequential segment count
  20. %               Files:          1 = page number xref definitions
  21.  
  22.  
  23. \def\makeatletter{\catcode`\@=11 }
  24. \chardef\other=12
  25. \def\makeatother{\catcode`\@=\other}
  26.  
  27. \makeatletter        % used, as in PLAIN, in protected control sequences
  28.  
  29. %      Stuff different from PLAIN, or reiterated for clarity
  30.  
  31. \def~{\penalty\@M \ } % tie -- this is PLAIN value; it is reset in AMS-TeX
  32.  
  33. \clubpenalty=10000
  34. \widowpenalty=10000
  35.  
  36. \normallineskiplimit=1pt
  37.  
  38. \newif\ifNoParIndent            \NoParIndentfalse
  39. \def \NoParIndent{\parindent=0pt \NoParIndenttrue}
  40.  
  41. \newdimen\normalparindent        \normalparindent=20pt          % plain = 20pt
  42. \def \NormalParIndent{\global\parindent=\normalparindent
  43.         \global\NoParIndentfalse}
  44. \NormalParIndent
  45.  
  46. %               set up auxiliary `page numbers'
  47. %               \pageno = \count0  as used in PLAIN
  48. \countdef\xcol=1        \xcol=1
  49. \countdef\spoolno=2     \spoolno=1
  50.  
  51. %       some things with the same names as in, or reiterated from, AMS-TeX
  52.  
  53. \def \BlackBoxes{\overfullrule=5pt }
  54. \def \NoBlackBoxes{\overfullrule=0pt }
  55. \def \document{}                % override an AMS-TeX convention
  56. \def \linebreak{\unskip\break}
  57. \def \newline{\hskip0pt plus\pagewd \break}
  58. %\let\brk=\linebreak            % TeX80 version
  59. %\let\lbrk=\newline             % TeX80 version
  60. \output{\output@}
  61.  
  62. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  63. %                                                                             %
  64. %               *****     utility registers and definitions     *****         %
  65. %                                                                             %
  66. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  67.  
  68.  
  69. %       test registers for transient use; paired - internal/external
  70. \newbox\T@stBox                 \newbox\TestBox
  71. \newcount\T@stCount             \newcount\TestCount
  72. \newdimen\T@stDimen             \newdimen\TestDimen
  73.  
  74.  
  75. %       \cs existence test, stolen from TeXbook exercise 7.7
  76. \def \ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
  77.  
  78.  
  79. %       Smashes repeated from AMS-TeX; PLAIN implements only full \smash .
  80. \newif\iftop@           \newif\ifbot@
  81. \def\topsmash{\top@true\bot@false\smash@}
  82. \def\botsmash{\top@false\bot@true\smash@}
  83. \def\smash{\top@true\bot@true\smash@}
  84. \def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
  85.         \else\let\next\makesm@sh\fi \next }
  86. \def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}
  87.  
  88.  
  89. %    Vertical `laps'; cf. \llap and \rlap
  90. \long\def\ulap#1{\vbox to \z@{\vss#1}}
  91. \long\def\dlap#1{\vbox to \z@{#1\vss}}
  92.  
  93. %    And centered horizontal and vertical `laps'
  94. \def\xlap#1{\hbox to \z@{\hss#1\hss}}
  95. \long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
  96. \long\def\zlap#1{\ylap{\xlap{#1}}}
  97.  
  98.  
  99. %       Avoid unwanted vertical glue when making up pages.
  100. \def \basezero{\baselineskip\z@ \lineskip\z@}
  101.  
  102.  
  103. %    Today's date, to be printed on drafts.  Based on TeXbook, p.406.
  104.  
  105. \def\today{\number\day\space \ifcase\month\or
  106.     Jan \or Feb \or Mar \or Apr \or May \or Jun \or
  107.     Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi
  108.     \number\year}
  109.  
  110. \newif\ifPrelimDraft        \PrelimDraftfalse
  111. \def\PrelimDraft{\PrelimDrafttrue
  112.     \def\midrtitle{\tensl preliminary draft, \today}}
  113.  
  114.  
  115. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  116. %                                                                             %
  117. %                       ***** fonts and friends *****                         %
  118. %                                                                             %
  119. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  120.  
  121.  
  122. %       Struts give ascenders and descenders to assist in baseline alignment
  123. %       (e.g. of adjoining vertical boxes); useful only with text fonts.
  124. %
  125. %       \strut is defined in PLAIN .  The structure of \strutt is equivalent.
  126.  
  127. \newbox\struttbox
  128. \def\strutt{\relax\ifmmode\copy\struttbox\else\unhcopy\struttbox\fi}
  129.  
  130. %       Struts are given the following dimensions for use in TUGboat:
  131. %
  132. %               \strut = height/depth of parenthesis in current font
  133. %                        (not the same as PLAIN)
  134. %               \strutt height + depth = \normalbaselineskip,
  135. %                        height = same as \strut
  136. %                        (equivalent to PLAIN \strut )
  137.  
  138.  
  139. %       The fonts below are sufficient for most ordinary TUGboat production.
  140. %       Additional titling fonts are defined elsewhere, and occasionally an
  141. %       extra font will be needed for a particular item (e.g. the device
  142. %       charts) and defined in that file.
  143.  
  144. %               all PLAIN CM fonts
  145.  
  146. \font\tenrm=cmr10
  147. \font\ninerm=cmr9
  148. \font\eightrm=cmr8
  149. \font\sevenrm=cmr7
  150. \font\sixrm=cmr6
  151. \font\fiverm=cmr5
  152.  
  153. \font\teni=cmmi10 \skewchar\teni='177
  154. \font\ninei=cmmi9 \skewchar\ninei='177
  155. \font\eighti=cmmi8 \skewchar\eighti='177
  156. \font\seveni=cmmi7 \skewchar\seveni='177
  157. \font\sixi=cmmi6 \skewchar\sixi='177
  158. \font\fivei=cmmi5 \skewchar\fivei='177
  159.  
  160. \font\tensy=cmsy10 \skewchar\tensy='60
  161. \font\ninesy=cmsy9 \skewchar\ninesy='60
  162. \font\eightsy=cmsy8 \skewchar\eightsy='60
  163. \font\sevensy=cmsy7 \skewchar\sevensy='60
  164. \font\sixsy=cmsy6 \skewchar\sixsy='60
  165. \font\fivesy=cmsy5 \skewchar\fivesy='60
  166.  
  167. \font\tenex=cmex10
  168.  
  169. \font\tenbf=cmbx10
  170. \font\ninebf=cmbx9
  171. \font\eightbf=cmbx8
  172. \font\sevenbf=cmbx7
  173. \font\sixbf=cmbx6
  174. \font\fivebf=cmbx5
  175.  
  176. \font\tentt=cmtt10
  177. \font\ninett=cmtt9
  178. \font\eighttt=cmtt8
  179.  
  180. \font\tensl=cmsl10
  181. \font\ninesl=cmsl9
  182. \font\eightsl=cmsl8
  183. %\font\sevensl=amsl7
  184. \let\sevensl=\eightsl                % for distribution
  185.  
  186. \font\tenit=cmti10
  187. \font\nineit=cmti9
  188. \font\eightit=cmti8
  189. \font\sevenit=cmti7
  190.  
  191. \font\tenupit=cmu10 
  192.  
  193. \font\tensmc=cmcsc10
  194.  
  195.  
  196. \font\tentex=cmtex10
  197.  
  198. \def \mit{\fam\@ne}
  199. \def \cal{\fam\tw@}
  200. \def \sy{\cal}          % old name
  201.  
  202. %               fonts added at AMS
  203.  
  204. % \font\eightex=amex8
  205.  
  206. % \newfam\cyrfam        % uncomment if needed
  207.  
  208. % \font\tencyr=mcyr10
  209. % \font\ninemcyr=mcyr9
  210. % \font\eightcyr=mcyr8
  211. % \font\sixcyr=mcyr6
  212.  
  213. %\font\ninesmc=amcsc9
  214. \let\ninesmc=\tensmc                    % temporary expedient
  215. %\font\eightsmc=amcsc8
  216. \let\eightsmc=\tensmc                   % temporary expedient
  217.  
  218. %\font \sixteenssb=amssbx16
  219. \font \sixteenssb=cmssbx10 scaled \magstep3    % for distribution
  220. %\font \twelvessb=amssbx12
  221. \font \twelvessb=cmssbx10 scaled \magstep1     % for distribution
  222. \font \tenssb=cmssbx10
  223. %\font \eightssb=amssbx8
  224.  
  225. %\font \seventphon=tphon7               % used in macro index and device list
  226.  
  227. \newfam\titlefam
  228. \def \titlefont{\textfont\titlefam=\sixteenssb
  229.     \scriptfont\titlefam=\twelvessb \scriptscriptfont\titlefam=\tenssb
  230.     \fam\titlefam \sixteenssb \baselineskip=16pt }
  231. %           Formerly \twelvessb and \eightssb
  232.  
  233.  
  234. %       Planned additions and changes:
  235. %
  236. %       Dynamic loading of fonts, probably in groups according to size
  237. %       Removal of \rm, \bf, etc., from \*point expansions, replacement
  238. %               by generic \rm, \bf, etc. definitions
  239. %       Mechanism for switching neatly between serif and sans-serif
  240.  
  241.  
  242. %       Allow text to be a bit stretchier than the built-in setting;
  243. %       TeXbook, page 433, 355
  244.  
  245. \newdimen\normaltenptstretch    \normaltenptstretch=1.6667pt
  246. \newdimen\extratenptstretch     \extratenptstretch=4pt
  247. \def\NormalTenPointSpacing{\fontdimen3\tenrm=\normaltenptstretch
  248.                 \fontdimen3\tenit=\normaltenptstretch}
  249. \def\StretchyTenPointSpacing{\fontdimen3\tenrm=\extratenptstretch
  250.                 \fontdimen3\tenit=\extratenptstretch}
  251.  
  252. \def \AddToTenPoint{}           % permit external additions to font
  253.  
  254. \def \tenpoint{\normalbaselineskip=12pt         % \def\pointsize@AmS{t}
  255.         \abovedisplayskip=3pt plus 3pt minus 1pt
  256.         \belowdisplayskip=3pt plus 3pt minus 1pt
  257.         \abovedisplayshortskip=0pt plus 3pt
  258.         \belowdisplayshortskip=1pt plus 3pt minus 1pt
  259.         \def\rm{\fam\z@\tenrm}%
  260.         \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  261.         \def\oldstyle{\fam\@ne\teni}%
  262.         \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
  263.         \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  264.         \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  265.         \def\it{\fam\itfam\tenit}%
  266.         \textfont\itfam=\tenit \scriptfont\itfam=\sevenit
  267.         \def\sl{\fam\slfam\tensl}%
  268.         \textfont\slfam=\tensl \scriptfont\slfam=\sevensl
  269.         \def\bf{\fam\bffam\tenbf}%
  270.         \textfont\bffam=\tenbf \scriptfont\bffam=\eightbf
  271.                 \scriptscriptfont\bffam=\sixbf
  272. %       \def\cyr{\fam\cyrfam\tencyr}%
  273. %       \textfont\cyrfam=\tencyr \scriptfont\cyrfam=\eightcyr
  274. %               \scriptscriptfont\cyrfam=\sixcyr
  275.         \def\smc{\tensmc}%
  276.         \def\tt{\tentt}%
  277.         \def\upright{\tenupit}%
  278.         \setbox\strutbox=\hbox{\vrule height7.5pt depth2.5pt width\z@}%
  279.         \setbox\struttbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}%
  280.         \normalbaselines \AddToTenPoint \rm }
  281.  
  282. \tenpoint                       % initialize -- default font
  283.  
  284.  
  285. \newdimen\normalnineptstretch   \normalnineptstretch=1.5pt
  286. \newdimen\extranineptstretch    \extranineptstretch=3.6pt
  287. \def\NormalNinePointSpacing{\fontdimen3\ninerm=\normalnineptstretch}
  288. \def\StretchyNinePointSpacing{\fontdimen3\ninerm=\extranineptstretch}
  289.  
  290. \def \AddToNinePoint{}
  291.  
  292. \def \ninepoint{\normalbaselineskip=11pt
  293.         \abovedisplayskip=2.5pt plus 2.5pt minus 1pt
  294.         \belowdisplayskip=2.5pt plus 2.5pt minus 1pt
  295.         \abovedisplayshortskip=0pt plus 2.5pt
  296.         \belowdisplayshortskip=1pt plus 2.5pt minus 1pt
  297.         \def\rm{\fam\z@\ninerm}%
  298.         \textfont0=\ninerm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  299.         \def\oldstyle{\fam\@ne\ninei}%
  300.         \textfont1=\ninei \scriptfont1=\seveni \scriptscriptfont1=\fivei
  301.         \textfont2=\ninesy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  302.         \def\it{\fam\itfam\nineit}%
  303.         \textfont\itfam=\nineit
  304.         \def\sl{\fam\slfam\ninesl}%
  305.         \textfont\slfam=\ninesl
  306.         \def\bf{\fam\bffam\ninebf}%
  307.         \textfont\bffam=\ninebf \scriptfont\bffam=\sevenbf
  308.                 \scriptscriptfont\bffam=\sixbf
  309. %       \def\cyr{\fam\cyrfam\ninmcyr}%
  310. %       \textfont\cyrfam=\ninmcyr \scriptfont\cyrfam=\sixcyr
  311. %               \scriptscriptfont\cyrfam=\sixcyr
  312.         \def\smc{\ninesmc}%
  313.         \def\tt{\ninett}%
  314.         \setbox\strutbox=\hbox{\vrule height 6.75pt depth 2.25pt width\z@}%
  315.         \setbox\struttbox=\hbox{\vrule height 7.25pt depth 2.75pt width\z@}%
  316.         \normalbaselines \AddToNinePoint \rm }
  317.  
  318. %               this is equivalent to baselineskip = 10pt
  319. %       \setbox\struttbox=\hbox{\vrule height 7.75pt depth 3.25pt width\z@}%
  320.  
  321.  
  322. \newdimen\normaleightptstretch  \normaleightptstretch=1.333pt
  323. \newdimen\extraeightptstretch   \extraeightptstretch=3pt
  324. \def\NormalEightPointSpacing{\fontdimen3\eightrm=\normaleightptstretch}
  325. \def\StretchyEightPointSpacing{\fontdimen3\eightrm=\extraeightptstretch}
  326.  
  327. \def \AddToEightPoint{}
  328.  
  329. \def \eightpoint{\normalbaselineskip=10pt
  330.         \abovedisplayskip=2pt plus 2pt minus 1pt
  331.         \belowdisplayskip=2pt plus 2pt minus 1pt
  332.         \abovedisplayshortskip=0pt plus 2pt
  333.         \belowdisplayshortskip=1pt plus 2pt minus 1pt
  334.         \def\rm{\fam\z@\eightrm}%
  335.         \textfont0=\eightrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  336.         \def\oldstyle{\fam\@ne\eighti}%
  337.         \textfont1=\eighti \scriptfont1=\sixi \scriptscriptfont1=\fivei
  338.         \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  339. %       \textfont3=\eightex \scriptfont3=\eightex \scriptscriptfont3=\eightex
  340.         \def\it{\fam\itfam\eightit}%
  341.         \textfont\itfam=\eightit
  342.         \def\sl{\fam\slfam\eightsl}%
  343.         \textfont\slfam=\eightsl
  344.         \def\bf{\fam\bffam\eightbf}%
  345.         \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
  346.                 \scriptscriptfont\bffam=\sixbf
  347. %       \def\cyr{\fam\cyrfam\eightcyr}%
  348. %       \textfont\cyrfam=\eightcyr \scriptfont\cyrfam=\sixcyr
  349. %               \scriptscriptfont\cyrfam=\sixcyr
  350.         \def\smc{\eightsmc}%
  351.         \def\tt{\eighttt}%
  352.         \setbox\strutbox=\hbox{\vrule height 6pt depth 2pt width\z@}%
  353.         \setbox\struttbox=\hbox{\vrule height 7pt depth 3pt width\z@}%
  354.         \normalbaselines \AddToEightPoint \rm }
  355.  
  356. %               this is equivalent to baselineskip = 9pt
  357. %       \setbox\struttbox=\hbox{\vrule height 6.5pt depth 2.5pt width\z@}%
  358.  
  359. %       PLAIN's definition of \raggedright doesn't permit any stretch, and
  360. %       results in too many overfull boxes.  Change.
  361. \newdimen\raggedskip            \raggedskip=\z@
  362. \newdimen\raggedstretch         \raggedstretch=5em
  363. \newskip\raggedparfill          \raggedparfill=\z@ plus 1fil
  364.  
  365. \def \raggedspaces{\spaceskip=.3333em \xspaceskip=.5em }
  366. %       Some applications may have to add stretch, in order to avoid
  367. %       all overfull boxes.
  368.  
  369. \def \raggedright{\rightskip=\raggedskip plus\raggedstretch \raggedspaces
  370.                 \parfillskip=\raggedparfill }
  371. \def \raggedleft{\leftskip=\raggedskip plus\raggedstretch \raggedspaces 
  372.                 \parfillskip=\z@ }
  373. \def \raggedcenter{\leftskip=\raggedskip plus\raggedstretch
  374.                 \rightskip=\leftskip \raggedspaces 
  375.                 \parindent=\z@ \parfillskip=\z@ }
  376.  
  377. \def \normalspaces{\spaceskip=.3333em plus.1667em minus.1111em
  378.                 \xspaceskip=.4444em plus.5em minus.037em }
  379.  
  380. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  381. %                                                                             %
  382. %                       *****   abbreviations   *****                         %
  383. %                                                                             %
  384. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  385.  
  386.  
  387. \def \careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
  388.                 /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
  389. \def \sfrac#1/#2{\leavevmode\kern.1em
  390.         \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em
  391.         /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
  392.  
  393. \def \d@sh#1{\nobreak\thinspace#1\penalty0\thinspace}
  394. \def \dash{\d@sh{--}}
  395. \def \Dash{\d@sh{---}}
  396.  
  397. %    Hack to permit automatic hyphenation after an actual hyphen.
  398.  
  399. \def\hyph{-\penalty0\hskip0pt\relax }
  400.  
  401. \def\slash{/\penalty0\hskip0pt}     % "breakable" slash
  402.  
  403. \def \TeX{\leavevmode\hbox{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX}}
  404. \def \TUG{\TeX\ \UG}
  405. \def \UG{Users Group}
  406. \def \TUB{TUGboat}
  407. \def \SC{Steering Committee}
  408. \def \AMS{American Mathematical Society}
  409. \def \POBox{P.\thinspace O.~Box }
  410. \def \POBoxTUG{\POBox\unskip~9506, Providence, RI~02940}
  411. \def \AMSTeX{\leavevmode\hbox{$\cal A\kern-.2em\lower.376ex
  412.         \hbox{$\cal M$}\kern-.2em\cal S$-\TeX}}
  413. \def \JoT{{\sl The Joy of \TeX}}
  414. %       note -- \LaTeX definition is from LATEX.TEX 2.08 of 27 Mar 85,
  415. %               adapted for additional flexibility in TUGboat
  416. %\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
  417. %    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  418. %\def \LaTeX{\leavevmode L\kern-.36em\raise.3ex\hbox{\smc a}\kern-.15em\TeX}
  419. \def \LaTeX{\TestCount=\the\fam \leavevmode L\raise.42ex
  420.     \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}\kern-.15em\TeX}
  421. %       Note -- The `official' \MF uses \font\manual=manfnt, which,
  422. %               although it is now in general distribution, may not be
  423. %               available to all users.
  424. \let\manual=\tenssb       % replace by manfnt if that is available
  425. %\font\manual=manfnt % font used for the METAFONT logo, etc.
  426. \def \MF{{\manual META}\-{\manual FONT}}
  427. \let\slMF=\MF
  428. %\def \slMF{{\manual 89:;}\-{\manual <=>:}} % slant the logo
  429. \def \mf{{\smc Metafont}}
  430. \def \Pas{Pascal}
  431. \def \UNIX{{\smc unix}}
  432. \def \VAX{\leavevmode\hbox{V\kern-.12em A\kern-.1em X}}
  433. \def \WEB{{\tt WEB}}
  434.  
  435. %    Miscellaneous useful stuff
  436.  
  437. \def\bull{\vrule height 1ex width .8ex depth -.2ex } % square bullet
  438.  
  439.  
  440. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  441. %                                                                             %
  442. %                       *****  page dimensions  *****                         %
  443. %                                                                             %
  444. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  445.  
  446.  
  447. \newdimen\trimlgt       \trimlgt=10.5in     % 11in
  448. \newdimen\headmargin    \headmargin=2.5pc    % 3.5pc
  449. \newdimen\pagelgt
  450. \newdimen\rheadlgt      \rheadlgt=2.5pc         %% + headmargin = 6pc = 1in
  451. \newdimen\toplgt        \toplgt=0pt
  452. \newdimen\normalcollgt  \normalcollgt=54pc      % 52pc for 5#2
  453. \newdimen\collgt        \collgt=\normalcollgt
  454. \newdimen\Collgt
  455. \maxdepth=2pt
  456. \newdimen\botlgt        \botlgt=0pt
  457. \newdimen\rfootlgt      \rfootlgt=2pc
  458.  
  459. \newif\ifThisIsFirstPage        \ThisIsFirstPagefalse
  460.  
  461. \def \resetpagelgt{\pagelgt=\collgt \Collgt=\collgt
  462.         \advance\pagelgt by \rheadlgt
  463.         \ifThisIsFirstPage \advance\Collgt by-\toplgt
  464.                         \advance\Collgt by-\botlgt \fi
  465.         \advance\pagelgt by \maxdepth
  466.         \global\advance\pagelgt by \rfootlgt
  467.         \global\vsize=\Collgt }
  468. \def \resetfpagelgt{\global\ThisIsFirstPagetrue
  469.         \resetpagelgt }                 % exclude special first page material
  470.  
  471. \resetpagelgt
  472. \raggedbottom
  473.  
  474. \newdimen\colwd
  475. \newdimen\pagewd        \pagewd=39pc
  476. \newdimen\trimwd        \trimwd=\pagewd
  477.  
  478. \def \onecol{\colwd=\pagewd             \OneCol }
  479.  
  480. \newdimen\onenarrowcolwd        \onenarrowcolwd=30pc
  481. \def \onenarrow{\colwd=\onenarrowcolwd  \OneCol }
  482.  
  483. %       before 5#2, `narrow' was 34pc
  484. \newdimen\onemediumcolwd        \onemediumcolwd=34pc
  485. \def \onemedium{\colwd=\onemediumcolwd  \OneCol }
  486.  
  487. \newdimen\twocolcolwd           \twocolcolwd=18.75pc
  488. \def \twocol{\colwd=\twocolcolwd        \TwoCol }
  489.  
  490. \newdimen\threecolcolwd         \threecolcolwd=12pc
  491. \def \threecol{\colwd=\threecolcolwd    \ThreeCol }
  492.  
  493.  
  494. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  495. %                                                                             %
  496. %                       *****      headers/footers      *****                 %
  497. %                                                                             %
  498. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  499.  
  500.  
  501. \def \midrtitle{}               % to allow for ``advertisements'' notice
  502.  
  503. \def \rtitlex{\TUB, \volx }
  504. \def \rtitle{\hbox to \pagewd{\tenrm
  505.         \rlap{\hbox to \pagewd{\hfil\midrtitle\hfil}}%
  506.         \ifodd\pageno \rtitlex\hfil\number\pageno
  507.         \else \number\pageno\hfil\rtitlex \fi }}
  508.  
  509. \def \runhead{\vbox to \rheadlgt{\topskip=1pc \rtitle \vfil }}
  510. \def \runfoot{\vbox to \rfootlgt{\topskip=1.5pc
  511.         \ifnum\xcol=2 \hbox to \pagewd{\midrtitle\hfil\midrtitle}\fi
  512.         \vfil }}
  513.  
  514. \def \resetfirsthead{\global\toplgt=\z@ \gdef\firsthead{}}
  515. \resetfirsthead
  516. \newbox\firsth@@d       \newbox\firsth@ad
  517. \def \setfirsthead{\global\ThisIsFirstPagetrue
  518.     \def\endset{\egroup        % finish \T@stBox
  519.             \ifdim \toplgt=\z@ \global\toplgt=\ht\T@stBox \resetpagelgt \fi
  520. %                       assume that \firsth@ad ends with glue, hence no \dp
  521.                 \global\setbox\firsth@ad=\vbox to \toplgt{\box\T@stBox \vfil}%
  522.             \global\setbox\firsth@@d=\vbox to \toplgt{\vfil}%
  523.             \gdef\firsthead{\ifnum \xcol=2 \box\firsth@ad
  524.                             \else \copy\firsth@@d \fi }}%
  525.     \setbox\T@stBox=\vbox\bgroup \hsize=\pagewd }
  526.  
  527.  
  528. \def \resetfirstfoot{\global\botlgt=\z@ \gdef\firstfoot{}}
  529. \resetfirstfoot
  530. \newbox\firstf@@t       \newbox\firstf@ot
  531. \def \setfirstfoot{\global\ThisIsFirstPagetrue
  532.     \def\endset{\egroup        % finish \T@stBox
  533.             \ifdim \botlgt=\z@ \botlgt=\ht\T@stBox
  534.             \global\advance\botlgt by \dp\T@stBox \resetpagelgt
  535.         \fi
  536.                 \global\setbox\firstf@ot=\vbox to \botlgt{\box\T@stBox \vfil}%
  537.             \global\setbox\firstf@@t=\vbox to \botlgt{\vfil}%
  538.             \gdef\firstfoot{\ifnum \xcol=2 \copy\firstf@ot
  539.                             \else \copy\firstf@@t \fi }}%
  540.     \setbox\T@stBox=\vbox\bgroup \hsize=\pagewd }
  541.  
  542.  
  543. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  544. %                                                                             %
  545. %                       *****       output      *****                         %
  546. %                                                                             %
  547. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  548.  
  549.  
  550. %       In the absence of automatic column-balancing, provide a mechanism
  551. %       for manually shortening a specified page.
  552.  
  553. \newif\ifSh@rtPage              \Sh@rtPagefalse
  554. \newif\ifSh@rtPagePending       \Sh@rtPagePendingfalse
  555. \newcount\Sh@rtPageNo
  556. \newdimen\Sh@rtPageLgt
  557.  
  558. \def\@to{to}                    \def\@by{by}
  559. %       #1 = to/by; #2 = \dimen; #3 = <dimen>; #4 = * of Shorten*Page
  560. \def\@toby#1#2#3#4{\def\@tb{#1}%
  561.         \ifx \@tb\@to \global #2=#3
  562.         \else \ifx \@tb\@by \T@stDimen=#3         % accommodate negative #3
  563.                         #2=\normalcollgt \global\advance #2 by -#3
  564.                 \else \errmessage{#1 is invalid syntax; \string\Shorten#4Page
  565.                                 requires "to" or "by"}\fi
  566.         \fi }
  567.  
  568. \def\@plusno#1#2;{\if +#1\T@stCount=\pageno \advance\T@stCount by #2
  569.                         \else \T@stCount=#1#2 \fi }
  570.  
  571. \def \ShortenPage #1 #2 #3. {\global\Sh@rtPagePendingtrue
  572. %               \global\Sh@rtPageNo=#1
  573.                 \@plusno#1;\global\Sh@rtPageNo=\T@stCount
  574.                 \@toby{#2}{\Sh@rtPageLgt}{#3}{}}
  575. \def \ShortenThisPage #1 #2. {\global\Sh@rtPagetrue
  576.                 \@toby{#1}{\vsize}{#2}{This}}
  577.  
  578. %       Two cases: 0 = last page was nonstandard; reset \vsize
  579. %                  1 = do not reset \vsize: okay or length already reset
  580. \def \D@EndPage{\global\advancepageno
  581.         \T@stCount=1
  582.         \ifThisIsFirstPage \T@stCount=0 \global\ThisIsFirstPagefalse
  583.                         \resetfirsthead \resetfirstfoot
  584.                         \global\collgt=\normalcollgt \fi
  585.         \ifSh@rtPage \T@stCount=0 \global\Sh@rtPagefalse \fi
  586.         \ifSh@rtPagePending
  587.                 \ifnum\pageno = \Sh@rtPageNo \T@stCount=1
  588.                         \global\vsize=\Sh@rtPageLgt
  589.                         \global\Sh@rtPagePendingfalse
  590.                         \global\Sh@rtPagetrue \fi
  591.         \fi
  592.         \ifcase \T@stCount \resetpagelgt \fi }
  593.  
  594.  
  595. %       Distinguish between laser printer output (for proofing and other
  596. %       general use) and production, which uses a phototypesetter.
  597.  
  598. \newif\ifLaser                  \Lasertrue
  599.  
  600.  
  601. %       Registration marks
  602.  
  603. \def \HorzR@gisterRule{\vrule height 0.2pt depth 0pt width 0.5in }
  604. \def \DownShortR@gisterRule{\vrule height 0.2pt depth 1pc width 0.2pt }
  605. \def \UpShortR@gisterRule{\vrule height 1pc depth 0pt width 0.2pt }
  606.  
  607.  
  608. %               ``T'' marks centered on top and bottom edges of paper
  609.  
  610. \def \ttopregister{\dlap{%
  611.         \hbox to \trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
  612.                         \HorzR@gisterRule \hfil \HorzR@gisterRule}%
  613.         \hbox to \trimwd{\hfil \DownShortR@gisterRule \hfil}}}
  614. \def \tbotregister{\ulap{%
  615.         \hbox to \trimwd{\hfil \UpShortR@gisterRule \hfil}%
  616.         \hbox to \trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
  617.                         \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
  618.  
  619. \def \topregister{\ttopregister}
  620. \def \botregister{\tbotregister}
  621.  
  622.  
  623. %       All pages containing data are formatted by \midpage
  624.  
  625. \def \midpage#1{\vbox{\basezero
  626.         \ifLaser \hrule height\z@ depth\z@ width\p@
  627.                 \vskip-\rheadlgt
  628.         \else \vbox to \trimlgt \bgroup
  629.                 \topregister
  630.                 \vskip \headmargin
  631.         \fi
  632.         \vbox to \pagelgt{\basezero
  633.                 \ifnum\xcol=2 \runhead
  634.                 \else \vbox to \rheadlgt{}\fi
  635.                 \ifThisIsFirstPage \firsthead \fi
  636.                 \hbox to \pagewd{#1}%   % \vsize applied in \pagebody
  637.                 \ifThisIsFirstPage \firstfoot \fi
  638.                 \vfil           % if no depth, avoid underfull box
  639.                 \runfoot }%
  640.         \ifLaser \else \vfill \botregister \egroup \fi}%
  641.         \ifnum\xcol=2 \global\xcol=1 \D@EndPage
  642.         \else \global\xcol=2 \fi
  643.         \global\advance\spoolno by 1 }
  644.  
  645. %       The production version includes trim marks, which are required
  646. %       on photographic paper, but are unsuitable for laser printer output.
  647. %       The production version also generates 2 separate .dvi pages for each
  648. %       logical page; these are overlaid photographically, and allow the
  649. %       Alphatype to run more efficiently on 2-column pages.
  650. %       For laser printer output, each page is output as a unit.
  651.  
  652.  
  653. %       Reorganize \pagecontents from PLAIN to put footnotes at very
  654. %       bottom of page, even if \raggedbottom.
  655.  
  656. \def\pagecontents{\ifvoid\topins\else\unvbox\topins\fi
  657.   \dimen@=\dp\@cclv \unvbox\@cclv % open up \box255
  658.   \ifr@ggedbottom \kern-\dimen@ \vfil \fi
  659.   \ifvoid\footins\else % footnote info is present
  660.     \vskip\skip\footins
  661.     \footnoterule
  662.     \unvbox\footins\fi }
  663.  
  664.  
  665. \def \newcol{\par\vfill\eject}
  666.  
  667. \newif\ifOneColFormat
  668. \newbox\SaveP@geBox
  669.  
  670. \def \OneCol{\hsize=\colwd
  671.         \gdef\newpage{\par\vfill\eject}%
  672.         \OneColFormattrue
  673.         \gdef\output@{%
  674.                 \ifLaser \xcol=2 \shipout\midpage{\hfil\pagebody \hfil}%
  675.                 \else \shipout\midpage{\hfil\pagebody \hfil}%
  676.                         \shipout\vbox to \trimlgt{\basezero
  677.                                 \topregister
  678.                                 \vskip\headmargin
  679.                                 \vbox to \pagelgt{\basezero
  680.                                         \runhead
  681.                                         \vfill }%
  682.                                 \vfill
  683.                                 \botregister }%
  684.                         \D@EndPage
  685.                         \global\xcol=1
  686.             \global\advance\spoolno by 1
  687.                 \fi }}
  688.  
  689. \def \TwoCol{\hsize=\colwd
  690.         \gdef\newpage{\par\vfill\eject
  691.                         \ifnum\xcol=2 \null\vfill\eject \fi }%
  692.         \OneColFormatfalse
  693.         \gdef\output@{% % use PLAIN's \pagebody instead of \box255
  694.                 \ifnum\xcol=1
  695.                         \ifLaser \global\setbox\SaveP@geBox=\vbox{\pagebody}%
  696.                                 \global\xcol=2
  697.                         \else \shipout\midpage{\pagebody \hfil}\fi
  698.                 \else \shipout\midpage{\ifLaser \box\SaveP@geBox \fi
  699.                                 \hfil\pagebody }\fi
  700.                 \ifnum\outputpenalty>-\@MM \else \dosupereject \fi }}
  701.  
  702.  
  703. %    Three-column format is a hack.  Collect all column data and
  704. %    ship it out in the third segment, but conform to the \midpage
  705. %    convention that \xcol can never be greater than 2.
  706.  
  707. \newbox\SaveP@geTwoBox
  708.  
  709. \def \ThreeCol{\hsize=\colwd
  710.         \gdef\newpage{\par\vfill\eject
  711.         \loop \ifnum\xcol>1 \advance\xcol by 1
  712.                         \hbox to \hsize{\hfill}\vfill\eject \repeat }%
  713.         \OneColFormatfalse
  714.         \gdef\output@{% % use PLAIN's \pagebody instead of \box255
  715.                 \ifnum\xcol=1
  716.                         \global\setbox\SaveP@geBox=\vbox{\pagebody}%
  717.                                 \global\xcol=2
  718.                 \else \ifnum\xcol=2
  719.                         \global\setbox\SaveP@geTwoBox=\vbox{\pagebody}%
  720.                                 \global\xcol=3
  721.             \else \ifLaser
  722.                 \else \xcol=1 \shipout\midpage
  723.                     {\vbox to \vsize{\null\vfill}}\fi
  724.                 \xcol=2
  725.                 \shipout\midpage{\box\SaveP@geBox 
  726.                                     \hfil \box\SaveP@geTwoBox
  727.                     \hfil \pagebody }\fi
  728.         \fi
  729.                 \ifnum\outputpenalty>-\@MM \else \dosupereject \fi }}
  730.  
  731.  
  732. %       Dates and other items which identify the volume and issue
  733.  
  734. %       To use: \vol 5, 2.
  735. %               \issdate October 1984.
  736. %               \issueseqno=10
  737. %       For production, these are set in a separate file, TUGBOT.DATES,
  738. %       which is issue-specific.
  739.  
  740. \def \v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
  741. \def \volyr{}
  742. \def \volno{}
  743. \def \vol #1,#2.{\gdef\volno{#1\unskip}%
  744.         \gdef\issno{\ignorespaces#2\unskip}%
  745.         \setbox\TestBox=\hbox{\volyr}%
  746.         \ifdim \wd\TestBox > .2em \v@lx \fi }
  747.  
  748. \def \issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
  749.         \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
  750.         \setbox\TestBox=\hbox{\volno}%
  751.         \ifdim \wd\TestBox > .2em \v@lx \fi }
  752.  
  753.  
  754. %       TUGboat conventions include the issue number in the file name.
  755. %       Permit this to be incorporated into file names automatically.
  756. %       If issue number = 11, \Input filnam  will read tb11filnam.tex.
  757.  
  758. \newcount\issueseqno            \issueseqno=-1
  759.  
  760. \def \Input #1 {\ifnum\issueseqno<0 \def\infil@{#1}%
  761.                 \else \def\infil@{tb\number\issueseqno#1}\fi
  762.                 \input \infil@ }
  763.  
  764.  
  765. %       Write out (both to a file and to the log) the starting page number
  766. %       of an article, to be used for cross references and in contents.
  767. %       \pagexref  is used for articles fully processed in the TUGboat run.
  768. %       \PageXref  is used for "extra" pages, where an item is submitted
  769. %               as camera copy, and only running heads (at most) are run.
  770. \def \pagexref#1{\ifFirstPar \nobreak \fi  % don't clobber switch by accident
  771.         \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
  772.         \write1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
  773.         \ifFirstPar \nobreak \fi }      % and don't allow page break
  774. \def \PageXref#1{%
  775.         \immediate\write-1{\def\expandafter
  776.                         \noexpand\csname#1\endcsname{\number\pageno}}%
  777.         \immediate\write1{\def\expandafter
  778.                         \noexpand\csname#1\endcsname{\number\pageno}}}
  779.  
  780.  
  781. %       Section titles and separators
  782.  
  783. \newskip\Tabskss
  784. \Tabskss=0pt plus 1000pt minus 1000pt
  785. \newskip\AboveTitleSkip  \AboveTitleSkip=12pt   % 10pt plus 2pt minus 2pt
  786. \newskip\BelowTitleSkip  \BelowTitleSkip=8pt    % plus 1pt minus 1pt
  787.  
  788. \setbox\T@stBox=\hbox{\titlefont O}
  789. \newdimen\stfontheight          \stfontheight=\ht\T@stBox
  790. \newdimen\strulethickness       \strulethickness=.6pt
  791. \newcount\n@stnum               \n@stnum=0
  792. \def \sthrule{\hrule height\strulethickness depth 0pt }
  793. \def \stvrule{\vrule height 2\stfontheight depth\stfontheight
  794.                         width\strulethickness }
  795. \def \sectitlebox #1<{\vbox{\sthrule
  796.         \hbox to \hsize{\stvrule\hfil #1\hfil\vrule width\strulethickness }%
  797.         \sthrule }}
  798.  
  799. \def \secsep{\vskip 5\baselineskip}
  800.  
  801. \newif\ifSecTitle
  802. \SecTitlefalse
  803. %\def \sectitle #1<{\par \SecTitletrue
  804. %       \penalty-1000\secsep
  805. %       \centerline{\sectitlebox \titlefont #1<}%
  806. %       \nobreak \vskip\baselineskip }
  807.  
  808. \def \sectitle #1<{\par \SecTitletrue
  809.         \penalty-1000\secsep
  810.         \n@stnum=0
  811.         {\def\\{ }\setbox\T@stBox=\hbox{\titlefont#1}%
  812.         \ifdim\wd\T@stBox < \hsize \def\result{\unhbox\T@stBox}%
  813.         \else \def\\{\cr\noalign{\global\advance\n@stnum by 1 }}%
  814.                 \setbox\T@stBox=\vbox{\titlefont
  815.                         \halign{\hfil##\hfil\cr#1\crcr}}%
  816.                 \def\result{\vbox{\unvbox\T@stBox}}\fi
  817.         \ifnum\n@stnum=1 \def\stvrule{\vrule height 3.5\stfontheight
  818.                         depth\stfontheight width\strulethickness }\fi
  819.         \centerline{\sectitlebox \titlefont\result<}}%
  820.         \nobreak \vskip\baselineskip }
  821.  
  822. %\def \secsep{\vskip\baselineskip       %  * * *  as for TUGboat pre 5#2
  823. %       \centerline{\hbox to 180pt{%
  824. %               \leaders\hbox to 15pt{\hfil\char'052\hfil}\hfill}}%
  825. %       \vskip2\baselineskip }
  826.  
  827. \def \littlesep{\vskip 3pt plus 1pt minus 1pt
  828.         \centerline{\hbox to 90pt{\ignorespaces
  829.                 \leaders\hbox to 10pt{\hfil .\hfil}\hfill} }%
  830.         \vskip 3pt plus 1pt minus 1pt}
  831.  
  832.  
  833. %       Titles, authors, subtitles, and first-paragraph formatting
  834.  
  835. \newif\ifFirstPar       \FirstParfalse
  836. \def\SetupFirstPar{\global\parindent=0pt \global\FirstPartrue }
  837.  
  838. %               make the first paragraph after a title start flush left,
  839. %               then reset \parindent; but if all paragraphs should start
  840. %               flush left, then don't reset.
  841. \everypar{\ifNoParIndent
  842.         \else \ifFirstPar \NormalParIndent \global\FirstParfalse \fi
  843.         \fi }
  844.  
  845. %       For uppercasing title and author; from AMSPPT.STY, version 0
  846.  
  847. \def\uctext@#1{\uppercase@#1\gdef\uppercase@@{}$\m@th$}
  848. \def\uppercase@#1$#2${\gdef\uppercase@@{\uppercase@}\uppercase
  849.     {#1}${#2}$\uppercase@@}
  850.  
  851.  
  852. \newif\ifCtrTitle       \CtrTitlefalse
  853. \def \TitleUC{}                 % ordinary titles uc/lc
  854. \def \titleframe #1#2#3{\ifSecTitle \SecTitlefalse
  855.         \else \vskip\AboveTitleSkip \fi
  856.         \ifCtrTitle \def\CTSkip{\unskip\hfil}\CtrTitlefalse
  857.         \else \def\CTSkip{}\fi
  858.         \vbox{#1\halign{\hbox to \hsize
  859.                 {\bf\TitleUC{\CTSkip\ignorespaces##\unskip\hfil}}\strutt\cr
  860.                         #2\crcr}}%
  861.         \let\oldcr=\cr\def\cr{}%
  862.         \setbox\T@stBox=\hbox{#3}%
  863.         \let\cr=\oldcr
  864.         \ifdim \wd\T@stBox < 5pt                % omit if author is null
  865.         \else \nobreak \vskip 4pt       % 4pt + \BelowTitleSkip = \baselineskip
  866.                 \vbox{\halign{\hbox to \hsize
  867.                         {\hskip\parindent\CTSkip\ignorespaces##\hfil}\cr
  868.                                 #3\crcr}}\fi
  869.         \setbox\T@stBox=\hbox{}%
  870.         \nobreak \vskip\BelowTitleSkip \SetupFirstPar }
  871.  
  872. \def \title #1\\#2\endx{\titleframe{}{#1}{#2}}
  873. \def \Title #1\\#2\endx{\titleframe{\def\TitleUC{\uctext@}}{#1}{#2}}
  874.  
  875. \def \ctrtitle #1\\#2\endx{\CtrTitletrue\titleframe{}{#1}{#2}}
  876. \def \ctrTitle #1\\#2\endx{\CtrTitletrue
  877.         \titleframe{\def\TitleUC{\uctext@}}{#1}{#2}}
  878.  
  879. %       \subtitle and \subsubtitle are used in the announcements box
  880.  
  881. \def \subtitle #1\endx{{\CtrTitletrue           % \AboveTitleSkip=10pt
  882.         \titleframe{}{#1}{}}}
  883.  
  884. \def \subsubtitle #1\endx{{\CtrTitletrue
  885.         \ifFirstPar \AboveTitleSkip=0pt \fi     % \else \AboveTitleSkip=10pt
  886.         \titleframe{}{\sl#1}{}}}
  887.  
  888. %       \section  was first defined for Jacques Desarmenien's article in 5#2
  889. \def \section #1 #2\par{\ifFirstPar \nobreak
  890.         \else \penalty-200 \vskip 8pt \fi
  891.         \noindent{\bf\hbox to \normalparindent{#1\hfil}#2}\endgraf
  892.         \nobreak \vskip 4pt \SetupFirstPar }
  893.  
  894. %       This is based on \beginsection in PLAIN and \section above.
  895. \outer\def\beginsection#1\par{\ifFirstPar \nobreak
  896.         \else \vskip\z@ plus 4\baselineskip \penalty-100
  897.                 \vskip\z@ plus-4\baselineskip \vskip 8pt \vskip\parskip \fi
  898.         \message{#1}{\raggedright\noindent\bf#1\endgraf}\nobreak \vskip 4pt
  899.         \SetupFirstPar }
  900.  
  901.  
  902. %       Define address blocks and other structures that use \obeylines
  903. %       in the context  \tag ...<
  904. %       This requires that < be active, so that \obeylines is invoked
  905. %       at the outer level.  \tag{...} will not deliver the data with
  906. %       ^M (carriage return) intact, so is not a suitable format for
  907. %       any construction using \obeylines; the reference (if any) in
  908. %       The TeXbook has not been found, and this information has been
  909. %       determined empirically, referring to \obeylines constructions
  910. %       in PLAIN and MANMAC.TeX (The TeXbook macros).
  911. {\catcode`\^^M=\active % these lines must end with %
  912.   \gdef\obeylinesblock{\catcode`\^^M\active \let^^M\par\nobreak}}
  913.  
  914. {\catcode`\<=\active \obeylines
  915. \gdef\AddrFrame#1#2{\endgraf\def\Phone{\leavevmode\kern\parindent}%
  916.         \catcode`\<=\active %
  917. %               next line intentionally ends with <cr> %
  918.         \def<{
  919.               \egroup\allowbreak\catcode`\<=12 #2 }\bgroup #1\obeylinesblock }%
  920. \gdef\LetterAddr{\AddrFrame{\penalty9999\smallskip}{}}%
  921. \gdef\TextAddr{\AddrFrame{\penalty9999}{}}%
  922. \gdef\Submitted{\AddrFrame{\nobreak\smallskip \parindent=1.5\normalparindent %
  923.                 \def\Signed{\parfillskip=\normalparindent \qquad\hfil }}{}}%
  924. \gdef\Columnist{\AddrFrame{\nobreak\FirstParfalse %
  925.                 \def\NetAddr{\smallskip \indent\indent }%
  926.                 \def\Phone{\NetAddr }}%
  927.     {\nobreak \vskip\BelowTitleSkip \SetupFirstPar }\sl }%
  928. }
  929.  
  930.  
  931. %       Support verbatim listing of TeX source, as defined in TeXbook, p. 421;
  932. %       lifted from MANMAC.TEX, and modified slightly for narrower columns.
  933. %
  934. %    Although | is ordinarily an escape character within verbatim mode,
  935. %    provide a method for letting it instead be the character itself
  936. %    within a display verbatim listing, as needed; this is based on
  937. %    a technique developed by Michael Ferguson.  Note that within one
  938. %    \begintt...\endtt block, | can be only one of:
  939. %        the printing | character, or
  940. %        active (the escape character)
  941. %    It cannot perform both functions at the same time.
  942.  
  943. \def\ttverbatim{\begingroup \catcode`\\=\other
  944.   \catcode`\{=\other \catcode`\}=\other \catcode`\$=\other
  945.   \catcode`\&=\other \catcode`\#=\other \catcode`\%=\other
  946.   \catcode`\~=\other \catcode`\_=\other \catcode`\^=\other
  947.   \catcode`\"=\other
  948.   \obeyspaces \obeylines \hyphenpenalty=10000 \tt}
  949.  
  950. \newskip\ttglue
  951. {\tenpoint\tt \global\ttglue=.5em plus .25em minus .15em}
  952. % this should be installed in each font
  953.  
  954. %       From David Eppstein's ``Trees'' paper (6#1), preserve initial spaces.
  955. {\obeyspaces\gdef {\ifvmode\indent\fi\space}}
  956.  
  957. \newdimen\ttrightskip
  958. \ttrightskip=5pc
  959.    
  960. \newif\ifttVertChar    \ttVertCharfalse
  961. {\catcode`\|=\active \gdef\VertChar{\def|{\char"7C }}}
  962.  
  963. \outer\def\begintt{$$\def\par{\leavevmode\null\endgraf}\ttverbatim \parskip=\z@
  964.   \ifttVertChar \VertChar \global\ttVertCharfalse \else \catcode`\|=0 \fi
  965.   \frenchspacing \rightskip=-\ttrightskip \ttfinish}
  966. {\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
  967.   |obeylines % end of line is active
  968.   |gdef|ttfinish#1^^M#2\endtt{#1|vbox{#2}|endgroup$$}}
  969.  
  970. %       Other non-tt elements that may be embedded within \begintt...\endtt .
  971. \def\MTH{$}
  972. \def\sb{_}
  973. \def\sp{^}
  974. \def\SP{{\tt\char"20 }}        % "visible" space
  975. \chardef\bs=`\\
  976. \def\vrt{{\tt\char`\|}}
  977.  
  978. \catcode`\|=\active
  979. %{\obeylines \gdef|{\ttverbatim \spaceskip\ttglue \let^^M=\  \let|=\endgroup}}
  980. {\obeylines \gdef\activatettbar{\global\catcode`\|=\active %
  981.   \gdef|{\ttverbatim \spaceskip\ttglue \xspaceskip\ttglue %
  982.          \let^^M=\  \let|=\endgroup}}}
  983. \activatettbar
  984.  
  985. %    The active | (which here implements verbatim mode) is redefined in
  986. %    such headers as TABLES.TeX and must be able to be reinstated.
  987. %    \activatettbar has been tested with TABLES.TeX, and the two uses
  988. %    are mutually operable (TUGboat 7#2, "Tables in INRSTeX").
  989.  
  990. %       Define a structure that will permit a list (using \obeylines)
  991. %       to be made into 2 columns, split by \vsplit, indented the
  992. %       normal \parindent
  993.  
  994. \def \NormalizeBlockHeight{\TestCount=1                         % \@ne
  995.         \TestDimen=\dimen0 \advance\TestDimen by-\topskip
  996.         \CutOneLine }
  997. \def \CutOneLine{\advance\TestCount by 1 \advance\TestDimen by-\baselineskip
  998.         \ifdim\TestDimen < \baselineskip                        % \@ne
  999.                 \def\result{\TestDimen=\baselineskip
  1000.                         \multiply\TestDimen by \TestCount
  1001.                         \advance\TestDimen by \topskip
  1002.                         \global\dimen0=\TestDimen }%
  1003.         \else \def\result{\CutOneLine }\fi \result }
  1004.  
  1005. \def \twosplit{{\topskip=\baselineskip \splittopskip=\topskip
  1006.         \setbox0=\copy\TestBox
  1007.         \dimen0=\ht\TestBox
  1008.         \NormalizeBlockHeight
  1009.         \divide\dimen0 by 2
  1010.         \setbox\LeftHalf=\vsplit\TestBox to \dimen0
  1011.         \ifdim\ht\TestBox > \ht\LeftHalf
  1012.                 \advance\dimen0 by \baselineskip
  1013.                 \setbox\TestBox=\copy0
  1014.                 \setbox\LeftHalf=\vsplit\TestBox to \dimen0
  1015.         \fi
  1016.         \line{\kern\parindent\valign{##\vfil\cr
  1017.                 \unvbox\LeftHalf\cr\noalign{\hfil}\unvbox\TestBox\cr}}}%
  1018.         \global\setbox0=\null}
  1019.  
  1020. \newbox\LeftHalf
  1021. \newdimen\HalfWd
  1022. \HalfWd=\twocolcolwd
  1023. \advance\HalfWd by-\normalparindent
  1024. \divide\HalfWd by 2
  1025.  
  1026. {\obeylines
  1027. \gdef\twouplist #1{\topskip=\baselineskip \splittopskip=\topskip %
  1028.         \begingroup \parindent=0pt \obeylines
  1029. %                       next line ends with intentional <cr>
  1030.         \def\endtwouplist{
  1031.                         \egroup %               % end of \vbox
  1032.                         \endgroup %             % end of \obeylines group
  1033.                         \twosplit }%
  1034.         \global\setbox\TestBox=\vbox\bgroup\hsize=\HalfWd %
  1035.                 \indent\vrule height\topskip width 0pt #1}%
  1036. }
  1037.  
  1038.  
  1039. %       Tags for special formatting of editor's notes, meeting
  1040. %       attendees lists, etc.
  1041.  
  1042. \def \Editor{\noindent To the Editor:\par}
  1043. \def \xEdNote{{\tenupit Editor's note:\enspace }}
  1044. \def \EdNote #1{\if #1[\unskip\hskip1em [\thinspace\xEdNote\ignorespaces
  1045.         \else \ifFirstPar \else \medskip\noindent \fi
  1046.                 \xEdNote #1\fi }
  1047.  
  1048. \def \Attendee #1 {\par \noindent\hangindent 2\normalparindent
  1049.         \hbox to .5\normalparindent{\hfil #1\thinspace}\ignorespaces}
  1050.  
  1051. \def \Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
  1052.  
  1053.  
  1054. %       Footnotes are mainly supported by PLAIN format, with these
  1055. %       exceptions.
  1056.  
  1057. \skip\footins=12pt              % full blank line       % 24pt  
  1058. \def\footnoterule{\kern-8pt
  1059.         \hrule width 5pc \kern 7.6pt } % the \hrule is .4pt high
  1060.  
  1061. \newif\ifDelayFirstPar        \DelayFirstParfalse
  1062. \def\vfootnote#1{\ifFirstPar \DelayFirstPartrue \fi
  1063.   \insert\footins\bgroup
  1064.   \interlinepenalty\interfootnotelinepenalty
  1065.   \splittopskip\ht\strutbox % top baseline for broken footnotes
  1066.   \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  1067.   \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  1068.   \parindent=\normalparindent % always indent footnotes; added for TUGboat
  1069.   \textindent{#1}\footstrut\futurelet\next\fo@t}
  1070. \def\@foot{\strut\egroup
  1071.     \ifDelayFirstPar \SetupFirstPar    \global\DelayFirstParfalse \fi }
  1072.  
  1073.  
  1074. %       Draw a box around a whole page, e.g. announcements page;
  1075. %       format must be \onenarrow or \onemedium, and start on a new page.
  1076.  
  1077. \def \bigbox{\hrule \hbox\bgroup \vrule\kern 1pc
  1078.         \vbox\bgroup \vskip 1pc }
  1079. \def \endbox{\endgraf \vskip 1pc \egroup \kern 1pc\vrule \egroup \hrule }
  1080.  
  1081.  
  1082. %       Macros to produce extra running heads for stripping onto pages
  1083. %       received as camera copy.  Format must be preset to \OneCol, and
  1084. %       start on a new page.
  1085.  
  1086. %       Generate 5 (4 + normal running head) per page.
  1087.  
  1088. \def \DrawT@pLines{\vskip\topskip
  1089.         \ulap{\line{\raise 1ex\rlap{\leaders\hrule\hskip\pagewd}%
  1090.                         \leaders\hrule\hfill}}\medskip}
  1091.  
  1092. \def \r@nhead{\vbox to .23\vsize{\basezero \hsize=\pagewd \vfil
  1093.         \topregister \vskip\headmargin \runhead \DrawT@pLines }\medskip
  1094.         \advancepageno }
  1095.  
  1096. \def \nextrunner{%
  1097.     \ifnum\T@stCount>0
  1098.         \ifnum\T@stCount>5 \TestCount=5 \else\TestCount=\T@stCount \fi
  1099.         \advance\T@stCount by-\TestCount
  1100.         \DrawT@pLines        % always one at top of page
  1101.         \loop\ifnum\TestCount>1 \r@nhead \advance\TestCount by\m@ne
  1102.             \repeat \newpage
  1103.         \nextrunner
  1104.     \fi }
  1105.  
  1106. \def \ExtraRunheads #1, #2.{\T@stCount=#1
  1107.         \gdef\pageprefix{#2}%   % as in A-10 for appendices; not used just now
  1108.     \nextrunner }
  1109.  
  1110.  
  1111. \catcode`\@=12
  1112. %               @ is prohibited in AMS-TeX, but should not be in TUGboat
  1113.  
  1114. %       some hyphenation exceptions:
  1115. \hyphenation{man-u-script man-u-scripts}
  1116.  
  1117. \endinput
  1118.  
  1119. \tracingonline=1
  1120. \showbox255
  1121.