The tugboat package^{∗}

edited by Sebastian Rahtz

                           spqr@tex.ac.uk

and Robin Fairbairns

                           rf@cl.cam.ac.uk

with contributions by Barbara Beeton

                             bnb@ams.org

1997/05/05

Contents

1 Document preambles 2

2 Introduction 2 2.1 Summary of control sequences . . . . . . . . . . . . . . . . . . . . . 3

3 L^{A}TEX 2ε TUGboat class file 6 3.1 Setup and options . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.2 Helpful shorthand (common code with Plain styles) . . . . . . . . . 8 3.3 Abbreviations and logos . . . . . . . . . . . . . . . . . . . . . . . . 9 3.4 General typesetting rules . . . . . . . . . . . . . . . . . . . . . . . 12 3.5 Utility registers and definitions . . . . . . . . . . . . . . . . . . . . 13 3.6 Ragged right and friends . . . . . . . . . . . . . . . . . . . . . . . . 14 3.7 Reviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.8 Dates, volume and issue numbers, etc. . . . . . . . . . . . . . . . . 17 3.9 Page dimensions, glue, penalties etc . . . . . . . . . . . . . . . . . 20 3.10 Messing about with the L^{A}TEX logo . . . . . . . . . . . . . . . . . . 21 3.11 Authors, addresses, signatures . . . . . . . . . . . . . . . . . . . . . 22 3.12 Section titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.13 Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.14 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.15 Float captions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.16 Size changing commands . . . . . . . . . . . . . . . . . . . . . . . . 33 3.17 Lists and other text inclusions . . . . . . . . . . . . . . . . . . . . . 34 3.18 Some fun with verbatim . . . . . . . . . . . . . . . . . . . . . . . . 34 3.19 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.20 Registration marks . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.21 Running heads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.22 Output routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.23 Font-related definitions and machinery . . . . . . . . . . . . . . . . 40 3.24 Miscellaneous definitions . . . . . . . . . . . . . . . . . . . . . . . . 41 3.25 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

∗This file has version number v1.4f, last revised 1997/05/05

4 L^{A}TEX 2ε Proceedings class 42 4.1 Proceedings titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.2 Section divisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5 Plain TEX styles 48

6 The L^{A}TEX 2ε compatibility-mode style files 48

7 BibTEX support 49

8 The BibTEX style file 49

1 Document preambles

 1 ⟨ltugboatcls | ltugproccls | ltugcomn⟩\NeedsTeXFormat{LaTeX2e}[1994/12/01]

2 ⟨∗dtx⟩

 3 \ProvidesFile                 {tugboat.dtx}

4 ⟨/dtx⟩

 5 ⟨ltugboatcls⟩\ProvidesClass  {ltugboat}
 6 ⟨ltugproccls⟩\ProvidesClass  {ltugproc}
 7 ⟨ltugboatsty⟩\ProvidesPackage{ltugboat}
 8 ⟨ltugprocsty⟩\ProvidesPackage{ltugproc}
 9 ⟨ltugcomn⟩ \ProvidesPackage{ltugcomn}

10 ⟨∗!tugbib⟩

11  [1997/05/05 v1.4f

12 ⟨/!tugbib⟩

13 ⟨ltugboatcls⟩  TUGboat journal class%
14 ⟨ltugproccls⟩  TUG conference proceedings class%

15 ⟨ltugboatsty | ltugprocsty⟩ TUG compatibility package%

16 ⟨ltugcomn⟩  TUGboat `common macros' package%

17 ⟨∗dtx⟩

18  TUG macros source file%

19 ⟨/dtx⟩ 20 ⟨∗!tugbib⟩ 21 ] 22 ⟨/!tugbib⟩

23 ⟨∗dtx⟩

24 \newif\ifoldlongtable

25 ⟨/dtx⟩

2 Introduction

This file contains all the macros for typesetting TUGboat with both plain TEX and L^{A}TEX 2ε.

2.1 Summary of control sequences

Abbreviations. Just a listing with indications of expansion where that may not be obvious. For full definitions, see real code below (Section 3.3).

\AllTeX  (L^{A})TEX

\AMS  American Mathematical Society

\AmSTeX

\aw  A-W (abbreviation for Addison-Wesley)
\AW  Addison-Wesley

\BibTeX

\CandT  Computers & Typesetting

\DTD

\DVItoVDU DVItoVDU
\eTeX  ε-TEX

\HTML

\ISBN  ISBN
\ISSN  ISSN

\JTeX

\JoT  The Joy of TEX

\LaTeX

\Mc  M with raised c

\MF

\mf  Metafont
\MFB  The Metafont book

\MP

\mp  MetaPost

(in text only: remains ‘∓’ in maths)

\OMEGA  Omega ‘logo’ (Ω)
\OTP  Omega translation process
\mtex  multilingual TEX
\NTS  New Typesetting System

\pcMF  pcMF

\PCTeX
\pcTeX

\Pas  Pascal

\PiCTeX

\plain  plain (in typewriter font)
\POBox  P. O. Box

\POBoxTUG TUG PO Box

\PS  PostScript
\SC  Steering Committee

\SGML  SGML

\SliTeX

\slMF  Metafont (slanted)
\stTeX  TEX for the Atari ST

\TANGLE

\TB  The TEXbook
\TeX  (Although nearly every package defines this,

most, including plain(!) are missing the

spacefactor adjustment)

        \TeXhax

\TeXMaG  (defunct)

        \TeXtures
        \TeXXeT

\TUB  TUGboat
\TUG  TEX Users Group

        \UNIX
        \VAX
        \VorTeX
        \XeT
        \WEB
        \WEAVE

Macros for things that are slightly more significant.

\NoBlackBoxes  turns off marginal rules marking overfull boxes
\BlackBoxes  turns them back on
\newline  horizontal glue plus a break

\ifundefined#1  checks argument with \csname against \relax

\topsmash  smashes above baseline (from AMSTeX)
\botsmash  smashes below baseline (from AMSTeX)
\smash  smashes both (from plain)
\ulap  lap upwards
\dlap  lap downwards
\xlap  reference point at center horizontally; 0 width

\ylap reference point at center vertically; 0 height,

depth

\zlap  combination \xlap and \ylap

\basezero  to avoid insertion of baselineskip and lineskip glue

\nullhrule  empty \hrule
\nullvrule  empty \vrule

\makestrut[#1;#2]  ad hoc struts; #1=height, #2=depth
\today  today’s date
\SetTime  converts \time to hours, minutes
\now  displays time in hours and minutes
\Now  shows current date and time
\ifPrelimDraft  flag to indicate status as preliminary draft

\rtitlex TUGboat volume and number info for running

head

\midrtitle  information for center of running head
\HorzR@gisterRule  pieces of registration marks (‘trimmarks’)

\DownShortR@gisterRule
\UpShortR@gisterRule

\ttopregister  top registration line with ‘T’ in center

\tbotregister bottom registration line with inverted ‘T’ in cen-

ter

\topregister  register actually used

\botregister

\raggedskip  parameters used for ragged settings

\raggedstretch
\raggedparfill
\raggedspaces
\raggedright
\raggedleft
\raggedcenter
\normalspaces
\raggedbottom

\bull  square bullet
\cents  ‘cents’ sign
\Dag  superscripted dagger

\careof  c/o

\sfrac  slashed fraction (arguments optionally

separated by a slash)

\cs  control seqence name

\dash en-dash surrounded by thinspaces; only breakable

AFTER

\Dash  em-dash, as above

\hyph permit automatic hyphenation after an actual hy-

phen

\slash  ‘breakable’ slash
\nth  for obtaining ‘1^{st}’, ‘2^{nd}’, 3^{rd}, etc.
\tubissue  gets \TUB followed by volume and issue numbers
\xEdNote  Editor’s Note:
\Review:  Review: (for title of book review article)
\reviewitem  begin data for item being reviewed

\revauth with one argument, author(s) of item being re-

viewed

\revtitle  with one argument, title of …
\revpubinfo  with one argument, other info pertaining to …
\endreviewitem  end data for item being reviewed
\booktitle  with one argument, format book title in text

\Input \input with some other bookkeeping for case

where multiple articles are put together

\TBremark  reminder to TUGboat editorial staff
\TBEnableRemarks  enable \TBremarks (normally suppressed)
\pagexref  used to write out page numbers to screen and
\pagexrefON  external files

\pagexrefOFF

\xrefto  used for symbolic cross-reference to other pages

\xreftoON  in TUGboat

\xreftoOFF

\TBdriver marks code which only takes effect when articles

are run together in a driver file

\signaturemark  items for signatures

\signaturewidth

3 L^{A}TEX 2ε TUGboat class file

3.1 Setup and options

Check for reloading. Hmmm… Does this happen with L^{A}TEX 2εclasses? Probably, in fact, as well that it doesn’t, since the \tugstyinit referenced here doesn’t exist; however, it’s possible that we might need a similar mechanism in the future, so we retain its skeleton, without fleshing out the \tugstyinit bones.

26 ⟨∗ltugboatcls⟩

27 \csname tugstyloaded@\endcsname
28 \def\tugstyloaded@{\tugstyinit\endinput}

Acquire a name for this class if we don’t already have one (by virtue of having been loaded by tugproc.cls). This name will be used in error messages and the like.

29 \providecommand{\@tugclass}{ltugboat}

Warnings/error messages/information messages — if we’re using L^{A}TEX 2ε we can use the \Class* commands:

30 ⟨latex2e⟩\def\TBInfo{\ClassInfo{\@tugclass}}
31 ⟨latex2e⟩\def\TBError{\ClassError{\@tugclass}}
32 ⟨latex2e⟩\def\TBWarning{\ClassWarning{\@tugclass}}

Some trivial options, just flicking switches, etc.

33 \newif\ifpreprint
34 \def\preprint{\preprinttrue}
35 \DeclareOption{draft}{%
36 \AtEndOfClass{%
37  \setcounter{page}{1001}%
38  \BlackBoxes
39  \def\MakeRegistrationMarks{}%
40  \PrelimDrafttrue
41  }%

42 }

43 \DeclareOption{preprint}{%
44 \preprinttrue

45 }

46 \DeclareOption{final}{%
47 \AtEndOfClass{%
48  \UseTrimMarks
49  \NoBlackBoxes
50  \PrelimDraftFalse
51  }%

52 }

The rules dictate that the output should be set using a 10pt base font.

53 \DeclareOption{11pt}{%
54 \TBWarning{The \@tugclass\space class only supports 10pt fonts:
55  \MessageBreak option \CurrentOption\space ignored}%

56 }

57 \DeclareOption{12pt}{\csname ds@11pt\endcsname}

Similarly, ignore one/two-side/column

58 \DeclareOption{oneside}{Option \CurrentOption\space ignored}
59 \DeclareOption{twoside}{\ds@oneside}
60 \DeclareOption{onecolumn}{\ds@oneside}
61 \DeclareOption{twocolumn}{\ds@oneside}

There are these people who seem to think tugproc is an option rather than a class… (Note that it’s already been filtered out if we were calling from ltugproc.)

62 \DeclareOption{tugproc}{%
63 \TBWarning{Option \CurrentOption\space ignored: use class ltugproc
64  instead of \@tugclass}%

65 }

Option rawcite (the default) specifies the default citation mechanism (as built-in to L^{A}TEX); option harvardcite specifies the author-date citation mechanism defined in section 3.19 below.

66 \DeclareOption{rawcite}{\let\if@Harvardcite\iffalse}
67 \DeclareOption{harvardcite}{\let\if@Harvardcite\iftrue}

The section-numbering style, so that we can allow the same heading layout as in the plain macros.

68 \DeclareOption{numbersec}{\let\if@numbersec\iftrue}
69 \DeclareOption{nonumber}{\let\if@numbersec\iffalse}

Any other options, we pass on to article.cls before we load it:

70 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

Request default options (draft mode, standard citation, double-sided printing), process all options, and then get the base document class on top of which we reside.

71 \ExecuteOptions{draft,numbersec,rawcite}
72 \ProcessOptions
73 \LoadClass[twoside]{article}

Various fonts used throughout. Some effort has been made to suppress these things with explicit sizes in the macro name (\tensl is an example below), but keeping in step with the documentation is one thing that restricts such a move.

74 \def\sectitlefont{\fontfamily\sfdefault\fontseries{bx}\fontshape{n}%
75  \fontsize\@xviipt\stbaselineskip\selectfont}
76 \def\tensl{\fontseries{m}\fontshape{sl}\fontsize\@xpt\@xiipt
77  \selectfont}

This font selection command is used only for the ‘Editor’s Note’ introduction to notes; sadly it makes explicit reference to cmr, and Barbara Beeton has agreed that the reference may be constructed to use the current family such that, if no upright italic is defined, ordinary italics are used. A project for later…

78 \def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}%
79  \fontsize\@xpt\@xiipt\selectfont}

80 ⟨/ltugboatcls⟩

If Ulrik Vieth’s mflogo.sty is around, we’ll use it. Otherwise (pro tem, at least) we’ll warn the user and define the absolute minimum of machinery that TUGboat requires (that which was used prior to the invention of L^{A}TEX 2ε).

81 ⟨∗common⟩

 82 \IfFileExists{mflogo.sty}%
 83 {\RequirePackage{mflogo}}%

84 ⟨!ltugcomn⟩ {\TBWarning

 85 ⟨ltugcomn⟩ {\PackageWarning{ltugcomn}
 86  {Package mflogo.sty not available --\MessageBreak
 87  Proceeding to emulate mflogo.sty}
 88 \DeclareRobustCommand\logofamily{%
 89  \not@math@alphabet\logofamily\relax
 90  \fontencoding{U}\fontfamily{logo}\selectfont}
 91 \DeclareTextFontCommand{\textlogo}{\logofamily}
 92 \def\MF{\textlogo{META}\-\textlogo{FONT}\@}
 93 \def\MP{\textlogo{META}\-\textlogo{POST}\@}
 94 \DeclareFontFamily{U}{logo}{}
 95 \DeclareFontShape{U}{logo}{m}{n}{%
 96  <8><9>gen*logo%
 97  <10><10.95><12><14.4><17.28><20.74><24.88>logo10%
 98 }{}
 99 \DeclareFontShape{U}{logo}{m}{sl}{%
100  <8><9>gen*logosl%
101  <10><10.95><12><14.4><17.28><20.74><24.88>logosl10%
102 }{}
103 \DeclareFontShape{U}{logo}{m}{it}{%
104  <->ssub*logo/m/sl%
105 }{}%

106 }

3.2 Helpful shorthand (common code with Plain styles)

\makeescape, …, \makecomment allow users to change the category code of a single character a little more easily. These require that the character be addressed as a control sequence: e.g., \makeescape\/ will make ‘/’ an escape character.

107 ⟨∗!latex⟩

108 \def\makeescape#1{\catcode`#1=0 }
109 \def\makebgroup#1{\catcode`#1=1 }
110 \def\makeegroup#1{\catcode`#1=2 }
111 \def\makemath  #1{\catcode`#1=3 }

112 ⟨/!latex⟩ 113 ⟨∗latex⟩

114 \def\makeescape#1{\catcode`#1=\z@}
115 \def\makebgroup#1{\catcode`#1=\@ne}
116 \def\makeegroup#1{\catcode`#1=\tw@}
117 \def\makemath  #1{\catcode`#1=\thr@@}

118 ⟨/latex⟩

119 \def\makealign #1{\catcode`#1=4 }
120 \def\makeeol   #1{\catcode`#1=5 }
121 \def\makeparm  #1{\catcode`#1=6 }
122 \def\makesup   #1{\catcode`#1=7 }
123 \def\makesub   #1{\catcode`#1=8 }
124 \def\makeignore#1{\catcode`#1=9 }
125 \def\makespace #1{\catcode`#1=10 }
126 \def\makeletter#1{\catcode`#1=11 }
127 \chardef\other=12

128 ⟨∗!latex⟩

129 \def\makeother #1{\catcode`#1=\other}

130 ⟨/!latex⟩ 131 ⟨∗latex⟩

132 \let\makeother\@makeother

133 ⟨/latex⟩

134 \def\makeactive#1{\catcode`#1=13 }
135 \def\makecomment#1{\catcode`#1=14 }

136 ⟨∗!latex⟩

137 \def\makeatletter{\makeletter\@}
138 \def\makeatother {\makeother\@}

139 ⟨/!latex⟩

\savecat#1 and \restorecat#1 will save and restore the category of a given character. These are useful in cases where one doesn’t wish to localize the settings and therefore be required to globally define or set things.

140 \def\savecat#1{%
141 \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
142 \def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}

143 ⟨!latex⟩\savecat\@

144 ⟨!latex⟩\makeletter\@

\SaveCS#1 and \RestoreCS#1 save and restore ‘meanings’ of control sequences. Again this is useful in cases where one doesn’t want to localize or where global definitions clobber a control sequence which is needed later with its ‘old’ definition.

145 \def\SaveCS#1{\expandafter\let\csname saved@@#1\expandafter\endcsname
146 \csname#1\endcsname}
147 \def\RestoreCS#1{\expandafter\let\csname#1\expandafter\endcsname
148 \csname saved@@#1\endcsname}

To distinguish between macro files loaded

149 \def\plaintubstyle{plain}
150 \def\latextubstyle{latex}

Control sequences that were first defined in L^{A}TEX 2ε of 1995/06/01 (or later), but which we merrily use. Only define if necessary:

151 ⟨∗latex2e⟩

152 \providecommand\hb@xt@{\hbox to}
153 \providecommand\textsuperscript[1]{\ensuremath{\m@th
154  ^{\mbox{\fontsize\sf@size\z@
155  \selectfont #1}}}}

156 ⟨/latex2e⟩

157 ⟨!latex2e⟩\def\hb@xt@{\hbox to}

(Note that that definition of \textsuperscript isn’t robust, but probably doesn’t need to be… What’s more, it doesn’t appear in the mythical 2.09 version of the package.)

3.3 Abbreviations and logos

Font used for the METAFONT logo, etc.

158 ⟨!latex2e⟩\font\manual=logo10
159 \def\AllTeX{(\La\kern-.075em)\kern-.075em\TeX}
160 \def\AMS{American Mathematical Society}

161 ⟨!latex2e⟩\def\AmS{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox
162 ⟨!latex2e⟩  {\the\textfont2 M}\kern-.125em{\the\textfont2 S}}
163 ⟨latex2e⟩\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
164 ⟨latex2e⟩  {$\mathcal{M}$}\kern-.125em$\mathcal{S}$}
165 \def\AmSLaTeX{\AmS-\LaTeX}
166 \def\AmSTeX{\AmS-\TeX}
167 \def\aw{A\kern.1em-W}
168 \def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley}
169 ⟨!latex2e⟩\def\BibTeX{{\rm B\kern-.05em{\smc i\kern-.025emb}\kern-.08em\TeX}}
170 ⟨latex2e⟩\def\BibTeX{\textsc{Bib}\kern-.08em\TeX}
171 ⟨!latex2e⟩\def\CandT{{\sl Computers \& Typesetting}}
172 ⟨latex2e⟩\def\CandT{\textsl{Computers \& Typesetting}}
173 \def\CTAN{\acro{CTAN}}
174 \def\DTD{\acro{DTD}}
175 \def\DVItoVDU{DVIto\kern-.12em VDU}
176 ⟨latex2e⟩\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
177 ⟨!latex2e⟩\def\eTeX{{$\varepsilon$}-\kern-.125em\TeX}
178 \def\HTML{\acro{HTML}}
179 \def\ISBN{\acro{ISBN}}
180 \def\ISSN{\acro{ISSN}}
181 \def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}}
182 ⟨!latex2e⟩\def\JoT{{\sl The Joy of \TeX}}
183 ⟨latex2e⟩\def\JoT{\textsl{The Joy of \TeX}}

184 ⟨∗!latex2e⟩

185 \def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em\the\scriptfont2 A}%
186  \kern-.2em\lower.376ex\hbox{\the\textfont2 M}\kern-.125em
187  {\the\textfont2 S}-\TeX}

188 ⟨/!latex2e⟩ 189 ⟨∗latex2e⟩

190 \def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em
191  $\m@th$\fontsize\sf@size\z@\selectfont
192  $\m@th\mathcal{A}$}%
193  \kern-.2em\lower.376ex\hbox{$\m@th\mathcal{M}$}\kern-.125em
194  {$\m@th\mathcal{S}$}-\TeX}

195 ⟨/latex2e⟩

196 ⟨!latex2e⟩\def\La{\TestCount=\the\fam \leavevmode L\raise.42ex
197 ⟨!latex2e⟩  \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}}

With the facilities of L^{A}TEX 2ε, we can do rather better. This code is hacked from its definition of \LaTeX; it allows slants (for example) to propagate into the raised (small) ‘A’:

198 ⟨∗latex2e⟩

199 \newcommand{\La}%
200 {L\kern-.36em
201  {\setbox0\hbox{T}%
202  \vbox to\ht0{\hbox{$\m@th$%
203  \csname S@\f@size\endcsname
204  \fontsize\sf@size\z@
205  \math@fontsfalse\selectfont
206  A}%
207  \vss}%

208 }} 209 ⟨/latex2e⟩

We started with the intention that we wouldn’t redefine \LaTeX when we’re running under it, so as not to trample on an existing definition. However, this proves less than satisfactory; a single logo may be OK for the run of documents, but for TUGboat, we find that something noticeably better is necessary; see section 3.10.

210 ⟨!latex⟩\def\LaTeX{\La\kern-.15em\TeX}
211 \def\Mc{\setbox\TestBox=\hbox{M}M\vbox
212 to\ht\TestBox{\hbox{c}\vfil}} %  for Robert McGaffey

If we’re running under L^{A}TEX 2ε, we’re using (at least pro tem) Ulrik Vieth’s mflogo.sty if it’s present. Otherwise, we’re using a short extract of Vieth’s stuff. Either way, we don’t need to specify \MF or \MP

213 ⟨!latex2e⟩\def\MF{{\manual META}\-{\manual FONT}\@}
214 ⟨!latex2e⟩\def\mf{{\smc Metafont}}
215 ⟨latex2e⟩\def\mf{\textsc{Metafont}}
216 ⟨!latex2e⟩\def\MFB{{\sl The \slMF book}}
217 ⟨latex2e⟩\def\MFB{\textsl{The \MF book}}
218 ⟨!latex2e⟩\def\MP{{\manual META}\-{\manual POST}\@}

219 ⟨∗latex2e⟩

220 \let\TB@@mp\mp
221 \DeclareRobustCommand\mp{\ifmmode\TB@@mp\else MetaPost\fi}

222 ⟨/latex2e⟩

In order that the \OMEGA command will switch to using the TS1 variant of the capital Omega character if textcomp.sty is loaded, we define it in terms of the \textohm command. Note that this requires us to interpose a level of indirection, rather than to use \let…

223 ⟨∗latex2e⟩

224 \DeclareTextSymbol{\textohm}{OT1}{'012}
225 \DeclareTextSymbolDefault{\textohm}{OT1}
226 \newcommand\OMEGA{\textohm}
227 \DeclareRobustCommand{\OTP}{\OMEGA\acro{TP}}

228 ⟨/latex2e⟩

229 \def\mtex{T\kern-.1667em\lower.424ex\hbox{\^E}\kern-.125emX\@}
230 ⟨latex2e⟩\DeclareRobustCommand\NTS{$\mathcal{N}$\lower.5ex\hbox
231 ⟨latex2e⟩  {$\mathcal{T}$}$\mathcal{S}$\@}
232 \def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}MF\@}
233 \def\PCTeX{PC\thinspace\TeX}
234 \def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}\TeX}
235 \def\Pas{Pascal}
236 \def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\@}
237 \def\PiCTeX{\PiC\kern-.11em\TeX}
238 ⟨!latex2e⟩\def\plain{{\tt plain}}
239 ⟨latex2e⟩\def\plain{\texttt{plain}}
240 \def\POBox{P.\thinspace O.~Box }
241 \def\PS{{Post\-Script}}
242 \def\SC{Steering Committee}
243 \def\SGML{\acro{SGML}}
244 ⟨!latex2e⟩\def\SliTeX{{\rm S\kern-.06em{\smc l\kern-.035emi}\kern-.06em\TeX}}
245 ⟨latex2e⟩\def\SliTeX{\textrm{S\kern-.06em\textsc{l\kern-.035emi}%
246 ⟨latex2e⟩  \kern-.06em\TeX}}
247 ⟨!latex2e⟩\def\slMF{\MF}
248 ⟨latex2e⟩ \def\slMF{\textsl{\MF}} % should never be used

249 ⟨!latex2e⟩\def\stTeX{{\smc st\rm\kern-0.13em\TeX}}
250 ⟨latex2e⟩ \def\stTeX{\textsc{st}\kern-0.13em\TeX}
251 ⟨!latex2e⟩\def\TANGLE{{\tt TANGLE}\@}
252 ⟨latex2e⟩\def\TANGLE{\texttt{TANGLE}\@}
253 ⟨!latex2e⟩\def\TB{{\sl The \TeX book}}
254 ⟨latex2e⟩\def\TB{\textsl{The \TeX book}}
255 ⟨!latex2e⟩\def\TP{{\sl \TeX\/}: {\sl The Program\/}}
256 ⟨latex2e⟩\def\TP{\textsl{\TeX}: \textsl{The Program}}
257 ⟨!latex2e⟩\def\TeX{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@}

258 ⟨∗latex2e⟩

259 \DeclareRobustCommand\TeX{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@}

260 ⟨/latex2e⟩

261 \def\TeXhax{\TeX hax}
262 \def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}%
263 \kern-.2267emG\@}
264 ⟨!latex2e⟩\def\TeXtures{{\it Textures}}
265 ⟨latex2e⟩\def\TeXtures{\textit{Textures}}
266 \let\Textures=\TeXtures
267 \def\TeXXeT{\TeX-{}-\XeT}
268 ⟨!latex2e⟩\def\ttn{{\sl TTN}\@}
269 ⟨latex2e⟩\def\ttn{\textsl{TTN}\@}
270 ⟨!latex2e⟩\def\TTN{{\sl \TeX{} and TUG NEWS}\@}
271 ⟨latex2e⟩\def\TTN{\textsl{\TeX{} and TUG News}\@}
272 ⟨!latex2e⟩\def\tubfont{\sl}               % redefined in other situations
273 ⟨!latex2e⟩\def\TUB{{\tubfont TUGboat\/}}
274 ⟨latex2e⟩\let\texttub\textsl              % redefined in other situations
275 ⟨latex2e⟩\def\TUB{\texttub{TUGboat}}
276 \def\TUG{\TeX\ \UG}
277 \def\tug{\acro{TUG}}
278 \def\UG{Users Group}
279 \def\UNIX{\acro{UNIX}}
280 \def\VAX{V\kern-.12em A\kern-.1em X\@}
281 \def\VorTeX{V\kern-2.7\p@\lower.5ex\hbox{O\kern-1.4\p@ R}\kern-2.6\p@\TeX}
282 \def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\@}
283 ⟨!latex2e⟩\def\WEB{{\tt WEB}\@}
284 ⟨latex2e⟩\def\WEB{\texttt{WEB}\@}
285 ⟨!latex2e⟩\def\WEAVE{{\tt WEAVE}\@}
286 ⟨latex2e⟩\def\WEAVE{\texttt{WEAVE}\@}

3.4 General typesetting rules

287 \newlinechar=`\^^J
288 \normallineskiplimit=\p@
289 \clubpenalty=10000
290 \widowpenalty=10000
291 \def\NoParIndent{\parindent=\z@}
292 \newdimen\normalparindent
293 \normalparindent=20\p@
294 \def\NormalParIndent{\global\parindent=\normalparindent}
295 \NormalParIndent
296 \def\BlackBoxes{\overfullrule=5\p@}
297 \def\NoBlackBoxes{\overfullrule=\z@}
298 \def\newline{\hskip\z@\@plus\pagewd\break}

Hyphen control: first, we save the hyphenpenalties in \allowhyphens. This allows us to permit hyphens temporarily in things like \netaddresses, which typically occur when \raggedright is set, but which need to be allowed to break at their artificial discretionaries.

299 \edef\allowhyphens{\noexpand\hyphenpenalty\the\hyphenpenalty\relax
300 \noexpand\exhyphenpenalty\the\exhyphenpenalty\relax}
301 \def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M}

3.5 Utility registers and definitions

We define a few scratch registers (and the like) for transient use; they’re all paired: an internal one (\T@st*) and an external one (\Test*).

Comment: Exercise for an idle day: find whether all these are necessary, or whether we can use the L^{A}TEX temporaries for some (or all) of the \T@st* ones.

Comment: (bb) All these registers are used in the plain version, tugboat.sty.

302 \newbox\T@stBox                 \newbox\TestBox
303 \newcount\T@stCount             \newcount\TestCount
304 \newdimen\T@stDimen             \newdimen\TestDimen
305 \newif\ifT@stIf                 \newif\ifTestIf

Control sequence existence test, stolen from TEXbook exercise 7.7 (note that this provides functionality that in some sense duplicates something within L^{A}TEX).

306 \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }

L^{A}TEX conventions which are also useful here.

307 ⟨∗!latex⟩

308 \let\@@input\input
309 \def\iinput#1{\@@input#1 }
310 \def\@inputcheck{\if\@nextchar\bgroup
311  \expandafter\iinput\else\expandafter\@@input\fi}
312 \def\input{\futurelet\@nextchar\@inputcheck}

313 ⟨/!latex⟩

Smashes repeated from AMS-TEX; plain TEX implements only full \smash.

314 \newif\iftop@           \newif\ifbot@
315 \def\topsmash{\top@true\bot@false\smash@}
316 \def\botsmash{\top@false\bot@true\smash@}
317 \def\smash{\top@true\bot@true\smash@}
318 \def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
319  \else\let\next\makesm@sh\fi \next }
320 \def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}

Vertical ‘laps’; cf. \llap and \rlap

321 \long\def\ulap#1{\vbox to \z@{\vss#1}}
322 \long\def\dlap#1{\vbox to \z@{#1\vss}}

And centered horizontal and vertical ‘laps’

323 \def\xlap#1{\hb@xt@\z@{\hss#1\hss}}
324 \long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
325 \long\def\zlap#1{\ylap{\xlap{#1}}}

Avoid unwanted vertical glue when making up pages.

326 \def\basezero{\baselineskip\z@skip \lineskip\z@skip}

Empty rules for special occasions

327 \def\nullhrule{\hrule \@height\z@ \@depth\z@ \@width\z@ }
328 \def\nullvrule{\vrule \@height\z@ \@depth\z@ \@width\z@ }

Support ad-hoc strut construction.

329 \def\makestrut[#1;#2]{\vrule \@height#1 \@depth#2 \@width\z@ }

Construct box for figure pasteup, etc.; height = #1, width = #2, rule thickness = #3

330 \def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3
331  \vbox to#1{\hrule \@height\T@stDimen \@depth\z@
332  \vss\hb@xt@#2{\vrule \@width\T@stDimen
333  \hfil\makestrut[#1;\z@]%
334  \vrule \@width\T@stDimen}\vss
335  \hrule \@height\T@stDimen \@depth\z@}}

Today’s date, to be printed on drafts. Based on TEXbook, p.406.

336 ⟨∗!latex⟩

337 \def\today{\number\day\space \ifcase\month\or
338  Jan \or Feb \or Mar \or Apr \or May \or Jun \or
339  Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi
340  \number\year}

341 ⟨/!latex⟩

Current time; this may be system dependent!

342 \newcount\hours
343 \newcount\minutes
344 \def\SetTime{\hours=\time
345  \global\divide\hours by 60
346  \minutes=\hours
347  \multiply\minutes by 60
348  \advance\minutes by-\time
349  \global\multiply\minutes by-1 }
350 \SetTime
351 \def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}
352 \def\Now{\today\ \now}
353 \newif\ifPrelimDraft
354 ⟨!latex2e⟩\def\midrtitle{\ifPrelimDraft {{\tensl preliminary draft, \Now}}\fi}
355 ⟨latex2e⟩\def\midrtitle{\ifPrelimDraft {\textsl{preliminary draft, \Now}}\fi}

3.6 Ragged right and friends

PLAIN’s definition of \raggedright doesn’t permit any stretch, and results in too many overfull boxes. We also turn off hyphenation.

356 \newdimen\raggedskip    \raggedskip=\z@
357 \newdimen\raggedstretch \raggedstretch=5em    % ems of font set now (10pt)
358 \newskip\raggedparfill  \raggedparfill=\z@\@plus 1fil
359 \def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax }

Some applications may have to add stretch, in order to avoid all overfull boxes.

360 \def\raggedright{%
361 \nohyphens
362 \rightskip=\raggedskip\@plus\raggedstretch \raggedspaces

363 \parfillskip=\raggedparfill }
364 \def\raggedleft{%
365 \nohyphens
366 \leftskip=\raggedskip\@plus\raggedstretch \raggedspaces
367 \parfillskip=\z@skip }
368 \def\raggedcenter{%
369 \nohyphens
370 \leftskip=\raggedskip\@plus\raggedstretch
371 \rightskip=\leftskip \raggedspaces
372 \parindent=\z@ \parfillskip=\z@skip }
373 \def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip }

Miscellaneous useful stuff. Note that L^{A}TEX 2ε defines a robust \,, but that we extend its definition of ~ (it’s not robust in L^{A}TEX 2ε either; the version we use is that in AMS-TEX).

374 ⟨!latex2e⟩\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi}
375 \def~{\unskip\nobreak\ \ignorespaces}

Plain TEX defines \newbox as \outer. We solemnly preserve the following, which removes the \outerness; of course, we carefully exclude it from what we generate… (\outerness is a spawn of the devil, is it not? Barbara Beeton responded to the previous sentence “\outerness has its place: it avoids register buildup, hence running out of memory”. In another context, David Carlisle remarked that an error control mechanism that causes more confusing errors than it prevents is rather a poor one. This is perhaps not the place to conduct a serious debate…)

376 ⟨!latex⟩\def\newbox{\alloc@4\box\chardef\insc@unt}
377 \def\boxcs#1{\box\csname#1\endcsname}
378 \def\setboxcs#1{\setbox\csname#1\endcsname}
379 \def\newboxcs#1{\expandafter\newbox\csname#1\endcsname}
380 ⟨!latex⟩\def\gobble#1{}
381 ⟨latex⟩\let\gobble\@gobble
382 \def\vellipsis{%
383 \leavevmode\kern0.5em
384 \raise\p@\vbox{\baselineskip6\p@\vskip7\p@\hbox{.}\hbox{.}\hbox{.}}

385 }

386 \def\bull{\vrule \@height 1ex \@width .8ex \@depth -.2ex }
387 \def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
388 \def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
389 \def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
390  /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}

391 ⟨∗!latex2e⟩

392 \def\sfrac#1/#2{\leavevmode\kern.1em
393  \raise.5ex\hbox{\the\scriptfont\z@ #1}\kern-.1em
394  /\kern-.15em\lower.25ex\hbox{\the\scriptfont\z@ #2}}

395 ⟨/!latex2e⟩ 396 ⟨∗latex2e⟩

397 \DeclareRobustCommand\sfrac[1]{\@ifnextchar/{\@sfrac{#1}}%
398  {\@sfrac{#1}/}}
399 \def\@sfrac#1/#2{\leavevmode\kern.1em\raise.5ex
400  \hbox{$\m@th\mbox{\fontsize\sf@size\z@
401  \selectfont#1}$}\kern-.1em
402  /\kern-.15em\lower.25ex
403  \hbox{$\m@th\mbox{\fontsize\sf@size\z@

404  \selectfont#2}$}}

405 ⟨/latex2e⟩

406 ⟨latex2e⟩\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
407 \def\thinskip{\hskip 0.16667em\relax}

We play a merry game with dashes, providing all conceivable options of breakability before and after.

408 \def\endash{--}
409 \def\emdash{\endash-}
410 \def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
411 \def\dash{\d@sh\nobreak\endash}
412 \def\Dash{\d@sh\nobreak\emdash}
413 \def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
414 \def\rdash{\d@sh\nobreak\endash}
415 \def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
416 \def\Rdash{\d@sh\nobreak\emdash}

Hacks to permit automatic hyphenation after an actual hyphen, or after a slash.

417 \def\hyph{-\penalty\z@\hskip\z@skip }
418 \def\slash{/\penalty\z@\hskip\z@skip }

Adapted from comp.text.tex posting by Donald Arseneau, 26 May 93. L^{A}TEX 2ε-isation added by Robin Fairbairns. Destroys both the TestCounts.

419 \def\nth#1{%
420  \def\reserved@a##1##2\@nil{\ifcat##1n%

421 0%

422 ⟨latex2e⟩ \let\reserved@b\ensuremath
423  \else##1##2%
424 ⟨latex2e⟩ \let\reserved@b\relax
425  \fi}%
426  \TestCount=\reserved@a#1\@nil\relax
427  \ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives
428  \T@stCount=\TestCount
429  \divide\T@stCount by 100 \multiply\T@stCount by 100
430  \advance\TestCount by-\T@stCount     % n mod 100
431  \ifnum\TestCount >20 \T@stCount=\TestCount
432  \divide\T@stCount by 10 \multiply\T@stCount by 10
433  \advance\TestCount by-\T@stCount   % n mod 10
434  \fi

435 ⟨∗!latex2e⟩

436  \T@stCount=\the\fam\relax
437  $\fam\T@stCount#1^{\fam\T@stCount
438  \ifcase\TestCount th%    0th
439  \or   st%                1st
440  \or   nd%                2nd
441  \or   rd%                3rd
442  \else th%                nth
443  \fi
444  }$%

445 ⟨/!latex2e⟩ 446 ⟨∗latex2e⟩

447  \reserved@b{#1}%
448  \textsuperscript{\ifcase\TestCount th%    0th

449  \or   st%                1st
450  \or   nd%                2nd
451  \or   rd%                3rd
452  \else th%                nth
453  \fi}%

454 ⟨/latex2e⟩ 455 }

3.7 Reviews

Format information on reviewed items for book review articles.

456 ⟨∗!latex2e⟩

457 \def\Review:#1{\ifx[#1\@Rev[%
458 \else Book review:\enspace\sl #1%
459 \fi

460 }

461 \def\@Rev[#1]{\ignorespaces#1\unskip:\enspace\ignorespaces\sl}

462 ⟨/!latex2e⟩

For the L^{A}TEX 2ε version, we follow Fairbairns’ maxim, and define something that can even look like a L^{A}TEX macro…

463 ⟨∗latex2e⟩

464 \def\Review{\@ifnextchar:{\@Review}{\@Review:}}
465 \def\@Review:{\@ifnextchar[%]
466 {\@Rev}%
467 {\@Rev[Book review]}}
468 \def\@Rev[#1]#2{{\ignorespaces#1\unskip:\enspace\ignorespaces
469  \slshape\mdseries#2}}

470 ⟨/latex2e⟩

471 ⟨!latex2e⟩\def\reviewitem{%
472 ⟨latex2e⟩\def\reviewitem{\addvspace{\BelowTitleSkip}%
473 \def\revauth##1{\def\therevauth{##1, }\ignorespaces}%
474 ⟨!latex2e⟩ \def\revtitle##1{\def\therevtitle{{\sl##1}. }\ignorespaces}%
475 ⟨latex2e⟩ \def\revtitle##1{\def\therevtitle{{\slshape##1}. }\ignorespaces}%
476 \def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}%

477 }

478 \def\endreviewitem{{\noindent\interlinepenalty=10000
479 \therevauth\therevtitle\therevpubinfo\endgraf}%
480 \vskip\medskipamount
481 ⟨!latex⟩\DeleteOptionalSpacesandPars{\noindent\ignorespaces}%

482 }

483 ⟨!latex2e⟩\def\booktitle#1{{\sl #1\/}}
484 ⟨latex2e⟩\def\booktitle#1{{\slshape#1\/}}

3.8 Dates, volume and issue numbers, etc.

Dates and other items which identify the volume and issue. \issueseqno is a sequential issue number starting from the first issue published; volume 15,4 has

 \issueseqno=45.
     To use: \vol 19, 1. \issdate March 1998. \issueseqno=58

For production, these are set in a separate file, tugboat.dates, which is issue-specific.

Comment: I would like to make the code read a file tugboat.dates in the current directory or its parent. This is easy except under ‘odd’ operating systems (VMS is an example that springs to mind, RISCos may be even worse) whose syntax is out of the ordinary.

485 \newcount\issueseqno            \issueseqno=-1
486 \def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
487 \def\volyr{}
488 \def\volno{}
489 \def\vol #1,#2.{\gdef\volno{#1\unskip}%
490  \gdef\issno{\ignorespaces#2\unskip}%
491  \setbox\TestBox=\hbox{\volyr}%
492  \ifdim \wd\TestBox > .2em \v@lx \fi }
493 \def\issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
494  \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
495  \setbox\TestBox=\hbox{\volno}%
496  \ifdim \wd\TestBox > .2em \v@lx \fi }
497 \vol 0, 0.
498 \issdate Thermidor, 2001.

(The curious should know that Thermidor was one of the French revolutionary month names…)

For L^{A}TEX use, define a version of the issue declaration that can take or leave the old plain syntax

499 ⟨!latex⟩\def\tubissue#1(#2)%

500 ⟨∗latex⟩

501 \def\tubissue#1{\@ifnextchar(%)
502 {\@tubissue@b{#1}}
503 {\@tubissue@a{#1}}}
504 \def\@tubissue@b#1(#2){\@tubissue@a{#1}{#2}}
505 \def\@tubissue@a#1#2%

506 ⟨/latex⟩

507 {\TUB~#1, no.~#2}

TUGboat conventions include the sequential issue number in the file name. Permit this to be incorporated into file names automatically. If issue number = 11,

 \Input filnam will read tb11filnam.tex
508 \def\infil@{\jobname}
509 \def\Input #1 {\ifnum\issueseqno<0
510  \def\infil@{#1}%
511 \else
512  \def\infil@{tb\number\issueseqno#1}
513 \fi
514 \edef\jobname{\infil@}\@readFLN
515 \@@input \infil@\relax
516 \if@RMKopen
517  \immediate\closeout\@TBremarkfile\@RMKopenfalse
518 \fi

519 }

\TBremarks are things that need to be drawn to the attention of the editors; the conscientious author will include such things in the article file. By default, remarks are suppressed, but their appearance may be enabled by the \TBEnableRemarks command, which can be included in the configuration file ltugboat.cfg (or ltugproc.cfg, if that’s what we’re at).

520 \newif\if@RMKopen        \@RMKopenfalse
521 \newwrite\@TBremarkfile
522 \def\@TBremark#1{%
523 \if@RMKopen
524 \else
525  \@RMKopentrue\immediate\openout\@TBremarkfile=\infil@.rmk
526 \fi
527 \toks@={#1}%
528 \immediate\write\@TBremarkfile{^^J\the\toks@}%
529 \immediate\write16{^^JTBremark:: \the\toks@^^J}%

530 }

We initialise \TBremark to ignore its argument (this used to involve a \TBremarkOFF which was cunningly defined exactly the same as \gobble)

531 \let\TBremark=\gobble

\TBEnableRemarks simply involves setting \TBremark to use the functional \@TBremark defined above.

532 \def\TBEnableRemarks{\let\TBremark\@TBremark}

For marking locations in articles that pertain to remarks in another file of editorial comments

533 \def\TUBedit#1{}

For using different filenames in the production process than those supplied by authors

534 \def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}}

535 ⟨∗!latex2e⟩

536 \newread\@altfilenames
537 \def\@readFLN{\immediate\openin\@altfilenames=\jobname.fln
538 \ifeof\@altfilenames\let\@result\relax\else
539 \def\@result{\@@input\jobname.fln }\fi
540 \immediate\closein\@altfilenames
541 \@result}
542 \@readFLN
543 \everyjob=\expandafter{\the\everyjob\@readFLN}

544 ⟨/!latex2e⟩

545 ⟨latex2e⟩\InputIfFileExists{\jobname.fln}%
546 ⟨latex2e⟩  {\TBInfo{Reading alternative file file \jobname.fln}}{}

The following needs to work entirely in TEX’s mouth

547 \def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax
548 #1\else\csname file@@#1\endcsname\fi}
549 \def\fileinput#1{\@@input\@tubfilename{#1} }

Write out (both to a file and to the log) the starting page number of an article, to be used for cross references and in contents. \pagexref is used for articles fully processed in the TUGboat run. \PageXref is used for ‘extra’ pages, where an item is submitted as camera copy, and only running heads (at most) are run.

550 ⟨∗!latex⟩

551 \def\pagexrefON#1{%
552  \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
553  \write\ppoutfile{%
554  \def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%

555 }

556 \def\PageXrefON#1{%
557  \immediate\write-1{\def\expandafter
558  \noexpand\csname#1\endcsname{\number\pageno}}%
559  \immediate\write\ppoutfile{\def\expandafter
560  \noexpand\csname#1\endcsname{\number\pageno}}}

561 ⟨/!latex⟩ 562 ⟨∗latex⟩

563 \def\pagexrefON#1{%
564  \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
565  \write\ppoutfile{%
566  \def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%

567 }

568 \def\PageXrefON#1{%
569  \immediate\write-1{\def\expandafter
570  \noexpand\csname#1\endcsname{\number\c@page}}%
571  \immediate\write\ppoutfile{\def\expandafter
572  \noexpand\csname#1\endcsname{\number\c@page}}}

573 ⟨/latex⟩

574 \def\pagexrefOFF#1{}
575 \let\pagexref=\pagexrefOFF
576 \def\PageXrefOFF#1{}
577 \let\PageXref=\PageXrefOFF
578 \def\xreftoON#1{%
579 \ifundefined{#1}%
580  ???\TBremark{Need cross reference for #1.}%
581 \else\csname#1\endcsname\fi}
582 \def\xreftoOFF#1{???}
583 \let\xrefto=\xreftoOFF

\TBdriver ‘marks code for use when articles are run together in a driver file’. Since we don’t yet have a definition of that arrangement, we don’t have a definition of \TBdriver. Its argument (which one presumes was intended as the code for this unusual state) is just gobbled.

584 \let\TBdriver\gobble

Some hyphenation exceptions:

585 \hyphenation{Eijk-hout Hara-lam-bous man-u-script man-u-scripts}
586 ⟨!latex⟩\restorecat\@

587 ⟨/common⟩ 588 ⟨∗classtail⟩

589 \PrelimDrafttrue

3.9 Page dimensions, glue, penalties etc

590 \textheight 54pc
591 \textwidth 39pc
592 \columnsep 1.5pc
593 \columnwidth 18.75pc
594 \parindent \normalparindent

595 \parskip \z@ % \@plus\p@
596 \leftmargini 2em
597 \leftmarginv .5em
598 \leftmarginvi .5em
599 \oddsidemargin \z@
600 \evensidemargin \z@
601 \topmargin -2.5pc
602 \headheight 12\p@
603 \headsep 20\p@
604 \marginparwidth 48\p@
605 \marginparsep 10\p@
606 \partopsep=\z@
607 \topsep=3\p@\@plus\p@\@minus\p@
608 \parsep=3\p@\@plus\p@\@minus\p@
609 \itemsep=\parsep
610 \twocolumn
611 \newdimen\pagewd        \pagewd=39pc
612 \newdimen\trimwd        \trimwd=\pagewd
613 \newdimen\trimlgt       \trimlgt=11in
614 \newdimen\headmargin    \headmargin=3.5pc

If we’re in L^{A}TEX 2ε, twoside option is forced on when article.cls is loaded.

615 ⟨!latex2e⟩\@twosidetrue

3.10 Messing about with the L^{A}TEX logo

Barbara Beeton’s pleas for L^{A}TEX logos that look right in any font shape provoked me to generate the following stuff that is configurable.

Here’s the command for the user to define hir own new version. The arguments are font family, series and shape, and then the two kern values used in placing the raised ‘A’ of L^{A}TEX.

616 \newcommand\DeclareLaTeXLogo[5]{\expandafter\def
617 \csname @LaTeX@#1/#2/#3\endcsname{{#4}{#5}}}

The default values are as used in the source of L^{A}TEX itself:

618 \def\@LaTeX@default{{.36}{.15}}

Three more defined in the initial version, for bold CM sans (which is used as \SecTitleFont), and CM italic medium and bold:

619 \DeclareLaTeXLogo{cmss}{bx}n{.3}{.15}
620 \DeclareLaTeXLogo{cmr}m{it}{.3}{.27}
621 \DeclareLaTeXLogo{cmr}{bx}{it}{.3}{.27}

Redefine \LaTeX to choose the parameters for the current font, or to use the default value otherwise:

622 \DeclareRobustCommand\LaTeX{\expandafter\let\expandafter\reserved@a
623 \csname @LaTeX@\f@family/\f@series/\f@shape\endcsname
624 \ifx\reserved@a\relax\let\reserved@a\@LaTeX@default\fi
625 \expandafter\@LaTeX\reserved@a}

Here’s the body of what was originally \LaTeX, pulled out with its roots dripping onto the smoking ruin of original L^{A}TEX, and then bits stuck in on the side.

\@LaTeX@default provides parameters as one finds in the original; other versions are added as needed.

626 \newcommand\@LaTeX[2]{L\kern-#1em
627  {\sbox\z@ T%
628  \vbox to\ht0{\hbox{$\m@th$%
629  \csname S@\f@size\endcsname
630  \fontsize\sf@size\z@
631  \math@fontsfalse\selectfont
632  A}%
633  \vss}%

634 }%

635  \kern-#2em%
636  \TeX}

3.11 Authors, addresses, signatures

Each article may have several authors (of course), so we permit an \author command for each of them. The names are then stored in a set of \csnames called \author1, \author2, … Similarly, there are several \address<n> and \netaddress<n> and \PersonalURL<n> commands set up for each article.

Comment: I would like to make provision for several authors at the same address, but (short of preempting the * marker, which it would be nice to retain so as to preserve compatibility with the plain style) I’m not sure how one would signal it.

637 \def\theauthor#1{\csname theauthor#1\endcsname}
638 \def\theaddress#1{\csname theaddress#1\endcsname}
639 \def\thenetaddress#1{\csname thenetaddress#1\endcsname}
640 \def\thePersonalURL#1{\csname thePersonalURL#1\endcsname}

The standard way of listing authors is to iterate from 1 to \count@ and to pick the author names as we go.

641 ⟨!latex⟩\newcount\@tempcnta
642 \def\@defaultauthorlist{%
643 \count@\authornumber
644 \advance\count@ by -2
645 \@tempcnta0

Loop to output the first n − 2 of the n authors (the loop does nothing if there are two or fewer authors)

646 \loop
647 \ifnum\count@>0
648  \advance\@tempcnta by \@ne
649  \ignorespaces\theauthor{\number\@tempcnta}\unskip,
650  \advance\count@ by \m@ne
651 \repeat
652 \count@\authornumber
653 \advance\count@ by -\@tempcnta
654 \ifnum\authornumber>0

If there are two or more authors, we output the penultimate author’s name here, followed by ‘and’

655  \ifnum\count@>1
656  \count@\authornumber

657  \advance\count@ by \m@ne
658  \ignorespaces\theauthor{\number\count@}\unskip\ and
659  \fi

Finally (if there were any authors at all) output the last author’s name:

660  \ignorespaces\theauthor{\number\authornumber}\unskip
661 \fi

662 }

Signature blocks. The author can (in principle) define a different sort of signature block using \signature, though this could well cause the editorial group to have collective kittens (unless it had been discussed in advance…)

663 \def\signature#1{\def\@signature{#1}}
664 \def\@signature{\@defaultsignature}

\@defaultsignature loops through all the authors, outputting the details we have about that author; this is (as its name implies) the default body for

 \makesignature
665 \def\@defaultsignature{%
666 \count@=0
667 \loop
668 \ifnum\count@<\authornumber
669  \medskip
670  \advance\count@ by \@ne
671  \signaturemark
672  \theauthor{\number\count@}\\
673  \theaddress{\number\count@}\\

674 {%

675  \allowhyphens
676  \thenetaddress{\number\count@}\\
677  \thePersonalURL{\number\count@}\\

678 }%

679 \repeat

680 }

681 \newdimen\signaturewidth   \signaturewidth=12pc
682 \def\makesignature{%
683 \par
684 \penalty9000
685 \medskip
686 \rightline{%
687  \vbox{\hsize\signaturewidth \ninepoint \raggedright
688  \parindent \z@ \everypar={\hangindent 1pc }
689  \parskip \z@skip
690  \def\|{\unskip\hfil\break}%
691  \def\\{\endgraf}%
692  \def\phone{\rm Phone: }
693  \rm\@signature}}

694 }

695 \def\signaturemark{\leavevmode\llap{$\diamond$\enspace}}

The code used to define the following:

    {\makeactive\@
     \gdef\signatureat{\makeactive\@\def@{\char"40\discretionary{}{}{}}}
     \makeactive\%

    \gdef\signaturepercent{\makeactive\%\def%{\char"25\discretionary{}{}{}}}
   }

However, they were never used within the class (or within ltugproc.cls). They have therefore been deleted; the identically defined \netaddrat and \netaddrpercent may be used in the unlikely event that they’re needed elsewhere.

Now all the awful machinery of author definitions. \authornumber records the number of authors we have recorded to date.

696 \newcount\authornumber
697 \authornumber=0

\author ‘allocates’ another author name (by bumping \authornumber) and also sets up the address and netaddress for this author to produce a warning and to prevent oddities if they’re invoked. This last assumes that invocation will be

in the context of \signature (ltugboat.cls) or \maketitle (ltugproc.cls);

in both cases, invocation is followed by a line break (tabular line break \\ in

ltugproc, \endgraf in \makesignature in ltugboat).
698 \def\author#1{%
699 \global\advance\authornumber\@ne
700 \expandafter\def\csname theauthor\number\authornumber\endcsname
701  {\ignorespaces#1\unskip}%
702 \expandafter\def\csname theaddress\number\authornumber\endcsname
703  {\TBWarning{Address for #1\space missing}\@gobble}%
704 \expandafter\def\csname thenetaddress\number\authornumber\endcsname
705  {\TBWarning{Net address for #1\space missing}\@gobble}%
706 \expandafter\let\csname thePersonalURL\number\authornumber\endcsname
707  \@gobble

708 }

\address simply copies its argument into the \theaddress<n> for this author.

709 \def\address#1{%
710 \expandafter\def\csname theaddress\number\authornumber\endcsname
711  {\leavevmode\ignorespaces#1\unskip}}

\network is for use within the optional argument of \netaddress; it defines the name of the network the user is on.

Comment: I think this is a fantasy, since everyone (in practice, nowadays) quotes an internet address. In principle, there are people who will quote X.400 addresses (but they’re few and far between) and I have (during 1995!) seen an address with an UUCP bang-path component on comp.text.tex, but really!

712 \def\network#1{\def\@network{#1: }}

\netaddress begins a group, executes an optional argument (which should not, presumably, contain global commands) and then relays to \@relay@netaddress with both @ and % made active (so that they can be discretionary points in the address). If we’re using L^{A}TEX 2ε, we use the default-argument form of \newcommand; otherwise we write it out in all its horribleness.

713 ⟨∗latex2e⟩

714 \newcommand\netaddress[1][\relax]{%
715 \begingroup
716 \def\@network{}%

717 ⟨/latex2e⟩ 718 ⟨∗!latex2e⟩

719 \def\netaddress{%
720 \begingroup
721 \def\@network{}%
722 \@ifnextchar[{\@netaddress}{\@netaddress[]}%]

723 }

724 \def\@netaddress[#1]{%}

725 ⟨/!latex2e⟩

Unfortunately, because of the catcode hackery, we have still to do one stage of relaying within our own code, even if we’re using L^{A}TEX 2ε.

726 #1\@sanitize\makespace\ \makeactive\@
727 \makeactive\.\makeactive\%\@relay@netaddress}%

\@relay@netaddress finishes the job. It sets \thenetaddress for this author to contain the network name followed by the address. As a result of our kerfuffle above, @ and % are active at the point we’re entered. We ensure they’re active when \thenetaddress gets expanded, too. (WOT?!)

728 \def\@relay@netaddress#1{%
729 \ProtectNetChars

730 ⟨∗!latex2e⟩

731 \expandafter\xdef\csname thenetaddress\number\authornumber\endcsname
732  {\leavevmode{\noexpand\rm\@network}%
733  {\noexpand\NetAddrChars\noexpand\net
734  \ignorespaces#1\unskip}}%

735 ⟨/!latex2e⟩ 736 ⟨∗latex2e⟩

737 \expandafter\protected@xdef
738  \csname thenetaddress\number\authornumber\endcsname
739  {\protect\leavevmode\textrm{\@network}%
740  {\protect\NetAddrChars\net
741  \ignorespaces#1\unskip}}%

742 ⟨/latex2e⟩

743 \endgroup

744 }

\personalURL is in essence the same as \netaddress, apart from (1) the lack of the eccentric optional argument, and (2) the activation of ‘/’.

We could imagine needing an \URL command in general. If so, we must remember that the code here would naturally permit a break between the last two characters of http://, and some sort of special action must be taken to ensure that it doesn’t happen.

745 \def\personalURL{\begingroup
746 \@sanitize\makespace\ \makeactive\@
747 \makeactive\.\makeactive\%\makeactive\/\@personalURL}%
748 \def\@personalURL#1{%
749 \ProtectNetChars

750 ⟨∗!latex2e⟩

751 \expandafter\xdef\csname thePersonalURL\number\authornumber\endcsname
752 {\leavevmode{\noexpand\rm URL\noexpand\@: }%

753 {\noexpand\URLchars\noexpand\net
754  \ignorespaces#1\unskip}}%

755 ⟨/!latex2e⟩ 756 ⟨∗latex2e⟩

757 \expandafter\protected@xdef
758  \csname thePersonalURL\number\authornumber\endcsname
759 {\protect\leavevmode\textrm{\acro{URL}: }%
760  {\protect\URLchars\net
761  \ignorespaces#1\unskip}}%

762 ⟨/latex2e⟩

763 \endgroup

764 }

Define the activation mechanism for ‘@’, ‘%’, ‘.’ and ‘/’, for use in the above. Note that, since the code has ‘%’ active, we have ‘*’ as a comment character, which has a tendency to make things look peculiar…

765 {%

766 \makecomment\*
767 \makeactive\@
768 \gdef\netaddrat{\makeactive\@*
769  \def@{\discretionary{\char"40}{}{\char"40}}}
770 \makeactive\%
771 \gdef\netaddrpercent{\makeactive\%*
772  \def%{\discretionary{\char"25}{}{\char"25}}}
773 \makeactive\.
774 \gdef\netaddrdot{\makeactive\.*
775  \def.{\discretionary{\char"2E}{}{\char"2E}}}

\NetAddrChars is what we use (we’re constrained to retain the old interface to this stuff, but it is clunky…). Since URLs are a new idea, we are at liberty not to define a separate \netaddrslash command, and we only have \URLchars.

776 \gdef\NetAddrChars{\netaddrat \netaddrpercent \netaddrdot}
777 \makeactive\/
778 \gdef\URLchars{*
779  \NetAddrChars
780  \makeactive\/*
781  \def/{\discretionary{\char"2F}{}{\char"2F}}}

\ProtectNetChars includes protecting ‘/’, since this does no harm in the case of net addresses (where it’s not going to be active) and we thereby gain by not having yet another csname.

782 \gdef\ProtectNetChars{*

783 ⟨∗!latex2e⟩

784  \def@{\noexpand@}*
785  \def%{\noexpand%}*
786  \def.{\noexpand.}*
787  \def/{\noexpand/}*

788 ⟨/!latex2e⟩ 789 ⟨∗latex2e⟩

790  \def@{\protect@}*
791  \def%{\protect%}*
792  \def.{\protect.}*
793  \def/{\protect/}*

794 ⟨/latex2e⟩ 796 }

In L^{A}TEX2.09, there’s no inhibition against simply saying the following:

797 ⟨!latex2e⟩\def\net{\tt}

L^{A}TEX 2ε, on the other hand (in its wisdom), suppresses \DeclareOldFontCommand when in compatibility mode, so that in that circumstance we need to use a declaration copied from latex209.def rather than the way we would normally do the thing (using the command L^{A}TEX 2ε defines for the job).

798 ⟨∗latex2e⟩

799 \if@compatibility
800 \DeclareRobustCommand\net{\normalfont\ttfamily\mathgroup\symtypewriter}
801 \else
802 \DeclareOldFontCommand{\net}{\ttfamily\upshape\mdseries}{\mathtt}
803 \fi

804 ⟨/latex2e⟩

805 \def\authorlist#1{\def\@author{#1}}
806 \def\@author{\@defaultauthorlist}

Provide machinery to skip extra space, even one or more full columns, above the top of an article to leave space to paste up a previous article that has finished on the same page. This is a fall back to accommodate the fact that multiple articles cannot yet be run together easily with L^{A}TEX 2ε.

807 \def\maketitle{\par
808 \ifdim\PreTitleDrop > \z@
809 \loop
810 \ifdim \PreTitleDrop > \textheight
811  \vbox{}\vfil\eject
812  \advance\PreTitleDrop by -\textheight
813 \repeat
814 \vbox to \PreTitleDrop{}
815 \global\PreTitleDrop=\z@
816 \fi
817 \begingroup
818 \setcounter{footnote}{0}
819 \def\thefootnote{\fnsymbol{footnote}}
820 \@maketitle
821 \@thanks
822 \endgroup
823 \setcounter{footnote}{0}
824 \gdef\@thanks{}

825 }

3.12 Section titles

The following macros are used to set the large TUGboat section heads (e.g. “General Delivery”, “Fonts”, etc.)

Define the distance between articles which are run together:

826 \def\secsep{\vskip 5\baselineskip}

Note that \stbaselineskip is used in the definition of \sectitlefont, in L^{A}TEX 2ε, so that it has (at least) to be defined before \sectitlefont is used (we do the whole job).

827 \newdimen\stbaselineskip        \stbaselineskip=18\p@
828 \newdimen\stfontheight

829 ⟨∗!latex2e⟩

830 \setbox\T@stBox=\hbox{\sectitlefont O}
831 \stfontheight=\ht\T@stBox

832 ⟨/!latex2e⟩

833 ⟨latex2e⟩ \settoheight{\stfontheight}{\sectitlefont O}

Declaring section titles; the conditional \ifSecTitle records the occurence of a \sectitle command. If (when) a subsequent \maketitle occurs, the section title box will get flushed out; as a result of this, one could in principle have a set of \sectitle commands in a semi-fixed steering file, and inclusions of files inserted only as and when papers have appeared. Only the last \sectitle will actually be executed.

834 \newif\ifSecTitle
835 \SecTitlefalse
836 \newif\ifWideSecTitle
837 \newcommand\sectitle{%
838 \SecTitletrue
839 \@ifstar
840  {\WideSecTitletrue\def\s@ctitle}%
841  {\WideSecTitlefalse\def\s@ctitle}%

842 }

\PreTitleDrop records the amount of column-space we need to eject before we start any given paper. It gets zeroed after that ejection has happened.

843 \newdimen\PreTitleDrop   \PreTitleDrop=\z@

The other parameters used in \@sectitle; I don’t think there’s the slightest requirement for them to be registers (since they’re constant values, AFAIK), but converting them to macros would remove the essentially useless functionality of being able to change them using assignment, which I’m not about to struggle with just now...

    \AboveTitleSkip and \BelowTitleSkip are what you’ld expect; \strulethickness

is the value to use for \fboxrule when setting the title.

844 \newskip\AboveTitleSkip  \AboveTitleSkip=12\p@
845 \newskip\BelowTitleSkip  \BelowTitleSkip=8\p@
846 \newdimen\strulethickness       \strulethickness=.6\p@

\@sectitle actually generates the section title (in a rather generous box). It gets called from \maketitle under conditional \ifSecTitle; by the time \@sectitle takes control, we already have \SecTitlefalse. This implementation uses L^{A}TEX’s \framebox command, on the grounds that one doesn’t keep a dog and bark for oneself…

847 \def\@sectitle #1{%
848 \par
849 \penalty-1000

If we’re setting a wide title, the stuff will be at the top of a page (let alone a column) but inside a box, so that the separator won’t be discardable: so don’t create the separator in this case.

850 \ifWideSecTitle\else\secsep\fi

851 {%

852  \fboxrule\strulethickness
853  \fboxsep\z@
854  \noindent\framebox[\hsize]{%
855  \raggedcenter
856  \def\\{\unskip\break}%
857  \sectitlefont
858  \makestrut[2\stfontheight;\z@]%
859  #1%
860  \makestrut[\z@;\stfontheight]\endgraf

861 }% 862 }%

863 \nobreak
864 \vskip\baselineskip

865 }

866 \def\@maketitle{\ifSecTitle
867  \global\SecTitlefalse
868  \ifWideSecTitle
869  \twocolumn[\@sectitle{\s@ctitle}]%
870  \global\WideSecTitlefalse
871  \else
872  \@sectitle{\s@ctitle}%
873  \fi
874 \else
875  \vskip\AboveTitleSkip
876  \kern\topskip
877  \hrule \@height\z@ \@depth\z@ \@width 10\p@
878  \kern-\topskip
879  \kern-\strulethickness
880  \hrule \@height\strulethickness \@depth\z@
881  \kern\medskipamount
882  \nobreak
883 \fi

884 {%

885  \nohyphens \interlinepenalty\@M
886  \setbox0=\hbox{%
887  \let\thanks\@gobble
888  \let\\=\quad
889  \let\and=\quad
890  \ignorespaces\@author}%

891 {%

892  \noindent\bf\raggedright\ignorespaces\@title\endgraf

893 }%

894  \ifdim \wd0 < 5\p@               % omit if author is null
895  \else
 Since we have \BelowTitleSkip + 4pt = \baselineskip, we say:
896  \nobreak \vskip 4\p@

897 {%

898  \leftskip=\normalparindent
899  \raggedright
900  \def\and{\unskip\\}%
901  \noindent\@author\endgraf

902 }%

903  \fi

904  \nobreak
905  \vskip\BelowTitleSkip

906 }%

907 \global\@afterindentfalse
908 \aftergroup\@afterheading

909 }

Dedications are ragged right, in italics.

910 ⟨∗!latex2e⟩

911 \def\dedication{\bgroup\raggedright\let\MF=\slMF
912  \noindent\it\ignorespaces}
913 \def\enddedication{\endgraf\egroup\medskip}

914 ⟨/!latex2e⟩ 915 ⟨∗latex2e⟩

916 \newenvironment{dedication}%
917 {\raggedright\noindent\itshape\ignorespaces}%
918 {\endgraf\medskip}

919 ⟨/latex2e⟩

     The abstract and longabstract environments both use \section*.

920 ⟨∗!latex2e⟩

921 \def\abstract{
922 \section*{Abstract}

923 }

924 \def\endabstract{}

925 ⟨/!latex2e⟩ 926 ⟨∗latex2e⟩

927 \renewenvironment{abstract}%
928 {\section*{Abstract}}%

929 {} 930 ⟨/latex2e⟩ 931 ⟨∗!latex2e⟩

932 \def\longabstract{
933 \section*{Abstract}
934 \bgroup\small}
935 \def\endlongabstract{\endgraf\egroup

936 ⟨/!latex2e⟩ 937 ⟨∗latex2e⟩

938 \newenvironment{longabstract}%
939 {\section*{Abstract}
940 \bgroup\small}%
941 {\endgraf\egroup

942 ⟨/latex2e⟩

943 \vspace{.25\baselineskip}
944 \begin{center}
945  {$--*--$}
946 \end{center}
947 \vspace{.5\baselineskip}}

3.13 Headings

Redefine style of section headings to match TUGboat’s defined styles. \vskip 8pt \vskip\parskip before; \vskip 4pt after. Negative beforeskip suppresses following parindent.

These macros are called \*head in the plain styles.

Relaying via \TB@startsection detects inappropriate use of \section*. Of course, if (when) we use it, we need to avoid that relaying; this can be done by

 \letting \TB@startsection to \@startsection, within a group.

First the version for use in the default case, when class option numbersec is in effect.

948 \if@numbersec
949 \def\section{\@startsection {section}%

950 1%

951  \z@
952  {-8\p@}%
953  {4\p@}%
954  {\normalsize\bf\raggedright\hyphenpenalty=\@M}}
955 \def\subsection{\TB@startsection{{subsection}%

956 2%

957  \z@
958  {-8\p@}%
959  {4\p@}%
960  {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
961 \def\subsubsection{\TB@startsection{{subsubsection}%

962 3%

963  \z@
964  {-8\p@}%
965  {4\p@}%
966  {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
967 \def\paragraph{\TB@startsection{{paragraph}%

968 4%

969  \z@
970  {2.5ex\@plus 1ex}%
971  {-1em}%
972  {\normalsize\bf}}}

Now the version if class option nonumber is in effect, i.e., if \if@numbersec is false.

973 \else
974 \setcounter{secnumdepth}0
975 \def\section{\TB@nolimelabel
976  \TB@startsection{{section}%

977 1%

978  \z@
979  {-8\p@}%
980  {4\p@}%
981  {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
982 \def\subsection{\TB@nolimelabel
983  \TB@startsection{{subsection}%

984 2%

985  \z@
986  {-8\p@}%
987  {-0.5em\@plus-\fontdimen3\font}%
988  {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
989 \def\subsubsection{\TB@nolimelabel
990  \TB@startsection{{subsubsection}%

991 3%

 992  \parindent
 993  {-8\p@}%
 994  {-0.5em\@plus-\fontdimen3\font}%
 995  {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
 996 \fi

\TB@startsection traps * versions of sectioning commands. Its argument is the complete set of \@startsection arguments.

 997 \def\TB@startsection#1{\@ifstar
 998 {\TBWarning{*-form of \expandafter\string\csname\@firstofsix#1%
 999  \endcsname\space inappropriate}%
1000 \@startsection#1}%
1001 {\@startsection#1}}
1002 \def\@firstofsix#1#2#3#4#5#6{#1}
     \TB@safe@startsection is to be used where \section* (etc.) appear in

places where the request is OK (because it’s built in to some macro we don’t fiddle with).

1003 \def\TB@safe@startsection#1{\@startsection#1}

And now for the exciting sectioning commands that L^{A}TEX defines but we don’t have a definition for (whatever else, we don’t want Lamport’s originals, which come out ‘like the blare of a bugle in a lullaby’^{1}).

The three inappropriate ones are subparagraph (indistinguishable from paragraph), and chapter and part. The last seemed almost to be defined in an early version of these macros, since there was a definition of \l@part. I’ve not got down to where that came from (or why). If class option nonumber is in effect, we also suppress \paragraph, since it has no parallel in the plain style.

1004 \if@numbersec
1005 \def\subparagraph{\TB@nosection\subparagraph\paragraph}
1006 \else
1007 \def\paragraph{\TB@nosection\paragraph\subsubectgion}
1008 \def\subparagraph{\TB@nosection\subparagraph\subsubsection}

1009 \fi

1010 \def\chapter{\TB@nosection\chapter\section}
1011 \def\part{\TB@nosection\part\section}
1012 \def\TB@nosection#1#2{\TBWarning{class does not support \string#1,
1013  \string#2\ used instead}#2}

\l@<sectioning-name> is for table of contents (of an article). Don’t ask me (RF) why \l@part is there; I commented it out because I couldn’t understand why it had been left there for me. To be finally deleted in a future release of these macros…

1014 %\def\l@part#1#2{\addpenalty{\@secpenalty}%
1015 %  \addvspace{2.25em\@plus\p@}%
1016 %  \begingroup
1017 %    \@tempdima 3em \parindent\z@ \rightskip\z@ \parfillskip\z@
1018 %    {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
1019 %    \nobreak
1020 %  \endgroup}
1021 \def\l@section#1#2{\addpenalty{\@secpenalty}%
1022 \addvspace{1.0em\@plus\p@}%

1Thurber, The Wonderful O

1023 \@tempdima 1.5em
1024 \begingroup
1025  \parindent\z@ \rightskip\z@  % article style makes \rightskip > 0
1026  \parfillskip\z@
1027  \bf\leavevmode\advance\leftskip\@tempdima\hskip-\leftskip#1\nobreak\hfil
1028  \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
1029 \endgroup}

3.14 References

Since the sections aren’t numbered, the natural tendency of the author to crossreference (which, after all, is one of the things L^{A}TEX is for ever being advertised as being good at) can cause headaches for the editor. (Yes it can; believe me … there’s always one.)

The following command is used by each of the sectioning commands to make a following \ref command bloop at the author. Even if the author then ignores the complaint, the poor old editor may find the offending \label rather more easily.

(Note that macro name is to be read as “noli me label” (I don’t know the mediæval Latin for ‘label’).

Comment To come (perhaps): detection of the act of labelling, and an analogue of \ifG@refundefined for this sort of label

1030 \def\TB@nolimelabel{\def\@currentlabel{\protect\TBWarning
1031  {Invalid label on page \thepage\space used}%
1032  \textbf{?!?}}}

3.15 Float captions

By analogy with what we’ve just done to section titles and the like, we now do our best to discourage hyphenation within captions.

1033 \long\def\@makecaption#1#2{%
1034 \vskip\abovecaptionskip
1035 \sbox\@tempboxa{#1: #2}%
1036 \ifdim \wd\@tempboxa >\hsize
1037  \raggedright\hyphenpenalty=\@M
1038  #1: #2\par
1039 \else
1040  \global \@minipagefalse
1041  \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%

1042 \fi

1043 \vskip\belowcaptionskip}

3.16 Size changing commands

Apart from their ‘normal’ effects, these commands are

1044 \renewcommand\normalsize{%
1045 \@setfontsize\normalsize\@xpt\@xiipt
1046 \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
1047 \belowdisplayskip=\abovedisplayskip
1048 \abovedisplayshortskip=\z@\@plus 3\p@

1049 \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@

1050 }

1051

1052 \renewcommand\small{%
1053 \@setfontsize\small\@ixpt{11}%
1054 \abovedisplayskip=2.5\p@\@plus 2.5\p@\@minus\p@
1055 \belowdisplayskip=\abovedisplayskip
1056 \abovedisplayshortskip=\z@\@plus 2\p@
1057 \belowdisplayshortskip=\p@\@plus 2\p@\@minus\p@

1058 }

1059 \renewcommand\footnotesize{%
1060  \@setfontsize\footnotesize\@viiipt{9.5}%
1061  \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
1062  \belowdisplayskip=\abovedisplayskip
1063  \abovedisplayshortskip=\z@\@plus 3\p@
1064  \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@

1065 }

3.17 Lists and other text inclusions

1066 \def\@listi{%
1067 \leftmargin\leftmargini\parsep=\p@\@plus\p@\@minus\p@
1068 \itemsep=\parsep
1069 \listparindent=1em

1070 }

1071

1072 \def\@listii{%
1073 \leftmargin\leftmarginii
1074 \labelwidth=\leftmarginii \advance\labelwidth-\labelsep
1075 \topsep=2\p@\@plus\p@\@minus\p@
1076 \parsep=\p@\@plus\p@\@minus\p@
1077 \itemsep=\parsep
1078 \listparindent=1em

1079 }

1080

1081 \def\@listiii{%
1082 \leftmargin=\leftmarginiii
1083 \labelwidth=\leftmarginiii \advance\labelwidth-\labelsep
1084 \topsep=\p@\@plus\p@\@minus\p@
1085 \parsep=\z@
1086 \itemsep=\topsep
1087 \listparindent=1em

1088 }

1089 \def\quote{\list{}{\rightmargin.5\leftmargin}\item[]}

From Dominik Wujastyk’s font article. First paragraph of a quotation will not be indented, and right margin is decreased for narrow columns.

1090 \renewcommand{\quotation}{\list{}{\listparindent 1.5em
1091  \rightmargin.5\leftmargin\parsep \z@\@plus\p@}\item[]}

3.18 Some fun with verbatim

The plain TUGboat style allows [optional] arguments to its \verbatim command. This will allow the author (or editor) to specify a range of exciting features; we would definitely like the numbered verbatim style for code (that facility is reserved for a future version of this package), and the present little bit of code imposes the \ruled option on the built-in verbatim environment. (Note that we don’t yet deal with verbatim∗, which is in itself an option to the plain original.)

We start by saving various bits and bobs whose operation we’re going to subvert.

1092 %\let\@TB@verbatim\@verbatim
1093 \let\@TBverbatim\verbatim
1094 \let\@TBendverbatim\endverbatim

Impose an optional argument on the environment.

1095 \def\verbatim{\futurelet\reserved@a\@switch@sqbverbatim}
1096 \def\@switch@sqbverbatim{\ifx\reserved@a[%]
1097 \expandafter\@sqbverbatim\else
1098 \def\reserved@b{\@sqbverbatim[]}\expandafter\reserved@b\fi}
1099 \def\@sqbverbatim[#1]{%

The optional argument consists entirely of functions that modify the appearance of the environment. Following the plain style, we define the functions we can execute in the optional argument here.

The command \ruled tells us that there should be rules above and below the verbatim block.

1100 \def\ruled{\let\if@ruled\iftrue}%

Then we just execute the ones we’ve got, and relay to a (hacked) copy of the built-in environment.

1101 #1\@TBverbatim}

The built-in environment itself relays to \@verbatim, which we’ve subverted to impose our views on appearance.

1102 \def\@verbatim{%

First, we deal with \ruled:

1103  \if@ruled\trivlist\item\hrule\kern5\p@\nobreak\fi

Now, the code out of the original verbatim environment:

1104 \trivlist \item\relax
1105 \if@minipage\else\vskip\parskip\fi
1106 \leftskip\@totalleftmargin\rightskip\z@skip
1107 \parindent\z@\parfillskip\@flushglue\parskip\z@skip
1108 \@@par
1109 \@tempswafalse
1110 \def\par{%
1111  \if@tempswa
1112  \leavevmode \null \@@par\penalty\interlinepenalty
1113  \else
1114  \@tempswatrue
1115  \ifhmode\@@par\penalty\interlinepenalty\fi
1116  \fi}%
1117 \obeylines \verbatim@font \@noligs
1118 \let\do\@makeother \dospecials
1119 \everypar \expandafter{\the\everypar \unpenalty}%

1120 }%

To end the environment, we do everything in reverse order: relay via the copy we made of \endveratim, and then finish off the option changes (again \ruled only, so far).

1121 \def\endverbatim{\@TBendverbatim
1122 \if@ruled\kern5\p@\hrule\endtrivlist\fi}

\enablemetacode simply typesets^{2} something that looks (verbatim) like:

       <meta-text>

as:

⟨meta-text⟩

1123 {\makeactive<
1124 \gdef<#1>{{\reset@font\ensuremath{\langle}%
1125  \textit{#1}%
1126  \ensuremath{\rangle}}}

1127 }

Finally, we define the \if used by the \ruled option

1128 \let\if@ruled\iffalse

3.19 Bibliography

This is more or less copied verbatim from Glenn Paulley’s chicago.sty (gnpaulle@ bluebox.uwaterloo.ca). It produces an author-year citation style bibliography, using output from the BibTEX style file based on that by Patrick Daly. It needs extra macros beyond those in standard L^{A}TEX to function properly. The form of the bibitem entries is:

   \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith}
        {Jones et al.}{1990}{key}...

The available citation commands are:

\cite{key}  → (Jones, Baker, and Smith 1990)
\citeA{key}  → (Jones, Baker, and Smith)
\citeNP{key} → Jones, Baker, and Smith 1990
\citeANP{key} → Jones, Baker, and Smith
\citeN{key}  → Jones, Baker, and Smith (1990)
\shortcite  → (Jones et al. 1990)

     \citeyear  → (1990)
     \citeyearNP  → 1990

First of all (after checking that we’re to use Harvard citation at all), make a copy of L^{A}TEX’s default citation mechanism.

1129 \if@Harvardcite
1130 \let\@internalcite\cite

Normal forms.

1131 \def\cite{\def\@citeseppen{-1000}%
1132  \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
1133  \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
1134 \def\citeNP{\def\@citeseppen{-1000}%
1135  \def\@cite##1##2{##1\if@tempswa , ##2\fi}%

2Or will simply typeset, when we get around to implementation proper

1136  \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
1137 \def\citeN{\def\@citeseppen{-1000}%
1138  \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
1139  \def\citeauthoryear##1##2##3{##1 (##3}\@citedata}
1140 \def\citeA{\def\@citeseppen{-1000}%
1141  \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
1142  \def\citeauthoryear##1##2##3{##1}\@internalcite}
1143 \def\citeANP{\def\@citeseppen{-1000}%
1144  \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1145  \def\citeauthoryear##1##2##3{##1}\@internalcite}

Abbreviated forms (using et al.)

1146 \def\shortcite{\def\@citeseppen{-1000}%
1147  \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
1148  \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
1149 \def\shortciteNP{\def\@citeseppen{-1000}%
1150  \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1151  \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
1152 \def\shortciteN{\def\@citeseppen{-1000}%
1153  \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
1154  \def\citeauthoryear##1##2##3{##2 (##3}\@citedata}
1155 \def\shortciteA{\def\@citeseppen{-1000}%
1156  \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
1157  \def\citeauthoryear##1##2##3{##2}\@internalcite}
1158 \def\shortciteANP{\def\@citeseppen{-1000}%
1159  \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1160  \def\citeauthoryear##1##2##3{##2}\@internalcite}

When just the year is needed:

1161 \def\citeyear{\def\@citeseppen{-1000}%
1162  \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
1163  \def\citeauthoryear##1##2##3{##3}\@citedata}
1164 \def\citeyearNP{\def\@citeseppen{-1000}%
1165  \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1166  \def\citeauthoryear##1##2##3{##3}\@citedata}

Place commas in-between citations in the same \citeyear, \citeyearNP, \citeN,

  or \shortciteN command. Use something like \citeN{ref1,ref2,ref3} and
  \citeN{ref4} for a list.
1167 \def\@citedata{%
1168  \@ifnextchar [{\@tempswatrue\@citedatax}%
1169  {\@tempswafalse\@citedatax[]}%

1170 }

1171

1172 \def\@citedatax[#1]#2{%
1173 \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
1174 \def\@citea{}\@cite{\@for\@citeb:=#2\do%
1175  {\@citea\def\@citea{, }\@ifundefined% by Young
1176  {b@\@citeb}{{\bf ?}%
1177  \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
1178 {\csname b@\@citeb\endcsname}}}{#1}}%

Don’t box citations, separate with ; and a space; Make the penalty between citations negative: a good place to break.

1179 \def\@citex[#1]#2{%

1180 \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
1181 \def\@citea{}\@cite{\@for\@citeb:=#2\do%
1182  {\@citea\def\@citea{; }\@ifundefined% by Young
1183  {b@\@citeb}{{\bf ?}%
1184  \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
1185 {\csname b@\@citeb\endcsname}}}{#1}}%

No labels in the bibliography.

1186 \def\@biblabel#1{}

Set length of hanging indentation for bibliography entries.

1187 \newlength{\bibhang}
1188 \setlength{\bibhang}{2em}

Indent second and subsequent lines of bibliographic entries. Stolen from openbib.sty: \newblock is set to {}.

1189 \newdimen\bibindent
1190 \bibindent=1.5em
1191 \@ifundefined{refname}%
1192 {\newcommand{\refname}{References}}%

1193 {}%

For safety’s sake, suppress the \TB@startsection warnings here…

1194 \def\thebibliography#1{\let\TB@startsection\TB@safe@startsection
1195 \section*{\refname\@mkboth
1196 {\uppercase{\refname}}{\uppercase{\refname}}}\list
1197 {[\arabic{enumi}]}{%
1198 \labelwidth\z@ \labelsep\z@
1199 \leftmargin\bibindent
1200 \itemindent -\bibindent
1201 \listparindent \itemindent
1202 \parsep \z@
1203 \usecounter{enumi}}
1204 \def\newblock{}
1205 \sloppy
1206 \sfcode`\.=1000\relax}
1207 \def\etal{et\,al.\@}
1208 \def\bibentry{\smallskip
1209  \hangindent=\parindent
1210  \hangafter=1
1211  \noindent
1212  \sloppy
1213  \clubpenalty500 \widowpenalty500
1214  \frenchspacing}

Note changes made to accommodate TUB file naming conventions

1215 \def\bibliography#1{%
1216 \if@filesw\immediate\write\@auxout{\string\bibdata{\@tubfilename{#1}}}\fi
1217 \@input{\jobname.bbl}}

1218

1219 \def\bibliographystyle#1{\if@filesw\immediate\write\@auxout
1220  {\string\bibstyle{\@tubfilename{#1}}}\fi}

If the user’s asked to use L^{A}TEX’s default citation mechanism (using the rawcite option), we still need to play with \TB@startsection: this is a boring fact of life…

1221 \else
1222 \let\TB@save@thebibliography\thebibliography
1223 \def\thebibliography{\let\TB@startsection\TB@safe@startsection
1224 \TB@save@thebibliography}

1225 \fi

3.20 Registration marks

1226 \def\HorzR@gisterRule{\vrule \@height 0.2\p@ \@depth\z@ \@width 0.5in }
1227 \def\DownShortR@gisterRule{\vrule \@height 0.2\p@ \@depth 1pc \@width 0.2\p@ }
1228 \def\UpShortR@gisterRule{\vrule \@height 1pc \@depth\z@ \@width 0.2\p@ }

“T” marks centered on top and bottom edges of paper

1229 \def\ttopregister{\dlap{%
1230  \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
1231  \HorzR@gisterRule \hfil \HorzR@gisterRule}%
1232  \hb@xt@\trimwd{\hfil \DownShortR@gisterRule \hfil}}}
1233 \def\tbotregister{\ulap{%
1234  \hb@xt@\trimwd{\hfil \UpShortR@gisterRule \hfil}%
1235  \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
1236  \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
1237 \def\topregister{\ttopregister}
1238 \def\botregister{\tbotregister}

3.21 Running heads

1239 ⟨!latex2e⟩\def \rtitlex{\def\tubfont{\normalsize\rm}\TUB, \volx }
1240 ⟨latex2e⟩\def \rtitlex{\def\texttub##1{{\normalsize\textrm{##1}}}\TUB, \volx }

1241

1242 \def\PrelimDraftfooter{%
1243 \dlap{\kern\textheight\kern3pc
1244  \rlap{\hb@xt@\pagewd{\midrtitle\hfil\midrtitle}}

1245 }}

1246

registration marks; these are temporarily inserted in the running head

1247 \def\MakeRegistrationMarks{}
1248 \def\UseTrimMarks{%
1249 \def\MakeRegistrationMarks{%
1250  \ulap{\rlap{%
1251  \vbox{\dlap{\vbox to\trimlgt{\vfil\botregister}}%
1252  \topregister\vskip \headmargin \vskip 10\p@}}}}%

1253 }

1254

1255 \def\@oddhead{\MakeRegistrationMarks\PrelimDraftfooter
1256 \normalsize\csname normalshape\endcsname\rm
1257 \rtitlex\qquad\midrtitle \hfil \thepage}
1258 \def\@evenhead{\MakeRegistrationMarks\PrelimDraftfooter
1259 \normalsize\csname normalshape\endcsname\rm
1260 \thepage\hfil\midrtitle\qquad\rtitlex}
1261 \def\@oddfoot{}
1262 \def\@evenfoot{}
1263 \def\ps@headings{}
1264 \pagestyle{headings}

3.22 Output routine

Modified to alter \brokenpenalty across columns

Comment We’re playing with fire here: for example, \@outputdblcol has changed in L^{A}TEX 2ε for 1995/06/01 (with the use of \hb@xt@). This time there’s no semantic change, but…

1265 \def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse
1266  \global\setbox\@leftcolumn\box\@outputbox
1267  \global\brokenpenalty10000
1268 \else \global\@firstcolumntrue
1269  \global\brokenpenalty100
1270  \setbox\@outputbox\vbox{\hb@xt@\textwidth{\hb@xt@\columnwidth
1271  {\box\@leftcolumn \hss}\hfil \vrule \@width\columnseprule\hfil
1272  \hb@xt@\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
1273  \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
1274  \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
1275  \fi}

3.23 Font-related definitions and machinery

These are mostly for compatibility with plain tugboat.sty

1276 \newif\ifFirstPar       \FirstParfalse
1277 \def\smc{\sc}
1278 \def\ninepoint{\small}

\SMC isn’t small caps — Barbara Beeton says she thinks of it as “big small caps”. She says (modulo capitalisation of things…):

For the things it’s used for, regular small caps are not appropriate — they’re too small. Real small caps are appropriate for author names (and are so used in continental bibliographies), section headings, running heads, and, on occasion, words to which some emphasis is to be given. \SMC was designed to be used for acronyms and all-caps abbreviations, which look terrible in small caps, but nearly as bad in all caps in the regular text size. The principle of using “one size smaller” than the text size is similar to the design of caps in German — where they are smaller relative to lowercase than are caps in fonts intended for English, to improve the appearance of regular text in which caps are used at the heads of all nouns, not just at the beginnings of sentences.

We define this in terms of the memory of the size currently selected that’s maintained in \@currsize: if the user does something silly re. selecting fonts, we’ll get the wrong results. The following code is adapted from relsize.sty by Donald Arseneau and Matt Swift, from a 2.09 original by Bernie Cosell. (Note that the order of examination of \@currsize is to get the commonest cases out of the way first.)

1279 ⟨!latex2e⟩\def\SMC{\small}

1280 ⟨∗latex⟩ 1281 ⟨∗latex2e⟩

1282 \DeclareRobustCommand\SMC{%
1283 \ifx\@currsize\normalsize\small\else

1284 \ifx\@currsize\small\footnotesize\else
1285  \ifx\@currsize\footnotesize\scriptsize\else
1286  \ifx\@currsize\large\normalsize\else
1287  \ifx\@currsize\Large\large\else
1288  \ifx\@currsize\LARGE\Large\else
1289  \ifx\@currsize\scriptsize\tiny\else
1290  \ifx\@currsize\tiny\tiny\else
1291  \ifx\@currsize\huge\LARGE\else
1292  \ifx\@currsize\Huge\huge\else
1293  \small\SMC@unknown@warning
1294 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi

1295 }

1296 \newcommand\SMC@unknown@warning{\TBWarning{\string\SMC: unrecognised
1297  text font size command -- using \string\small}}
1298 \newcommand\textSMC[1]{{\SMC #1}}

The \acro command uses \SMC as it was originally intended. Note that, since most of these things are uppercase-only names, it fiddles with the spacefactor after inserting its text.

1299 \newcommand\acro[1]{\textSMC{#1}\@}

1300 ⟨/latex2e⟩

1301 ⟨!latex2e⟩\def\acro#1{{\SMC #1}\@}

1302 ⟨/latex⟩

1303 ⟨!latex⟩\def\acro#1{{\SMC #1}\spacefactor\@m}

3.24 Miscellaneous definitions

\EdNote allows the editor to enter notes in the text of a paper. If the command is given something that appears like an optional argument, the entire text of the note is placed in square brackets. (Yes, it really is!)

1304 \def\xEdNote{{\EdNoteFont Editor's note:\enspace }}
1305 \def \EdNote{\@ifnextchar[%]

1306 {%

1307  \ifvmode
1308  \smallskip\noindent\let\@EdNote@\@EdNote@v
1309  \else
1310  \unskip\quad\def\@EdNote@{\unskip\quad}%

1311 \fi

1312  \@EdNote

1313 }%

1314 \xEdNote

1315 }

1316 \long\def\@EdNote[#1]{%
1317 [\thinspace\xEdNote\ignorespaces

1318 #1%

1319 \unskip\thinspace]%
1320 \@EdNote@

1321 }

1322 \def\@EdNote@v{\par\smallskip}

Macros for Mittelbach’s self-documenting style

1323 \def\SelfDocumenting{%
1324 \setlength\textwidth{31pc}
1325 \onecolumn

1326 \parindent \z@
1327 \parskip 2\p@\@plus\p@\@minus\p@
1328 \oddsidemargin 8pc
1329 \evensidemargin 8pc
1330 \marginparwidth 8pc
1331 \toks@\expandafter{\@oddhead}%
1332 \xdef\@oddhead{\hss\hb@xt@\pagewd{\the\toks@}}%
1333 \toks@\expandafter{\@evenhead}%
1334 \xdef\@evenhead{\hss\hb@xt@\pagewd{\the\toks@}}%
1335 \def\ps@titlepage{}%

1336 }

1337 \def\ps@titlepage{}

1338

1339 \long\def\@makefntext#1{\parindent 1em\noindent\hb@xt@2em{}%
1340 \llap{\@makefnmark}\null$\mskip5mu$#1}

1341

1342 \def\fnum@figure{{\bf Figure \thefigure}}

3.25 Initialization

If we’re going to use Harvard-style bibliographies, we set up the bibliography style: the user doesn’t get any choice.

1343 \if@Harvardcite
1344 \AtBeginDocument{%
1345  \bibliographystyle{ltugbib}%

1346 } 1347 \fi

1348 \authornumber\z@
1349 \let\@signature\@defaultsignature
1350 \InputIfFileExists{ltugboat.cfg}{\TBInfo{Loading ltugboat
1351  configuration information}}{}

1352 ⟨/classtail⟩

4 L^{A}TEX 2ε Proceedings class

Make the code of ltugboat.cls (when we load it) say it’s really us:

1353 ⟨∗ltugproccls⟩

1354 \def\@tugclass{ltugproc}

For the case where we’re preparing the preprints, we may not have been able to prepare submissions for typesetting in two columns. In this case, therefore, we may need the option onecolumn, that will suppress the use of twocolumn setting within the article.

1355 \newif\if@proctw@column  \@proctw@columntrue
1356 \DeclareOption{onecolumn}{\@proctw@columnfalse}

TUG’96 proceedings switched to more sober headings still; so the tug95 option establishes the original state.

1357 \newif\if@proc@sober
1358 \DeclareOption{tug95}{\@proc@soberfalse}
1359 \DeclareOption{tug96}{\@proc@sobertrue}

There are these people who seem to think tugproc is an option as well as a class…

1360 \DeclareOption{tugproc}{%
1361 \ClassWarning{ltugproc}{Option \CurrentOption\space ignored}%

1362 }

Suppress class options numbersec and nonumber; they have no meaning, currently, in the proceedings style:

1363 \DeclareOption{numbersec}{\ds@tugproc}
1364 \DeclareOption{nonumber}{\ds@tugproc}

All other options are simply passed to ltugboat…

1365 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ltugboat}}

If there’s a tugproc defaults file, input it now: it may tell us which year we’re to perform for… (Note: this code is millenium-proof. It’s not terribly classy for years beyond 2069, but then I’m not going to be around then—this will be an interesting task for a future TEXie…)

1366 \InputIfFileExists{ltugproc.cfg}{\ClassInfo{ltugproc}%
1367  {Loading ltugproc configuration information}}{}

Now work out what year it is

1368 \@tempcnta\year
1369 \divide\@tempcnta by100
1370 \multiply\@tempcnta by100
1371 \advance\@tempcnta-\year
1372 \@tempcnta-\@tempcnta

And use that for calculating a year for us to use.

1373 \edef\@tempa{\noexpand\providecommand\noexpand\tugProcYear
1374  {\ifnum10>\@tempcnta0\fi\the\@tempcnta}}
1375 \@tempa
1376 \ClassInfo{ltugproc}{Proceedings defined for year
1377 \expandafter\ifnum\tugProcYear<70\relax20\else
1378  \expandafter\ifnum\tugProcYear>100\else19\fi\fi\tugProcYear}

Check that this is a sensible year. If not, make it the ‘most recent year we know about’.

1379 \expandafter\ifx\csname ds@tug\tugProcYear\endcsname\relax
1380 \def\tugProcYear{96}\fi

Now execute the default ‘year’ option and get on with processing. Note that this command gets ignored if the configuration file specifies a silly year.

1381 \ExecuteOptions{tug\tugProcYear}
1382 \ProcessOptions
1383 \LoadClass{ltugboat}

4.1 Proceedings titles

There’s no provision for ‘section titles’ in proceedings issues, as there are in TUGboat proper. Note the tedious L^{A}TEX bug-avoidance in the \@TB@test@document macro

1384 \def\maketitle{%

1385 \setcounter{footnote}{0}%
1386 \def\thefootnote{\fnsymbol{footnote}}%
1387 \if@proctw@column \twocolumn[\@maketitle]%
1388 \else             \onecolumn\@maketitle

1389 \fi

1390 \def\thefootnote{\arabic{footnote}}%
1391 \setcounter{footnote}{0}%

1392 }

\@TB@test@document checks to see, at entry to \maketitle, if we’ve had \begin{document}. See L^{A}TEX bug report latex/2212, submitted by Robin Fairbairns, for details.

1393 \def\@TB@test@document{%
1394 \edef\@tempa{\the\everypar}
1395 \def \@tempb{\@nodocument}
1396 \ifx \@tempa\@tempb
1397  \@nodocument

1398 \fi 1399 }

Define the fonts for titles and things

1400 \def\AUTHORfont {\large\rmfamily\mdseries\upshape}
1401 \def\TITLEfont  {\Large\rmfamily\mdseries\upshape}
1402 \def\addressfont{\small\rmfamily\mdseries\upshape}
1403 \def\netaddrfont{\small\ttfamily\mdseries\upshape}
     The body of \maketitle
1404 \def\@maketitle{%
1405 {\parskip\z@
1406  \TITLEfont\raggedright\noindent\@title\par
1407  \count@=0
1408  \loop
1409  \ifnum\count@<\authornumber
1410  \vskip20\p@
1411  \advance\count@\@ne
1412  {\AUTHORfont\theauthor{\number\count@}\endgraf}%
1413  \addressfont\theaddress{\number\count@}\endgraf

1414 {%

1415  \allowhyphens
1416  \hangindent1.5pc
1417  \netaddrfont\thenetaddress{\number\count@}\endgraf
1418  \hangindent1.5pc
1419  \thePersonalURL{\number\count@}\endgraf

1420 }%

1421  \repeat
1422 \vskip20\p@}%
1423 \if@abstract
1424  \centerline{\bfseries Abstract}%
1425  \vskip.5\baselineskip\rmfamily
1426  \list{}{\listparindent20\p@
1427  \itemindent\z@ \leftmargin4.875pc
1428  \rightmargin\leftmargin \parsep \z@}\item[]\ignorespaces
1429  \the\abstract@toks
1430  \endlist\global\@ignoretrue

1431 \fi

1432 \vskip1pc
1433 \xdef\@titlepagenum{\number\c@page}%
1434 \global\@afterindentfalse\aftergroup\@afterheading

1435 }

1436

1437 \def\@titlepagenum{1 }          % default

Comment This is all very weird… why we (of all people) don’t allow \thanks currently escapes me.

1438 \def\thanks#1{\@bsphack\TBWarning{\string\thanks\space
1439  is not supported}\@esphack}

Save the contents of the abstract environment in the token register \abstract@toks. We need to do this, as otherwise it may get ‘typeset’ (previously, it got put in a box) before \begin{document}, and experiments prove that this means our shiny new \SMC doesn’t work in this situation.

If you need to understand the ins and outs of this code, look at the place I lifted it from: tabularx.dtx (in the tools bundle). The whole thing pivots on having stored the name of the ‘abstract’ environment in \@abstract@

1440 \newtoks\abstract@toks  \abstract@toks{}
1441 \let\if@abstract\iffalse
1442 \def\abstract{\def\@abstract@{abstract}%
1443 \ifx\@currenvir\@abstract@
1444 \else
1445  \TBError{\string\abstract\space is illegal:%
1446  \MessageBreak
1447  use \string\begin{\@abstract@} instead}%
1448  {\@abstract@\space may only be used as an environment}

1449 \fi

1450 \global\let\if@abstract\iftrue
1451 {\ifnum0=`}\fi
1452 \@abstract@getbody}
1453 \let\endabstract\relax

\@abstract@getbody gets chunks of the body (up to the next occurrence of

\end) and appends them to \abstract@toks. It then uses \@abstract@findend

to detect whether this \end is followed by {abstract}

1454 \long\def\@abstract@getbody#1\end{%
1455 \global\abstract@toks\expandafter{\the\abstract@toks#1}%
1456 \@abstract@findend}

Here we’ve got to \end in the body of the abstract. \@abstract@findend takes the ‘argument’ of the \end do its argument.

1457 \def\@abstract@findend#1{%
1458 \def\@tempa{#1}

If we’ve found an ‘end’ to match the ‘begin’ that we started with, we’re done with gathering the abstract up; otherwise we stuff the end itself into the token register and carry on.

1459 \ifx\@tempa\@abstract@
1460  \expandafter\@abstract@end
1461 \else

It’s not \end{abstract} — check that it’s not \end{document} either (which signifies that the author’s forgotten about ending the abstract)

1462  \def\@tempb{document}%
1463  \ifx\@tempa\@tempb
1464  \TBError{\string\begin{\@abstract@}
1465  ended by \string\end{\@tempb}}%
1466  {You've forgotten \string\end{\@abstract@}}
1467  \else
1468  \global\abstract@toks\expandafter{\the\abstract@toks\end{#1}}%
1469  \expandafter\@abstract@getbody

1470 \fi

1471 \fi}

In our case, the action at the ‘proper’ \end is a lot simpler than what appears in tabularx.dtx … don’t be surprised!

1472 \def\@abstract@end{\ifnum0=`{\fi}%
1473 \expandafter\end\expandafter{\@abstract@}}

\signature is improper in proceedings, so we replace it with a warning (and a no-op otherwise)

1474 \renewcommand{\signature}{\TBWarning
1475  {\string\signature\space is invalid in proceedings issues}}

The \rh* commands are versions to be used in the running head of the article. Normally, they are the same things as the author and title of the article, but in the case that there are confusions therein, the text should provide substitutes, using the \short* commands.

1476 \def\rhTitle{\@title}
1477 \def\shortTitle #1{\def\rhTitle{#1}}
1478 \def\rhAuthor{\@author}
1479 \def\shortAuthor #1{\def\rhAuthor{#1}}

Now we define the running heads in terms of the \rh* commands.

1480 \def\@oddhead{\MakeRegistrationMarks
1481 \ifnum\c@page=\@titlepagenum
1482 \else

1483 {%

1484  \hfil
1485  \def\\{\unskip\ \ignorespaces}%
1486  \rmfamily\rhTitle

1487 }%

1488 \fi}
1489 \def\@evenhead{\MakeRegistrationMarks
1490 \ifnum\c@page=\@titlepagenum
1491 \else

1492 {%

1493  \def\\{\unskip\ \ignorespaces}%
1494  \rmfamily\rhAuthor
1495  \hfil

1496 }%

1497 \fi}

1498

1499 \advance\footskip8\p@    % for deeper running feet

1500

1501 \def\dopagecommands{\csname @@pagecommands\number\c@page\endcsname}

1502 \def\setpagecommands#1#2{\expandafter\def\csname @@pagecommands#1\endcsname
1503 {#2}}
1504 \def\@oddfoot{\ifpreprint\pfoottext\hfil\Now\hfil\thepage
1505  \else\rfoottext\hfil\thepage\fi\dopagecommands}
1506 \def\@evenfoot{\ifpreprint\thepage\hfil\Now\hfil\pfoottext
1507  \else\thepage\hfil\rfoottext\fi\dopagecommands}

1508

1509 \def\pfoottext{{\smc Preprint}: Proceedings of the \volyr{} Annual Meeting}
1510 \def\rfoottext{\normalfont\TUB, \volx\Dash
1511 {Proceedings of the \volyr{} Annual Meeting}}

4.2 Section divisions

Neither sections nor subsections are numbered in the proceedings style: note that this puts a degree of stress on authors’ natural tendency to reference sections, which is a matter that needs attention.

1512 \setcounter{secnumdepth}{0}

Otherwise, the \section command is pretty straightforward. However, the \subsection and \subsubsection are run-in, and we have to remember to have negative stretch (and shrink if we should in future choose to have one) on the ⟨afterskip⟩ parameter of \@startsection, since the whole skip is going to end up getting negated. We use \TB@startsection to detect inappropriate forms.

1513 \if@proc@sober
1514 \def\section
1515  {\TB@nolimelabel
1516  \TB@startsection{{section}%

1517 1%

1518  \z@%
1519  {-8\p@}%
1520  {6\p@}%
1521  {\normalsize\bf\raggedright}}}
1522 \else
1523 \def\section
1524  {\TB@nolimelabel
1525  \TB@startsection{{section}%

1526 1%

1527  \z@%
1528  {-8\p@}%
1529  {6\p@}%
1530  {\large\bf\raggedright}}}

1531 \fi

1532 \def\subsection
1533  {\TB@nolimelabel
1534  \TB@startsection{{subsection}%

1535 2%

1536  \z@%
1537  {6\p@\@plus 2\p@\@minus2\p@}%
1538  {-5\p@\@plus -\fontdimen3\the\font}%
1539  {\normalsize\bf}}}
1540 \def\subsubsection
1541  {\TB@nolimelabel
1542  \TB@startsection{{subsubsection}%

1543 3%

1544  \z@%
1545  {1sp}%
1546  {-5\p@\@plus -\fontdimen3\the\font}%
1547  {\normalsize\bf}}}

Appendices raise a problem: we plainly need to restore the section numbering (oh dearie me…), which in turn allows labelling of section numbers again (\TBnolimelabel happens before the \refstepcounter, so its effects get lost … what a clever piece of design that was). So here we go:

1548 \renewcommand\appendix{\par
1549 \renewcommand\thesection{\@Alph\c@section}%
1550 \setcounter{section}{0}%
1551 \setcounter{secnumdepth}{1}%

Now: is this the start of an appendix environment? This can be detected (as Mark Wooding and I realised apparently on the same day) by looking at \@currenvir; if we are, we need to relay to \@appendix@env to pick up the optional argument.

1552 \def\@tempa{appendix}
1553 \ifx\@tempa\@currenvir
1554  \expandafter\@appendix@env

1555 \fi 1556 }

Here we deal with \begin{appendix}[⟨app-name⟩]

1557 \newcommand\app@prefix@section{}
1558 \newcommand\@appendix@env[1][Appendix]{%
1559 \renewcommand\@seccntformat[1]{\csname app@prefix@##1\endcsname
1560  \csname the##1\endcsname\quad}%
1561 \renewcommand\app@prefix@section{#1 }%

1562 }

Ending an appendix environment is pretty trivial…

1563 \let\endappendix\relax

1564 ⟨/ltugproccls⟩

5 Plain TEX styles

1565 ⟨∗tugboatsty⟩

1566 % err...

1567 ⟨/tugboatsty⟩ 1568 ⟨∗tugprocsty⟩

1569 % err...

1570 ⟨/tugprocsty⟩

6 The L^{A}TEX 2ε compatibility-mode style files

1571 ⟨∗ltugboatsty⟩

1572 \@obsoletefile{ltugboat.cls}{ltugboat.sty}
1573 \LoadClass{ltugboat}

1574 ⟨/ltugboatsty⟩ 1575 ⟨∗ltugprocsty⟩

1576 \@obsoletefile{ltugproc.cls}{ltugproc.sty}
1577 \LoadClass{ltugproc}

1578 ⟨/ltugprocsty⟩

7 BibTEX support

8 The BibTEX style file

This is based on an original by Patrick Daly.

1579 ⟨∗tugbib⟩

1580 ENTRY
1581 { address
1582  author
1583  booktitle
1584  chapter
1585  edition
1586  editor
1587  howpublished
1588  institution
1589  journal

1590 key

1591  month
1592  note
1593  number
1594  organization
1595  pages
1596  publisher
1597  school
1598  series
1599  title
1600  type
1601  volume
1602  year

1603 } 1604 {}

1605 { label extra.label sort.label long.label short.label }

1606

1607 INTEGERS { output.state before.all mid.sentence after.sentence after.block }

1608

1609 FUNCTION {init.state.consts}
1610 { #0 'before.all :=
1611 #1 'mid.sentence :=
1612 #2 'after.sentence :=
1613 #3 'after.block :=

1614 }

1615

1616 STRINGS { s t }

1617

1618 FUNCTION {output.nonnull}
1619 { 's :=
1620 output.state mid.sentence =
1621  { ", " * write$ }
1622  { output.state after.block =

1623  { add.period$ write$
1624  newline$
1625  "\newblock " write$

1626 }

1627  { output.state before.all =
1628  'write$
1629  { add.period$ " " * write$ }

1630 if$ 1631 } 1632 if$

1633  mid.sentence 'output.state :=

1634 } 1635 if$ 1636 s 1637 }

1638

1639 FUNCTION {output}
1640 { duplicate$ empty$
1641  'pop$
1642  'output.nonnull

1643 if$ 1644 }

1645

1646 FUNCTION {output.check}
1647 { 't :=
1648 duplicate$ empty$
1649  { pop$ "empty " t * " in " * cite$ * warning$ }
1650  'output.nonnull

1651 if$ 1652 }

1653

1654 FUNCTION {output.bibitem}
1655 { newline$
1656 "\bibitem[" write$
1657 "\protect\citeauthoryear{" long.label * "}{" * write$
1658 short.label write$
1659 "}{" year duplicate$ empty$
1660  { pop$ "????" }
1661  'skip$

1662 if$

1663 * extra.label * "}]{" * write$
1664 cite$ write$
1665 "}" write$
1666 newline$

1667 ""

1668 before.all 'output.state :=

1669 }

1670

1671 FUNCTION {fin.entry}
1672 { add.period$
1673 write$
1674 newline$

1675 }

1676

1677 FUNCTION {new.block}
1678 { output.state before.all =
1679  'skip$
1680  { after.block 'output.state := }

1681 if$ 1682 }

1683

1684 FUNCTION {new.sentence}
1685 { output.state after.block =
1686  'skip$
1687  { output.state before.all =
1688  'skip$
1689  { after.sentence 'output.state := }

1690 if$ 1691 } 1692 if$ 1693 }

1694

1695 FUNCTION {not}
1696 {   { #0 }
1697  { #1 }

1698 if$ 1699 }

1700

1701 FUNCTION {and}
1702 {   'skip$
1703  { pop$ #0 }

1704 if$ 1705 }

1706

1707 FUNCTION {or}
1708 {   { pop$ #1 }
1709  'skip$

1710 if$ 1711 }

1712

1713 FUNCTION {new.block.checkb}
1714 { empty$
1715 swap$ empty$

1716 and

1717  'skip$
1718  'new.block

1719 if$ 1720 }

1721

1722 FUNCTION {field.or.null}
1723 { duplicate$ empty$
1724  { pop$ "" }
1725  'skip$

1726 if$ 1727 }

1728

1729 FUNCTION {emphasize}
1730 { duplicate$ empty$

1731  { pop$ "" }
1732 ⟨!latex2e⟩ { "{\em " swap$ * "}" * }
1733 ⟨latex2e⟩ { "\emph{" swap$ * "}" * }

1734 if$ 1735 }

1736

1737 FUNCTION {bolden}
1738 { duplicate$ empty$
1739  { pop$ "" }
1740 ⟨!latex2e⟩ { "{\bf " swap$ * "}" * }
1741 ⟨latex2e⟩ { "\textbf{" swap$ * "}" * }

1742 if$ 1743 }

Function format.names modified at Barbara Beeton’s suggestion (while reviewing the TUG95 preprints) to treat the first author’s name differently. One has one’s doubts…

1744 INTEGERS { nameptr namesleft numnames }

1745

1746 FUNCTION {format.names}
1747 { 's :=
1748 #1 'nameptr :=
1749 s num.names$ 'numnames :=
1750 numnames 'namesleft :=
1751  { namesleft #0 > }
1752  { s nameptr
1753  nameptr #1 =
1754  { "{vv~}{ll}{, jj}{, ff}" format.name$ }
1755  { "{f.~}{vv~}{ll}{, jj}" format.name$ }

1756 if$

1757  't :=
1758  nameptr #1 >

1759 {

1760  namesleft #1 >
1761  { ", " * t * }

1762 {

1763  numnames #2 >
1764  { "," * }
1765  'skip$

1766 if$

1767  t "others" =
1768  { " \etal{}" * }
1769  { " and " * t * }

1770 if$ 1771 } 1772 if$ 1773 } 1774 't 1775 if$

1776  nameptr #1 + 'nameptr :=
1777  namesleft #1 - 'namesleft :=

1778 }

1779 while$

1780 }

1782 FUNCTION {format.names.ed}
1783 { 's :=
1784 #1 'nameptr :=
1785 s num.names$ 'numnames :=
1786 numnames 'namesleft :=
1787  { namesleft #0 > }
1788  { s nameptr
1789  "{f.~}{vv~}{ll}{, jj}"
1790  format.name$ 't :=
1791  nameptr #1 >

1792 {

1793  namesleft #1 >
1794  { ", " * t * }

1795 {

1796  numnames #2 >
1797  { "," * }
1798  'skip$

1799 if$

1800  t "others" =
1801  { " \etal{}" * }
1802  { " and " * t * }

1803 if$ 1804 } 1805 if$ 1806 } 1807 't 1808 if$

1809  nameptr #1 + 'nameptr :=
1810  namesleft #1 - 'namesleft :=

1811 }

1812 while$

1813 }

1814

1815 FUNCTION {format.key}
1816 { empty$
1817  { key field.or.null }
1818  { "" }

1819 if$ 1820 }

1821

1822 FUNCTION {format.authors}
1823 { author empty$
1824  { "" }
1825  { author format.names }

1826 if$ 1827 }

1828

1829 FUNCTION {format.editors}
1830 { editor empty$
1831  { "" }
1832  { editor format.names
1833  editor num.names$ #1 >
1834  { ", editors" * }

1835  { ", editor" * }

1836 if$ 1837 } 1838 if$ 1839 }

1840

1841 FUNCTION {format.in.editors}
1842 { editor empty$
1843  { "" }
1844  { editor format.names.ed

1845 } 1846 if$ 1847 }

1848

1849 FUNCTION {format.title}
1850 { title empty$
1851  { "" }
1852  { title
1853  "``" swap$ * "''" *

1854 } 1855 if$ 1856 }

1857

1858 FUNCTION {n.dashify}
1859 { 't :=

1860 ""

1861  { t empty$ not }
1862  { t #1 #1 substring$ "-" =
1863  { t #1 #2 substring$ "--" = not
1864  { "--" *
1865  t #2 global.max$ substring$ 't :=

1866 }

1867  {   { t #1 #1 substring$ "-" = }
1868  { "-" *
1869  t #2 global.max$ substring$ 't :=

1870 }

1871  while$

1872 } 1873 if$ 1874 }

1875  { t #1 #1 substring$ *
1876  t #2 global.max$ substring$ 't :=

1877 } 1878 if$ 1879 }

1880 while$

1881 }

1882

1883 FUNCTION {word.in}
1884 { "In " }

1885

1886 FUNCTION {format.date}
1887 { year duplicate$ empty$
1888  { "empty year in " cite$ * "; set to ????" * warning$

1889  pop$ "????" }
1890  'skip$

1891 if$

1892 extra.label *

1893 }

1894

1895 FUNCTION {format.btitle}
1896 { title emphasize

1897 }

1898

1899 FUNCTION {tie.or.space.connect}
1900 { duplicate$ text.length$ #3 <
1901  { "~" }
1902  { " " }

1903 if$

1904 swap$ * *

1905 }

1906

1907 FUNCTION {either.or.check}
1908 { empty$
1909  'pop$
1910  { "can't use both " swap$ * " fields in " * cite$ * warning$ }

1911 if$ 1912 }

1913

1914 FUNCTION {format.bvolume}
1915 { volume empty$
1916  { "" }
1917  { "volume" volume tie.or.space.connect
1918  series empty$
1919  'skip$
1920  { " of " * series emphasize * }

1921 if$

1922  "volume and number" number either.or.check

1923 } 1924 if$ 1925 }

1926

1927 FUNCTION {format.number.series}
1928 { volume empty$
1929  { number empty$
1930  { series field.or.null }
1931  { output.state mid.sentence =
1932  { "number" }
1933  { "Number" }

1934 if$

1935  number tie.or.space.connect
1936  series empty$
1937  { "there's a number but no series in " cite$ * warning$ }
1938  { " in " * series * }

1939 if$ 1940 } 1941 if$ 1942 }

1943  { "" }

1944 if$ 1945 }

1946

1947 FUNCTION {format.edition}
1948 { edition empty$
1949  { "" }
1950  { output.state mid.sentence =
1951  { edition "l" change.case$ " edition" * }
1952  { edition "t" change.case$ " edition" * }

1953 if$ 1954 } 1955 if$ 1956 }

1957

1958 INTEGERS { multiresult }

1959

1960 FUNCTION {multi.page.check}
1961 { 't :=
1962 #0 'multiresult :=
1963  { multiresult not
1964  t empty$ not

1965 and 1966 }

1967  { t #1 #1 substring$
1968  duplicate$ "-" =
1969  swap$ duplicate$ "," =
1970  swap$ "+" =
1971  or or
1972  { #1 'multiresult := }
1973  { t #2 global.max$ substring$ 't := }

1974 if$ 1975 }

1976 while$
1977 multiresult

1978 }

1979

1980 FUNCTION {format.pages}
1981 { pages empty$
1982  { "" }
1983  { pages multi.page.check
1984  { "pages" pages n.dashify tie.or.space.connect }
1985  { "page" pages tie.or.space.connect }

1986 if$ 1987 } 1988 if$ 1989 }

1990

1991 FUNCTION {format.vol.num.pages}
1992 { volume field.or.null
1993 bolden
1994 number empty$
1995  'skip$
1996  { "(" number * ")" * *

1997  volume empty$
1998  { "there's a number but no volume in " cite$ * warning$ }
1999  'skip$

2000 if$ 2001 } 2002 if$

2003 pages empty$
2004  'skip$
2005  { duplicate$ empty$
2006  { pop$ format.pages }
2007  { ", " * pages n.dashify * }

2008 if$ 2009 } 2010 if$ 2011 }

2012

2013 FUNCTION {format.chapter.pages}
2014 { chapter empty$
2015  'format.pages
2016  { type empty$
2017  { "chapter" }
2018  { type "l" change.case$ }

2019 if$

2020  chapter tie.or.space.connect
2021  pages empty$
2022  'skip$
2023  { ", " * format.pages * }

2024 if$ 2025 } 2026 if$ 2027 }

2028

2029 FUNCTION {format.in.ed.booktitle}
2030 { booktitle empty$
2031  { "" }
2032  { editor empty$
2033  { word.in booktitle emphasize * }
2034  { word.in booktitle emphasize * ", edited by " *
2035  format.in.editors * }

2036 if$ 2037 } 2038 if$ 2039 }

2040

2041 FUNCTION {format.thesis.type}
2042 { type empty$
2043  'skip$
2044  { pop$
2045  type "t" change.case$

2046 } 2047 if$ 2048 }

2049

2050 FUNCTION {format.tr.number}

2051 { type empty$
2052  { "Technical Report" }
2053  'type

2054 if$

2055 number empty$
2056  { "t" change.case$ }
2057  { number tie.or.space.connect }

2058 if$ 2059 }

2060

2061 FUNCTION {format.article.crossref}

2062 {

2063 word.in
2064 "\cite{" * crossref * "}" *

2065 }

2066

2067 FUNCTION {format.book.crossref}
2068 { volume empty$
2069  { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
2070  word.in

2071 }

2072  { "Volume" volume tie.or.space.connect
2073  " of " *

2074 } 2075 if$

2076 "\cite{" * crossref * "}" *

2077 }

2078

2079 FUNCTION {format.incoll.inproc.crossref}

2080 {

2081 word.in
2082 "\cite{" * crossref * "}" *

2083 }

2084

2085 FUNCTION {article}
2086 { output.bibitem
2087 format.authors "author" output.check
2088 author format.key output
2089 new.block
2090 format.title "title" output.check
2091 new.block
2092 crossref missing$
2093  { journal emphasize "journal" output.check
2094  " " * before.all 'output.state :=
2095  format.vol.num.pages output
2096  format.date "year" output.check

2097 }

2098  { format.article.crossref output.nonnull
2099  format.pages output

2100 } 2101 if$

2102 new.block
2103 note output
2104 fin.entry

2106

2107 FUNCTION {book}
2108 { output.bibitem
2109 author empty$
2110  { format.editors "author and editor" output.check
2111  editor format.key output

2112 }

2113  { format.authors output.nonnull
2114  crossref missing$
2115  { "author and editor" editor either.or.check }
2116  'skip$

2117 if$ 2118 } 2119 if$

2120 new.block
2121 format.btitle "title" output.check
2122 crossref missing$
2123  { format.bvolume output
2124  new.block
2125  format.number.series output
2126  new.sentence
2127  publisher "publisher" output.check
2128  address output

2129 } 2130 {

2131  new.block
2132  format.book.crossref output.nonnull

2133 } 2134 if$

2135 format.edition output
2136 format.date "year" output.check
2137 new.block
2138 note output
2139 fin.entry

2140 }

2141

2142 FUNCTION {booklet}
2143 { output.bibitem
2144 format.authors output
2145 author format.key output
2146 new.block
2147 format.title "title" output.check
2148 new.block
2149 howpublished output
2150 address output
2151 format.date "year" output.check
2152 new.block
2153 note output
2154 fin.entry

2155 }

2156

2157 FUNCTION {inbook}
2158 { output.bibitem

2159 author empty$
2160  { format.editors "author and editor" output.check
2161  editor format.key output

2162 }

2163  { format.authors output.nonnull
2164  crossref missing$
2165  { "author and editor" editor either.or.check }
2166  'skip$

2167 if$ 2168 } 2169 if$

2170 new.block
2171 format.btitle "title" output.check
2172 crossref missing$
2173  { format.bvolume output
2174  format.chapter.pages "chapter and pages" output.check
2175  new.block
2176  format.number.series output
2177  new.sentence
2178  publisher "publisher" output.check
2179  address output

2180 }

2181  { format.chapter.pages "chapter and pages" output.check
2182  new.block
2183  format.book.crossref output.nonnull

2184 } 2185 if$

2186 format.edition output
2187 format.date "year" output.check
2188 new.block
2189 note output
2190 fin.entry

2191 }

2192

2193 FUNCTION {incollection}
2194 { output.bibitem
2195 format.authors "author" output.check
2196 author format.key output
2197 new.block
2198 format.title "title" output.check
2199 new.block
2200 crossref missing$
2201  { format.in.ed.booktitle "booktitle" output.check
2202  format.bvolume output
2203  format.number.series output
2204  format.chapter.pages output
2205  new.sentence
2206  publisher "publisher" output.check
2207  address output
2208  format.edition output
2209  format.date "year" output.check

2210 }

2211  { format.incoll.inproc.crossref output.nonnull
2212  format.chapter.pages output

2214 if$

2215 new.block
2216 note output
2217 fin.entry

2218 }

2219

2220 FUNCTION {inproceedings}
2221 { output.bibitem
2222 format.authors "author" output.check
2223 author format.key output
2224 new.block
2225 format.title "title" output.check
2226 new.block
2227 crossref missing$
2228  { format.in.ed.booktitle "booktitle" output.check
2229  format.bvolume output
2230  format.number.series output
2231  format.pages output
2232  address output
2233  new.sentence
2234  organization output
2235  publisher output
2236 format.date "year" output.check

2237 }

2238  { format.incoll.inproc.crossref output.nonnull
2239  format.pages output

2240 } 2241 if$

2242 new.block
2243 note output
2244 fin.entry

2245 }

2246

2247 FUNCTION {conference} { inproceedings }

2248

2249 FUNCTION {manual}
2250 { output.bibitem
2251 format.authors output
2252 author format.key output
2253 new.block
2254 format.btitle "title" output.check
2255 organization address new.block.checkb
2256 organization output
2257 address output
2258 format.edition output
2259 format.date "year" output.check
2260 new.block
2261 note output
2262 fin.entry

2263 }

2264

2265 FUNCTION {mastersthesis}
2266 { output.bibitem

2267 format.authors "author" output.check
2268 author format.key output
2269 new.block
2270 format.btitle "title" output.check
2271 new.block
2272 "Master's thesis" format.thesis.type output.nonnull
2273 school "school" output.check
2274 address output
2275 format.date "year" output.check
2276 new.block
2277 note output
2278 fin.entry

2279 }

2280

2281 FUNCTION {misc}
2282 { output.bibitem
2283 format.authors output
2284 author format.key output
2285 new.block
2286 format.title output
2287 new.block
2288 howpublished output
2289 format.date "year" output.check
2290 new.block
2291 note output
2292 fin.entry

2293 }

2294

2295 FUNCTION {phdthesis}
2296 { output.bibitem
2297 format.authors "author" output.check
2298 author format.key output
2299 new.block
2300 format.btitle "title" output.check
2301 new.block
2302 "Ph.D.\ thesis" format.thesis.type output.nonnull
2303 school "school" output.check
2304 address output
2305 format.date "year" output.check
2306 new.block
2307 note output
2308 fin.entry

2309 }

2310

2311 FUNCTION {proceedings}
2312 { output.bibitem
2313 format.editors output
2314 editor format.key output
2315 new.block
2316 format.btitle "title" output.check
2317 format.bvolume output
2318 format.number.series output
2319 address output
2320 new.sentence

2321 organization output
2322 publisher output
2323 format.date "year" output.check
2324 new.block
2325 note output
2326 fin.entry

2327 }

2328

2329 FUNCTION {techreport}
2330 { output.bibitem
2331 format.authors "author" output.check
2332 author format.key output
2333 new.block
2334 format.title "title" output.check
2335 new.block
2336 format.tr.number output.nonnull
2337 institution "institution" output.check
2338 address output
2339 format.date "year" output.check
2340 new.block
2341 note output
2342 fin.entry

2343 }

2344

2345 FUNCTION {unpublished}
2346 { output.bibitem
2347 format.authors "author" output.check
2348 author format.key output
2349 new.block
2350 format.title "title" output.check
2351 new.block
2352 note "note" output.check
2353 fin.entry

2354 }

2355

2356 FUNCTION {default.type} { misc }

2357

2358 MACRO {jan} {"January"}

2359

2360 MACRO {feb} {"February"}

2361

2362 MACRO {mar} {"March"}

2363

2364 MACRO {apr} {"April"}

2365

2366 MACRO {may} {"May"}

2367

2368 MACRO {jun} {"June"}

2369

2370 MACRO {jul} {"July"}

2371

2372 MACRO {aug} {"August"}

2373

2374 MACRO {sep} {"September"}

2376 MACRO {oct} {"October"}

2377

2378 MACRO {nov} {"November"}

2379

2380 MACRO {dec} {"December"}

2381

2382 READ

2383

2384 FUNCTION {sortify}
2385 { purify$
2386 "l" change.case$

2387 }

2388

2389 INTEGERS { len }

2390

2391 FUNCTION {chop.word}
2392 { 's :=
2393 'len :=
2394 s #1 len substring$ =
2395  { s len #1 + global.max$ substring$ }

2396 's 2397 if$ 2398 }

2399

2400 FUNCTION {format.lab.names}
2401 { 's :=
2402 s #1 "{vv~}{ll}" format.name$
2403 s num.names$ duplicate$

2404 #2 >

2405  { pop$                      % 2nd number of names
2406  " \etal{}" *

2407 }

2408  { #2 <
2409  'skip$
2410  { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
2411  { " \etal{}" * }
2412  { " and " * s #2 "{vv~}{ll}" format.name$ * }

2413 if$ 2414 } 2415 if$ 2416 } 2417 if$ 2418 }

2419

2420 FUNCTION {format.long.lab.names}
2421 { 's :=
2422 #1 'nameptr :=
2423 s num.names$ 'numnames :=
2424 numnames 'namesleft :=
2425  { namesleft #0 > }
2426  { s nameptr
2427  "{vv~}{ll}" format.name$ 't :=
2428  nameptr #1 >

2430  namesleft #1 >
2431  { ", " * t * }

2432 {

2433  numnames #2 >
2434  { "," * }
2435  'skip$

2436 if$

2437  t "others" =
2438  { " \etal{}" * }
2439  { " and " * t * }

2440 if$ 2441 } 2442 if$ 2443 } 2444 't 2445 if$

2446  nameptr #1 + 'nameptr :=
2447  namesleft #1 - 'namesleft :=

2448 }

2449 while$

2450 }

2451

2452 FUNCTION {author.key}
2453 { author empty$
2454  { "{"
2455  key empty$
2456  { cite$ #1 #3 substring$ }
2457  'key
2458  if$ *
2459  "}" *

2460 }

2461  'author

2462 if$ 2463 }

2464

2465 FUNCTION {author.editor.key}
2466 { author empty$
2467  { editor empty$
2468  { "{"
2469  key empty$
2470  { cite$ #1 #3 substring$ }
2471  'key
2472  if$ *
2473  "}" *

2474 }

2475  'editor

2476 if$ 2477 }

2478  'author

2479 if$ 2480 }

2481

2482 FUNCTION {editor.key}

2483 { editor empty$
2484  { "{"
2485  key empty$
2486  { cite$ #1 #3 substring$ }
2487  'key
2488  if$ *
2489  "}" *

2490 }

2491  'editor

2492 if$ 2493 }

2494

2495 % [stack: name other.field]
2496 FUNCTION {maybe.other.name.field}
2497 { swap$                         % [stack: other.field name]
2498 duplicate$ empty$             % is the name empty?
2499  { pop$                      % discard it [stack: other.field]
2500  #1 swap$ 'skip$ if$       % try the other one

2501 }

2502  { swap$ pop$                % discard other.field

2503 } 2504 if$ 2505 }

2506

2507 FUNCTION {calc.label.names}
2508 { type$ "proceedings" =
2509  'editor
2510  'author

2511 if$

2512 'editor maybe.other.name.field
2513 'organization maybe.other.name.field
2514 'key maybe.other.name.field
2515 { "Cannot create a label name in " cite$ * warning$
2516  cite$ #1 #3 substring$ } maybe.other.name.field

2517 }

2518

2519 FUNCTION {calc.short.label}
2520 { calc.label.names format.lab.names
2521 'short.label :=

2522 }

2523

2524 FUNCTION {calc.label}
2525 { calc.short.label
2526 short.label ", " *
2527 year duplicate$ empty$
2528  { pop$ "????" }
2529  { purify$ #-1 #4 substring$ }

2530 if$ 2531 *

2532 'label :=

2533 }

2534

2535 FUNCTION {calc.long.label}
2536 { calc.label.names format.long.lab.names

2537 'long.label :=

2538 }

2539

2540 FUNCTION {sort.format.names}
2541 { 's :=
2542 #1 'nameptr :=

2543 ""

2544 s num.names$ 'numnames :=
2545 numnames 'namesleft :=
2546  { namesleft #0 > }
2547  { nameptr #1 >
2548  { "   " * }
2549  'skip$

2550 if$

2551  s nameptr
2552  "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}"
2553  format.name$ 't :=
2554  nameptr numnames = t "others" = and
2555  { "et al" * }
2556  { t sortify * }

2557 if$

2558  nameptr #1 + 'nameptr :=
2559  namesleft #1 - 'namesleft :=

2560 }

2561 while$

2562 }

2563

2564 FUNCTION {sort.format.title}
2565 { 't :=
2566 "A " #2
2567  "An " #3
2568  "The " #4 t chop.word
2569  chop.word
2570 chop.word
2571 sortify
2572 #1 global.max$ substring$

2573 }

2574

2575 FUNCTION {author.sort}
2576 { author empty$
2577  { key empty$
2578  { "to sort, need author or key in " cite$ * warning$

2579 "" 2580 }

2581  { key sortify }

2582 if$ 2583 }

2584  { author sort.format.names }

2585 if$ 2586 }

2587

2588 FUNCTION {author.editor.sort}
2589 { author empty$
2590  { editor empty$

2591  { key empty$
2592  { "to sort, need author, editor, or key in " cite$ * warning$

2593 "" 2594 }

2595  { key sortify }

2596 if$ 2597 }

2598  { editor sort.format.names }

2599 if$ 2600 }

2601  { author sort.format.names }

2602 if$ 2603 }

2604

2605 FUNCTION {editor.sort}
2606 { editor empty$
2607  { key empty$
2608  { "to sort, need editor or key in " cite$ * warning$

2609 "" 2610 }

2611  { key sortify }

2612 if$ 2613 }

2614  { editor sort.format.names }

2615 if$ 2616 }

2617

2618 FUNCTION {presort}
2619 { calc.label
2620 label sortify

2621 " " 2622 *

2623 type$ "book" =
2624 type$ "inbook" =

2625 or

2626  'author.editor.sort
2627  { type$ "proceedings" =
2628  'editor.sort
2629  'author.sort

2630 if$ 2631 } 2632 if$

2633 #1 entry.max$ substring$
2634 'sort.label :=
2635 sort.label

2636 * 2637 " " 2638 *

2639 title field.or.null
2640 sort.format.title

2641 *

2642 #1 entry.max$ substring$
2643 'sort.key$ :=

2644 }

2646 ITERATE {presort}

2647

2648 SORT

2649

2650 STRINGS { last.label next.extra }

2651

2652 INTEGERS { last.extra.num }

2653

2654 FUNCTION {initialize.extra.label.stuff}
2655 { #0 int.to.chr$ 'last.label :=
2656 "" 'next.extra :=
2657 #0 'last.extra.num :=

2658 }

2659

2660 FUNCTION {forward.pass}
2661 { last.label label =
2662  { last.extra.num #1 + 'last.extra.num :=
2663  last.extra.num int.to.chr$ 'extra.label :=

2664 }

2665  { "a" chr.to.int$ 'last.extra.num :=
2666  "" 'extra.label :=
2667  label 'last.label :=

2668 } 2669 if$ 2670 }

2671

2672 FUNCTION {reverse.pass}
2673 { next.extra "b" =
2674  { "a" 'extra.label := }
2675  'skip$

2676 if$

2677 extra.label 'next.extra :=

2678 }

2679

2680 EXECUTE {initialize.extra.label.stuff}

2681

2682 ITERATE {forward.pass}

2683

2684 REVERSE {reverse.pass}

2685

2686 FUNCTION {bib.sort.order}
2687 { sort.label

2688 " " 2689 *

2690 year field.or.null sortify

2691 * 2692 " " 2693 *

2694 title field.or.null
2695 sort.format.title

2696 *

2697 #1 entry.max$ substring$
2698 'sort.key$ :=

2699 calc.long.label

2700 }

2701

2702 ITERATE {bib.sort.order}

2703

2704 SORT

2705

2706 FUNCTION {begin.bib}
2707 { preamble$ empty$
2708  'skip$
2709  { preamble$ write$ newline$ }

2710 if$

2711 "\begin{thebibliography}{}" write$ newline$

2712 }

2713

2714 EXECUTE {begin.bib}

2715

2716 EXECUTE {init.state.consts}

2717

2718 ITERATE {call.type$}

2719

2720 FUNCTION {end.bib}
2721 { newline$
2722 "\end{thebibliography}" write$ newline$

2723 }

2724

2725 EXECUTE {end.bib}

2726 ⟨/tugbib⟩