| 1 |
% \iffalse (this is a meta-comment (so they say)) |
| 2 |
% $Id: tugboat.dtx 701 2026-01-14 18:39:44Z karl $ |
| 3 |
% tugboat.dtx - main source for LaTeX TUGboat classes. |
| 4 |
% |
| 5 |
% Copyright 1994-2026 TeX Users Group. |
| 6 |
% |
| 7 |
% This file is part of the tugboat package. |
| 8 |
% |
| 9 |
% This work may be distributed and/or modified under the |
| 10 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 11 |
% of this license or (at your option) any later version. |
| 12 |
% The latest version of this license is in |
| 13 |
% http://www.latex-project.org/lppl.txt |
| 14 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 15 |
% version 2003/12/01 or later. |
| 16 |
% |
| 17 |
% \fi |
| 18 |
% |
| 19 |
% \section{Document preambles} |
| 20 |
% |
| 21 |
% \begin{macrocode} |
| 22 |
%<ltugboatcls|ltugproccls|ltugcomn>\NeedsTeXFormat{LaTeX2e}[1994/12/01] |
| 23 |
%<*dtx> |
| 24 |
\ProvidesFile {tugboat.dtx} |
| 25 |
%</dtx> |
| 26 |
%<ltugboatcls>\ProvidesClass {ltugboat} |
| 27 |
%<ltugproccls>\ProvidesClass {ltugproc} |
| 28 |
%<ltugboatsty>\ProvidesPackage{ltugboat} |
| 29 |
%<ltugprocsty>\ProvidesPackage{ltugproc} |
| 30 |
%<ltugcomn> \ProvidesPackage{ltugcomn} |
| 31 |
[2026-01-14 v2.36 |
| 32 |
%<ltugboatcls> TUGboat journal class% |
| 33 |
%<ltugproccls> TUG conference proceedings class% |
| 34 |
%<ltugboatsty|ltugprocsty> TUG compatibility package% |
| 35 |
%<ltugcomn> TUGboat `common macros' package% |
| 36 |
%<*dtx> |
| 37 |
TUG macros source file% |
| 38 |
%</dtx> |
| 39 |
] |
| 40 |
% \end{macrocode} |
| 41 |
% |
| 42 |
% \iffalse |
| 43 |
% |
| 44 |
% The version control Id above relates to the number of times |
| 45 |
% the file has been checked in, which relates to a development process |
| 46 |
% taking place on several machines, rather than the incidence of |
| 47 |
% significant change; the definitive version number is that in the |
| 48 |
% \Provides* things, while the Id is the latest modification. |
| 49 |
% |
| 50 |
% Code to compile the thing using \LaTeXe. |
| 51 |
% |
| 52 |
% \begin{macrocode} |
| 53 |
%<*driver> |
| 54 |
\documentclass{ltxdoc} |
| 55 |
% |
| 56 |
\usepackage{ltugcomn} % generated using the .ins file |
| 57 |
% |
| 58 |
\usepackage{array,longtable} |
| 59 |
% |
| 60 |
\begin{document} |
| 61 |
\GetFileInfo{tugboat.dtx} |
| 62 |
\title{The \textsf{tugboat} package\thanks{This file |
| 63 |
has version number \fileversion, last |
| 64 |
revised \filedate}} |
| 65 |
\author{The \TUB{} team} |
| 66 |
\date{\filedate} |
| 67 |
\maketitle |
| 68 |
\tableofcontents |
| 69 |
\DocInput{tugboat.dtx} |
| 70 |
\end{document} |
| 71 |
%</driver> |
| 72 |
% \end{macrocode} |
| 73 |
% |
| 74 |
% \fi |
| 75 |
% |
| 76 |
% \section{Introduction} |
| 77 |
% |
| 78 |
% This file contains all the macros for typesetting \TUB{} with |
| 79 |
% both plain \TeX\ and \LaTeXe. |
| 80 |
% \subsection{Summary of control sequences} |
| 81 |
% |
| 82 |
% A few of the abbreviations we define, with indications of expansion where |
| 83 |
% that may not be obvious. For full definitions, see real code below |
| 84 |
% (Section~\ref{abbr-logo}). |
| 85 |
% |
| 86 |
% \begin{longtable}{lp{3in}} |
| 87 |
% |\AllTeX|& (\La)\TeX\\ |
| 88 |
% |\AMS|& American Mathematical Society\\ |
| 89 |
% |\AmSTeX|&\\ |
| 90 |
% |\aw|& \aw\ (abbreviation for Addison-Wesley)\\ |
| 91 |
% |\API|&\\ |
| 92 |
% |\AW|& Addison-Wesley\\ |
| 93 |
% |\BibTeX|&\\ |
| 94 |
% |\CandT|& Computers \& Typesetting\\ |
| 95 |
% |\ConTeXt|& \ConTeXt\\ |
| 96 |
% |\Cplusplus|& C++\\ |
| 97 |
% |\DTD|&\\ |
| 98 |
% |\DVD|&\\ |
| 99 |
% |\DVI|&\\ |
| 100 |
% |\DVIPDFMx|& \DVIPDFMx\\ |
| 101 |
% |\DVItoVDU|& DVItoVDU\\ |
| 102 |
% |\ECMA|&\\ |
| 103 |
% |\EPS|&\\ |
| 104 |
% |\eTeX|& \eTeX\\ |
| 105 |
% |\ExTeX|& \ExTeX\\ |
| 106 |
% |\Ghostscript|&\\ |
| 107 |
% |\Hawaii|& \Hawaii\\ |
| 108 |
% |\HTML|&\\ |
| 109 |
% |\ISBN|& ISBN\\ |
| 110 |
% |\ISO|&\\ |
| 111 |
% |\ISSN|& ISSN\\ |
| 112 |
% |\JTeX|&\\ |
| 113 |
% |\JoT|& The Joy of \TeX\\ |
| 114 |
% |\LaTeX|&\\ |
| 115 |
% |\LyX|&\\ |
| 116 |
% |\macOS|& mac OS\\ |
| 117 |
% |\MacOSX|& Mac OS X\\ |
| 118 |
% |\MathML|&\\ |
| 119 |
% |\Mc|& M with raised c\\ |
| 120 |
% |\MF|& \MF\\ |
| 121 |
% |\mf|& \textsc{Metafont}\\ |
| 122 |
% |\MFB|& The Metafontbook\\ |
| 123 |
% |\MP|& \MP\\ |
| 124 |
% |\mp|& MetaPost (in text only: still `\ensuremath{\mp}' in math)\\ |
| 125 |
% |\OMEGA|& Omega `logo' (\ensuremath{\Omega})\\ |
| 126 |
% |\OCP|& Omega compiled process\\ |
| 127 |
% |\OOXML|&\\ |
| 128 |
% |\OTP|& Omega translation process\\ |
| 129 |
% |\mtex|& multilingual \TeX\\ |
| 130 |
% |\NTS|& New Typesetting System\\ |
| 131 |
% |\pcMF|& pcMF\\ |
| 132 |
% |\PCTeX|&\\ |
| 133 |
% |\pcTeX|&\\ |
| 134 |
% |\Pas|& Pascal\\ |
| 135 |
% |\PiCTeX|&\\ |
| 136 |
% |\plain|& plain (in typewriter font)\\ |
| 137 |
% |\POBox|& P. O. Box\\ |
| 138 |
% |\PS|& PostScript (with hyphenation)\\ |
| 139 |
% |\SC|& Steering Committee\\ |
| 140 |
% |\SGML|& SGML\\ |
| 141 |
% |\SliTeX|&\\ |
| 142 |
% |\slMF|& Metafont, slanted: deprecated: use |
| 143 |
% \cs{textsl} instead \\ |
| 144 |
% |\stTeX|& \TeX{} for the Atari ST\\ |
| 145 |
% |\SVG|&\\ |
| 146 |
% |\TANGLE|&\\ |
| 147 |
% |\TB|& The \TeX book\\ |
| 148 |
% |\TeX|& (Although nearly every package defines this, |
| 149 |
% most, including plain, are missing the |
| 150 |
% spacefactor adjustment)\\ |
| 151 |
% |\TeXhax|&\\ |
| 152 |
% |\TeXMaG|& (defunct)\\ |
| 153 |
% |\TeXtures|&\\ |
| 154 |
% |\TeXXeT|&\\ |
| 155 |
% |\Thanh|&\\ |
| 156 |
% |\TFM|& \TFM\\ |
| 157 |
% |\TUB|& \TUB\\ |
| 158 |
% |\TUG|& \TeX{} Users Group\\ |
| 159 |
% |\UNIX|&\\ |
| 160 |
% |\VAX|&\\ |
| 161 |
% |\VnTeX|&\\ |
| 162 |
% |\VorTeX|&\\ |
| 163 |
% |\XeT|&\\ |
| 164 |
% |\XeTeX|& reflected and lowered first `E'\\ |
| 165 |
% |\XeLaTeX|& with extra space before `L'\\ |
| 166 |
% |\XML|&\\ |
| 167 |
% |\WEB|&\\ |
| 168 |
% |\WEAVE|&\\ |
| 169 |
% |\WYSIWYG|&\\ |
| 170 |
% \end{longtable} |
| 171 |
% |
| 172 |
% Macros for things that are slightly more significant. |
| 173 |
% |
| 174 |
% \begin{longtable}{lp{.6\textwidth}} |
| 175 |
% |\NoBlackBoxes|& turns off marginal rules marking overfull boxes\\ |
| 176 |
% |\BlackBoxes|& turns them back on\\ |
| 177 |
% |\newline|& horizontal glue plus a break\\ |
| 178 |
% |\ifundefined#1|& checks argument with |\csname| against |\relax|\\ |
| 179 |
% |\topsmash|& smashes above baseline (from AMSTeX)\\ |
| 180 |
% |\botsmash|& smashes below baseline (from AMSTeX)\\ |
| 181 |
% |\smash|& smashes both (from plain)\\ |
| 182 |
% |\ulap|& lap upwards\\ |
| 183 |
% |\dlap|& lap downwards\\ |
| 184 |
% |\xlap|& reference point at center horizontally; 0 width\\ |
| 185 |
% |\ylap|& reference point at center vertically; 0 height, depth\\ |
| 186 |
% |\zlap|& combination |\xlap| and |\ylap|\\ |
| 187 |
% |\basezero|& to avoid insertion of baselineskip and lineskip glue\\ |
| 188 |
% |\nullhrule|& empty |\hrule|\\ |
| 189 |
% |\nullvrule|& empty |\vrule|\\ |
| 190 |
% |\makestrut[#1;#2]|& ad hoc struts; |#1|=height, |#2|=depth\\ |
| 191 |
% |\today|& today's date\\ |
| 192 |
% |\SetTime|& converts |\time| to hours, minutes\\ |
| 193 |
% |\now|& displays time in hours and minutes\\ |
| 194 |
% |\Now|& shows current date and time\\ |
| 195 |
% |\ifPrelimDraft|& flag to indicate status as preliminary draft\\ |
| 196 |
% |\rtitlex|& \TUB{} volume and number info for running head\\ |
| 197 |
% |\midrtitle|& information for center of running head\\ |
| 198 |
% |\rtitlenexttopage|& next to page number in running head\\ |
| 199 |
% |\HorzR@gisterRule|& pieces of registration marks (`trimmarks')\\ |
| 200 |
% |\DownShortR@gisterRule|&\\ |
| 201 |
% |\UpShortR@gisterRule|&\\ |
| 202 |
% |\ttopregister|& top registration line with `T' in center\\ |
| 203 |
% |\tbotregister|& bottom registration line with inverted `T' in center\\ |
| 204 |
% |\topregister|& register actually used\\ |
| 205 |
% |\botregister|&\\ |
| 206 |
% |\raggedskip|& parameters used for ragged settings\\ |
| 207 |
% |\raggedstretch|&\\ |
| 208 |
% |\raggedparfill|&\\ |
| 209 |
% |\raggedspaces|&\\ |
| 210 |
% |\raggedright|&\\ |
| 211 |
% |\raggedleft|&\\ |
| 212 |
% |\raggedcenter|&\\ |
| 213 |
% |\normalspaces|&\\ |
| 214 |
% |\raggedbottom|&\\ |
| 215 |
% |\bull|& square bullet\\ |
| 216 |
% |\cents|& `cents' sign\\ |
| 217 |
% |\Dag|& superscripted dagger\\ |
| 218 |
% |\careof|& c/o\\ |
| 219 |
% |\sfrac|& slashed fraction (arguments optionally\\ |
| 220 |
% & separated by a slash)\\ |
| 221 |
% |\cs|& control sequence name\\ |
| 222 |
% & |\cs{name}|$\rightarrow$\cs{name}\\ |
| 223 |
% |\meta|& meta-argument name\\ |
| 224 |
% & |\meta{name}|$\rightarrow$\meta{name}\\ |
| 225 |
% |\dash|& en-dash surrounded by thinspaces; only breakable AFTER\\ |
| 226 |
% |\Dash|& em-dash, as above\\ |
| 227 |
% |\hyph|& permit automatic hyphenation after an actual hyphen\\ |
| 228 |
% |\slash|& `breakable' slash\\ |
| 229 |
% |\nth|& for obtaining `1\textsuperscript{st}', |
| 230 |
% `2\textsuperscript{nd}', 3\textsuperscript{rd}, |
| 231 |
% etc.\\ |
| 232 |
% |\tubissue|& gets |\TUB| followed by volume and issue numbers\\ |
| 233 |
% |\xEdNote|& Editor's Note:\\ |
| 234 |
% |\Review:|& Review: (for title of book review article)\\ |
| 235 |
% |\reviewitem|& begin data for item being reviewed\\ |
| 236 |
% |\revauth|& with one argument, author(s) of item being reviewed\\ |
| 237 |
% |\revtitle|& with one argument, title of \ldots \\ |
| 238 |
% |\revpubinfo|& with one argument, other info pertaining to \ldots \\ |
| 239 |
% |\endreviewitem|& end data for item being reviewed\\ |
| 240 |
% |\titleref|& one argument, format title as straight text |
| 241 |
% (slanted, frenchspacing) \\ |
| 242 |
% |\Input|& |\input| with some other bookkeeping for |
| 243 |
% case where multiple articles are put together\\ |
| 244 |
% |\TBremark|& reminder to \TUB{} editorial staff\\ |
| 245 |
% |\TBEnableRemarks|& enable \cs{TBremark}s (normally suppressed)\\ |
| 246 |
% |\pagexref|& used to write out page numbers to screen and\\ |
| 247 |
% |\pagexrefON|& external files\\ |
| 248 |
% |\pagexrefOFF|&\\ |
| 249 |
% |\xrefto|& used for symbolic cross-reference to other pages\\ |
| 250 |
% |\xreftoON|& in \TUB{}\\ |
| 251 |
% |\xreftoOFF|&\\ |
| 252 |
% |\TBdriver|& marks code which only takes effect when articles |
| 253 |
% are run together in a driver file\\ |
| 254 |
% \iffalse % these two were defined but never used! -- remove them |
| 255 |
% % from the documentation, at least (further research needed) |
| 256 |
% |\signatureat|& \\ |
| 257 |
% |\signaturepercent|&\\ |
| 258 |
% \fi |
| 259 |
% |\signaturemark|& items for signatures\\ |
| 260 |
% |\signaturewidth|&\\ |
| 261 |
% \end{longtable} |
| 262 |
% |
| 263 |
% \StopEventually{} |
| 264 |
% |
| 265 |
% \section{\LaTeXe{} \TUB{} class file} |
| 266 |
% |
| 267 |
% \subsection{Setup and options} |
| 268 |
% |
| 269 |
% Occasionally we need to do different things when running under |
| 270 |
% traditional (pdf)latex or a native Unicode engine. Since we don't need |
| 271 |
% any fancier distinctions, instead of reading the |iftex| or another |
| 272 |
% package, do the test directly. |
| 273 |
% |
| 274 |
% \begin{macrocode} |
| 275 |
%<*common> |
| 276 |
\newif\ifTBunicodeengine |
| 277 |
\ifx\Umathchardef\@thisisundefined % not (xetex|luatex) |
| 278 |
\TBunicodeenginefalse |
| 279 |
\else |
| 280 |
\TBunicodeenginetrue |
| 281 |
\fi |
| 282 |
%</common> |
| 283 |
% \end{macrocode} |
| 284 |
% |
| 285 |
% Check for reloading. Hmmm\dots Does this happen with \LaTeXe\ |
| 286 |
% classes? Probably, in fact, as well that it doesn't, since the |
| 287 |
% \cs{tugstyinit} referenced here doesn't exist; however, it's |
| 288 |
% possible that we might need a similar mechanism in the future, so we |
| 289 |
% retain its skeleton, without fleshing out the \cs{tugstyinit} bones. |
| 290 |
% |
| 291 |
% \begin{macrocode} |
| 292 |
%<*ltugboatcls> |
| 293 |
\csname tugstyloaded@\endcsname |
| 294 |
\def\tugstyloaded@{\tugstyinit\endinput} |
| 295 |
% \end{macrocode} |
| 296 |
% |
| 297 |
% Acquire a name for this class if we don't already have one (by |
| 298 |
% virtue of having been loaded by |tugproc.cls|). This name will be |
| 299 |
% used in error messages and the like. |
| 300 |
% |
| 301 |
% \begin{macrocode} |
| 302 |
\providecommand{\@tugclass}{ltugboat} |
| 303 |
% \end{macrocode} |
| 304 |
% |
| 305 |
% Errors/warnings/information messages\Dash if we're using |
| 306 |
% \LaTeXe{} we can use the \cs{Class*} commands. \cs{tbdebug} is |
| 307 |
% different from all the others, intended for temporary debugging |
| 308 |
% messages (hence the all-lowercase name); they're started with |
| 309 |
% \texttt{***} at the beginning of a line to make them stand out, and be |
| 310 |
% parsable, e.g.\ by \texttt{texfot}(1). |
| 311 |
% |
| 312 |
% \begin{macrocode} |
| 313 |
\def\TBError{\ClassError{\@tugclass}} |
| 314 |
\def\TBWarning{\ClassWarning{\@tugclass}} |
| 315 |
\def\TBWarningNL{\ClassWarningNoLine{\@tugclass}} |
| 316 |
\def\TBInfo{\ClassInfo{\@tugclass}} |
| 317 |
\def\tbdebug#1{\message{^^J*** #1}} |
| 318 |
% \end{macrocode} |
| 319 |
% |
| 320 |
% Unfortunately, \LaTeX's \cs{loggingall} does not turn off |
| 321 |
% tracingonline. And \texttt{microtype} outputs useless verbose |
| 322 |
% expansions to the terminal after \cs{loggingall}. So make our own: |
| 323 |
% \begin{macrocode} |
| 324 |
\def\tbloggingall{\loggingall \tracingonline=0 } |
| 325 |
% \end{macrocode} |
| 326 |
% |
| 327 |
% |
| 328 |
% Class options: |draft| vs.\ |preprint| vs.\ |final|. |
| 329 |
% |
| 330 |
% \begin{macrocode} |
| 331 |
\DeclareOption{draft}{% [draft], the default |
| 332 |
% If the user loads hyperref, avoid passing on the global draft option |
| 333 |
% (which would remove all links in the pdf). |
| 334 |
\PassOptionsToPackage{final}{hyperref} |
| 335 |
% |
| 336 |
\AtEndOfClass{% |
| 337 |
\setcounter{page}{901}% |
| 338 |
\BlackBoxes |
| 339 |
\def\MakeRegistrationMarks{}% |
| 340 |
\PrelimDrafttrue |
| 341 |
}% |
| 342 |
} |
| 343 |
|
| 344 |
\newif\ifpreprint |
| 345 |
\def\preprint{\preprinttrue} % [preprint], hardly used |
| 346 |
\DeclareOption{preprint}{% |
| 347 |
\preprinttrue |
| 348 |
} |
| 349 |
|
| 350 |
\newif\iftubfinaloption % [final], manually inserted by us for processing |
| 351 |
\DeclareOption{final}{% |
| 352 |
\tubfinaloptiontrue |
| 353 |
\AtEndOfClass{% |
| 354 |
% Insert draft date into the header even with [final], if we are not |
| 355 |
% doing a production run. (|tugboat.dates| sets up page numbers |
| 356 |
% above 900 in such pseudo-draft mode.) We use [final] in the first |
| 357 |
% place for this case because draft vs. final can change page |
| 358 |
% layout, wrt registration marks, etc. (Not good, but too painful to |
| 359 |
% change at this late date.) |
| 360 |
\ifnum\value{page}>900 \PrelimDrafttrue \else \PrelimDraftfalse \fi |
| 361 |
\@tubrunningfull |
| 362 |
}% |
| 363 |
} |
| 364 |
% \end{macrocode} |
| 365 |
% |
| 366 |
% We want to use \texttt{hyperref}'s \cs{texorpdfstring}, e.g., in the |
| 367 |
% \texttt{draft} option above. If \texttt{hyperref} is not loaded, |
| 368 |
% define our own trivial fallback to expand to the \TeX\ (first) argument. |
| 369 |
% |
| 370 |
% Similarly, disable \acro and more if we have \texttt{hyperref}, |
| 371 |
% so section titles using them don't cause useless warnings. |
| 372 |
% |
| 373 |
% \begin{macrocode} |
| 374 |
\AtBeginDocument{% |
| 375 |
\ifx\undefined\texorpdfstring |
| 376 |
\DeclareRobustCommand{\texorpdfstring}[2]{#1}% |
| 377 |
\fi |
| 378 |
% |
| 379 |
\ifx\undefined\pdfstringdefDisableCommands\else |
| 380 |
\pdfstringdefDisableCommands{% |
| 381 |
\let\acro\relax |
| 382 |
\let\origDash=\Dash \def\Dash{\texorpdfstring{\origDash}{--}}% |
| 383 |
% lots more could/should be added. |
| 384 |
}% |
| 385 |
\fi |
| 386 |
} |
| 387 |
% \end{macrocode} |
| 388 |
% |
| 389 |
% \TUB\ uses only 10pt for the main text. |
| 390 |
% |
| 391 |
% \begin{macrocode} |
| 392 |
\DeclareOption{11pt}{% |
| 393 |
\TBWarning{The \@tugclass\space class only supports 10pt fonts: |
| 394 |
\MessageBreak option \CurrentOption\space ignored}% |
| 395 |
} |
| 396 |
\DeclareOption{12pt}{\csname ds@11pt\endcsname} |
| 397 |
% \end{macrocode} |
| 398 |
% |
| 399 |
% Similarly, ignore one/two-side options. |
| 400 |
% |
| 401 |
% \begin{macrocode} |
| 402 |
\DeclareOption{oneside}{\TBWarning{Option \CurrentOption\space ignored}} |
| 403 |
\DeclareOption{twoside}{\ds@oneside} |
| 404 |
% \end{macrocode} |
| 405 |
% |
| 406 |
% There are these people who seem to think |tugproc| is an option rather |
| 407 |
% than a class\dots{} (Note that it's already been filtered out if we |
| 408 |
% were calling from |ltugproc|.) |
| 409 |
% |
| 410 |
% \begin{macrocode} |
| 411 |
\DeclareOption{tugproc}{% |
| 412 |
\TBWarning{Option \CurrentOption\space ignored: use class ltugproc |
| 413 |
instead of \@tugclass}% |
| 414 |
} |
| 415 |
% \end{macrocode} |
| 416 |
% |
| 417 |
% Option |rawcite| (the default) specifies the default citation |
| 418 |
% mechanism (as built-in to \LaTeX); option |harvardcite| specifies |
| 419 |
% the author-date citation mechanism defined in |
| 420 |
% section~\ref{sec:citations} below. |
| 421 |
% |
| 422 |
% \begin{macrocode} |
| 423 |
\DeclareOption{rawcite}{\let\if@Harvardcite\iffalse} |
| 424 |
\DeclareOption{harvardcite}{\let\if@Harvardcite\iftrue} |
| 425 |
% \end{macrocode} |
| 426 |
% |
| 427 |
% Option |extralabel| (the default) specifies that the publication |
| 428 |
% years of two successive references with otherwise identical labels |
| 429 |
% will be tagged with distinguishing letters; option |noextralabel| |
| 430 |
% causes those letters to be suppressed. Note that (a) no two |
| 431 |
% references will in any case have the same labels in the default |
| 432 |
% (plain) |rawcite| setup, and that (b) the distinguishing letters |
| 433 |
% appear in the labels themselves; the reader can work out the |
| 434 |
% correspondence one with the other\dots |
| 435 |
% |
| 436 |
% \begin{macrocode} |
| 437 |
\DeclareOption{extralabel}{\let\UseExtraLabel\@firstofone} |
| 438 |
\DeclareOption{noextralabel}{\let\UseExtraLabel\@gobble} |
| 439 |
% \end{macrocode} |
| 440 |
% |
| 441 |
% The section-numbering style, so that we can allow the same heading |
| 442 |
% layout as in the plain macros. |
| 443 |
% |
| 444 |
% \begin{macrocode} |
| 445 |
\DeclareOption{numbersec}{\let\if@numbersec\iftrue} |
| 446 |
\DeclareOption{nonumber}{\let\if@numbersec\iffalse} |
| 447 |
% \end{macrocode} |
| 448 |
% |
| 449 |
% Minimal running headers/footers contain just the TUGboat volume/issue |
| 450 |
% identification and page numbers. `runningfull' is the default, and |
| 451 |
% includes title and author. `runningoff' makes both headers and |
| 452 |
% footers empty. |
| 453 |
% |
| 454 |
% \begin{macrocode} |
| 455 |
\DeclareOption{runningoff}{\AtEndOfClass{\@tubrunningoff}} |
| 456 |
\DeclareOption{runningminimal}{\AtEndOfClass{\@tubrunningminimal}} |
| 457 |
\DeclareOption{runningfull}{\AtEndOfClass{\@tubrunningfull}} |
| 458 |
% \end{macrocode} |
| 459 |
% |
| 460 |
% Usually we want to print the doi if [final], else not. |
| 461 |
% But sometimes we want to omit it even if [final], namely when we're |
| 462 |
% posting a review or other item early. |
| 463 |
% |
| 464 |
% \begin{macrocode} |
| 465 |
\newif\iftubomitdoioption |
| 466 |
\DeclareOption{omitdoi}{% |
| 467 |
\tubomitdoioptiontrue |
| 468 |
} |
| 469 |
% \end{macrocode} |
| 470 |
% |
| 471 |
% \begin{macro}{\if@tubtwocolumn} |
| 472 |
% Occasionally (|tb107jackowski|, and past conference preprints), we |
| 473 |
% need the option |onecolumn|. For alternative approaches to one-column |
| 474 |
% articles, see |tb92hagen-euler| and |tb78milo|. |
| 475 |
% |
| 476 |
% \begin{macrocode} |
| 477 |
\newif\if@tubtwocolumn \@tubtwocolumntrue |
| 478 |
\DeclareOption{onecolumn}{\@tubtwocolumnfalse} |
| 479 |
% \end{macrocode} |
| 480 |
% \end{macro} |
| 481 |
% |
| 482 |
% \begin{macro}{\ifsecondcolstart} |
| 483 |
% Occasionally, we need to start an article in the second column of a |
| 484 |
% page, due to splicing with a previous article. Let's try declaring that. |
| 485 |
% Then, before |\maketitle|, we'll force the move to the second column. |
| 486 |
% |
| 487 |
% And sometimes we need to add space at the top of that second column |
| 488 |
% (e.g., |tb136lettre|); there's no way to intervene in the article |
| 489 |
% source, so define a hook |\tubsecondcolstartextra|. |
| 490 |
% |
| 491 |
% \begin{macrocode} |
| 492 |
\newif\iftubsecondcolstart |
| 493 |
\DeclareOption{secondcolstart}{\tubsecondcolstarttrue} |
| 494 |
\let\tubsecondcolstartextra\relax |
| 495 |
% \end{macrocode} |
| 496 |
% \end{macro} |
| 497 |
% |
| 498 |
% Any other options, we pass on to |article.cls| before we load it: |
| 499 |
% |
| 500 |
% \begin{macrocode} |
| 501 |
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} |
| 502 |
% \end{macrocode} |
| 503 |
% |
| 504 |
% Request default options (draft mode, standard citation, numbered |
| 505 |
% sections, etc.), process all options, and then get the base document |
| 506 |
% class on top of which we reside, namely |article|. Always call |
| 507 |
% |article| with the |twoside| option, since we want the ability to have |
| 508 |
% odd/even headers/footers. |
| 509 |
% |
| 510 |
% \begin{macrocode} |
| 511 |
\ExecuteOptions{draft,extralabel,numbersec,rawcite,runningminimal} |
| 512 |
\ProcessOptions |
| 513 |
\LoadClass[twoside]{article} |
| 514 |
% \end{macrocode} |
| 515 |
% |
| 516 |
% Various fonts used throughout. Some effort has been made to |
| 517 |
% suppress these things with explicit sizes in the macro name |
| 518 |
% (\cs{tensl} is an example below), but keeping in step with the |
| 519 |
% documentation is one thing that restricts such a move. |
| 520 |
% |
| 521 |
% \begin{macrocode} |
| 522 |
\def\sectitlefont{\fontfamily\sfdefault\fontseries{bx}\fontshape{n}% |
| 523 |
\fontsize\@xviipt\stbaselineskip\selectfont} |
| 524 |
\def\tensl{\fontseries{m}\fontshape{sl}\fontsize\@xpt\@xiipt |
| 525 |
\selectfont} |
| 526 |
% \end{macrocode} |
| 527 |
% |
| 528 |
% This font selection command is used \emph{only} for the `Editor's |
| 529 |
% Note' introduction to notes; sadly it makes explicit reference to |
| 530 |
% \textsc{cmr}, and Barbara Beeton has agreed that the reference may be |
| 531 |
% constructed to use the current family such that, if no upright |
| 532 |
% italic is defined, ordinary italics are used. A project for |
| 533 |
% later\dots |
| 534 |
% |
| 535 |
% \begin{macrocode} |
| 536 |
\ifTBunicodeengine |
| 537 |
% there is no "LM unslanted" in OpenType, so use the standard cmu |
| 538 |
% scaled for the current text size. Not worth more effort. |
| 539 |
\def\EdNoteFont{\font\ednotefont = cmu10 at 1em } |
| 540 |
\else % traditional engine: |
| 541 |
\def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}\selectfont} |
| 542 |
\fi |
| 543 |
%</ltugboatcls> |
| 544 |
% \end{macrocode} |
| 545 |
% |
| 546 |
% If Ulrik Vieth's |mflogo.sty| is around, we'll use it. Otherwise |
| 547 |
% (pro tem, at least) we'll warn the user and define the absolute |
| 548 |
% minimum of machinery that \TUB{} requires (that which was used |
| 549 |
% prior to the invention of \LaTeXe). |
| 550 |
% \begin{macrocode} |
| 551 |
%<*common> |
| 552 |
\IfFileExists{mflogo.sty}% |
| 553 |
{\RequirePackage{mflogo}}% |
| 554 |
%<!ltugcomn> {\TBWarning |
| 555 |
%<ltugcomn> {\PackageWarning{ltugcomn} |
| 556 |
{Package mflogo.sty not available --\MessageBreak |
| 557 |
Proceeding to emulate mflogo.sty} |
| 558 |
\DeclareRobustCommand{\logofamily}{% |
| 559 |
\not@math@alphabet\logofamily\relax |
| 560 |
\fontencoding{U}\fontfamily{logo}\selectfont} |
| 561 |
\DeclareTextFontCommand{\textlogo}{\logofamily} |
| 562 |
\def\MF{\textlogo{META}\-\textlogo{FONT}\@} |
| 563 |
\def\MP{\textlogo{META}\-\textlogo{POST}\@} |
| 564 |
\DeclareFontFamily{U}{logo}{} |
| 565 |
\DeclareFontShape{U}{logo}{m}{n}{% |
| 566 |
<8><9>gen*logo% |
| 567 |
<10><10.95><12><14.4><17.28><20.74><24.88>logo10% |
| 568 |
}{} |
| 569 |
\DeclareFontShape{U}{logo}{m}{sl}{% |
| 570 |
<8><9>gen*logosl% |
| 571 |
<10><10.95><12><14.4><17.28><20.74><24.88>logosl10% |
| 572 |
}{} |
| 573 |
\DeclareFontShape{U}{logo}{m}{it}{% |
| 574 |
<->ssub*logo/m/sl% |
| 575 |
}{}% |
| 576 |
} |
| 577 |
% \end{macrocode} |
| 578 |
% |
| 579 |
% \subsection{Resetting at start of paper} |
| 580 |
% |
| 581 |
% \begin{macro}{\ResetCommands} |
| 582 |
% \begin{macro}{\AddToResetCommands} |
| 583 |
% \begin{macro}{\StartNewPaper} |
| 584 |
% We store a set of commands that should be executed at the start of |
| 585 |
% each paper, before any paper-specific customisation. These commands |
| 586 |
% (stored in the token register \cs{ResetCommands}) include things |
| 587 |
% such as resetting section and footnote numbers, re-establishing |
| 588 |
% default settings of typesetting parameters, and so on. The user (or |
| 589 |
% more typically, editor) may execute the commands by using the |
| 590 |
% command \cs{StartNewPaper}. Things I've not yet thought of may be |
| 591 |
% added to the list of commands, by |
| 592 |
% \begin{macrocode} |
| 593 |
\newtoks\ResetCommands |
| 594 |
\ResetCommands{% |
| 595 |
\setcounter{part}{0}% |
| 596 |
\setcounter{section}{0}% |
| 597 |
\setcounter{footnote}{0}% |
| 598 |
\authornumber\z@ |
| 599 |
} |
| 600 |
\newcommand{\AddToResetCommands}[1]{% |
| 601 |
\AddToResetCommands\expandafter{\AddToResetCommands#1}% |
| 602 |
} |
| 603 |
% \end{macrocode} |
| 604 |
% \end{macro} |
| 605 |
% \end{macro} |
| 606 |
% \end{macro} |
| 607 |
% |
| 608 |
% \subsection{Helpful shorthands (common code with Plain styles)} |
| 609 |
% |
| 610 |
% \cs{makeescape}, \dots, \cs{makecomment} allow users to change the |
| 611 |
% category code of a single character a little more easily. These |
| 612 |
% require that the character be addressed as a control sequence: |
| 613 |
% e.g., |\makeescape\/| will make `|/|' an escape character. |
| 614 |
% |
| 615 |
% \begin{macrocode} |
| 616 |
%<*!latex> |
| 617 |
\def\makeescape#1{\catcode`#1=0 } |
| 618 |
\def\makebgroup#1{\catcode`#1=1 } |
| 619 |
\def\makeegroup#1{\catcode`#1=2 } |
| 620 |
\def\makemath #1{\catcode`#1=3 } |
| 621 |
%</!latex> |
| 622 |
%<*latex> |
| 623 |
\def\makeescape#1{\catcode`#1=\z@} |
| 624 |
\def\makebgroup#1{\catcode`#1=\@ne} |
| 625 |
\def\makeegroup#1{\catcode`#1=\tw@} |
| 626 |
\def\makemath #1{\catcode`#1=\thr@@} |
| 627 |
%</latex> |
| 628 |
\def\makealign #1{\catcode`#1=4 } |
| 629 |
\def\makeeol #1{\catcode`#1=5 } |
| 630 |
\def\makeparm #1{\catcode`#1=6 } |
| 631 |
\def\makesup #1{\catcode`#1=7 } |
| 632 |
\def\makesub #1{\catcode`#1=8 } |
| 633 |
\def\makeignore#1{\catcode`#1=9 } |
| 634 |
\def\makespace #1{\catcode`#1=10 } |
| 635 |
\def\makeletter#1{\catcode`#1=11 } |
| 636 |
\chardef\other=12 |
| 637 |
\let\makeother\@makeother |
| 638 |
\def\makeactive#1{\catcode`#1=13 } |
| 639 |
\def\makecomment#1{\catcode`#1=14 } |
| 640 |
% \end{macrocode} |
| 641 |
% |\savecat#1| and |\restorecat#1| will save and restore the category |
| 642 |
% of a given character. These are useful in cases where one doesn't |
| 643 |
% wish to localize the settings and therefore be required to globally |
| 644 |
% define or set things. |
| 645 |
% \begin{macrocode} |
| 646 |
\def\savecat#1{% |
| 647 |
\expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}} |
| 648 |
\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname} |
| 649 |
%<!latex>\savecat\@ |
| 650 |
%<!latex>\makeletter\@ |
| 651 |
% \end{macrocode} |
| 652 |
% |
| 653 |
% |\SaveCS#1| and |\RestoreCS#1| save and restore `meanings' of control |
| 654 |
% sequences. Again this is useful in cases where one doesn't want to |
| 655 |
% localize or where global definitions clobber a control sequence which |
| 656 |
% is needed later with its `old' definition. |
| 657 |
% |
| 658 |
% \begin{macrocode} |
| 659 |
\def\SaveCS#1{\expandafter\let\csname saved@@#1\expandafter\endcsname |
| 660 |
\csname#1\endcsname} |
| 661 |
\def\RestoreCS#1{\expandafter\let\csname#1\expandafter\endcsname |
| 662 |
\csname saved@@#1\endcsname} |
| 663 |
% \end{macrocode} |
| 664 |
% To distinguish between macro files loaded |
| 665 |
% \begin{macrocode} |
| 666 |
\def\plaintubstyle{plain} |
| 667 |
\def\latextubstyle{latex} |
| 668 |
% \end{macrocode} |
| 669 |
% |
| 670 |
% Control sequences that were first defined in \LaTeXe{} of |
| 671 |
% 1995/06/01 (or later), but which we merrily use. Only define if |
| 672 |
% necessary: |
| 673 |
% |
| 674 |
% \begin{macrocode} |
| 675 |
\providecommand\hb@xt@{\hbox to} |
| 676 |
\providecommand\textsuperscript[1]{\ensuremath{\m@th |
| 677 |
^{\mbox{\fontsize\sf@size\z@ |
| 678 |
\selectfont #1}}}} |
| 679 |
% \end{macrocode} |
| 680 |
% (Note that that definition of \cs{textsuperscript} isn't robust, but |
| 681 |
% probably doesn't need to be\dots What's more, it doesn't appear in |
| 682 |
% the mythical 2.09 version of the package.) |
| 683 |
% |
| 684 |
% We end up wanting this fairly often, and \LaTeX\ removed \cs{line}. |
| 685 |
% \begin{macrocode} |
| 686 |
\def\tubline{\hbox to \hsize} |
| 687 |
% \end{macrocode} |
| 688 |
% |
| 689 |
% \subsection{Abbreviations and logos} |
| 690 |
% \label{abbr-logo} |
| 691 |
% |
| 692 |
% Font used for the METAFONT logo, etc. |
| 693 |
% \begin{macrocode} |
| 694 |
\DeclareRobustCommand{\AllTeX}{% |
| 695 |
\texorpdfstring{(\La\kern-.075em)\kern-.05em\TeX}{(La)TeX}} |
| 696 |
\def\AMS{American Mathematical Society} |
| 697 |
\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox |
| 698 |
{$\mathcal{M}$}\kern-.125em$\mathcal{S}$} |
| 699 |
\def\AmSLaTeX{\AmS-\LaTeX} |
| 700 |
\def\AmSTeX{\AmS-\TeX} |
| 701 |
\def\ANSI{\acro{ANSI}} |
| 702 |
\def\API{\acro{API}} |
| 703 |
\def\ASCII{\acro{ASCII}} |
| 704 |
\def\aw{\acro{A\kern.04em\raise.115ex\hbox{-}W}} |
| 705 |
\def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley} |
| 706 |
% |
| 707 |
% make \BibTeX work in slanted contexts too; it's common in titles, and |
| 708 |
% especially burdensome to hack in .bib files. |
| 709 |
\def\Bib{% |
| 710 |
\ifdim \fontdimen1\font>0pt |
| 711 |
B{\SMC\SMC IB}% |
| 712 |
\else |
| 713 |
B\textsc{ib}% LaTeX has more kerns, but they are too much to our eyes |
| 714 |
\fi |
| 715 |
} |
| 716 |
\def\BibLaTeX{\texorpdfstring{\Bib\-\kern.02em \LaTeX}{BibLaTeX}} |
| 717 |
\def\BibTeX{\texorpdfstring{\Bib\-\kern-.04em \TeX}{BibTeX}} |
| 718 |
% no good way to determine bold font, and we want to lose the kern, too: |
| 719 |
% (we \let BibTeX to this in maketitle) |
| 720 |
\def\bfBib{B{\SMC\SMC IB}} |
| 721 |
\def\bfBibTeX{\texorpdfstring{\bfBib\TeX}{BibTeX}} |
| 722 |
\def\bfBibLaTeX{\texorpdfstring{\bfBib\LaTeX}{BibLaTeX}} |
| 723 |
% |
| 724 |
\def\BSD{\acro{BSD}} |
| 725 |
\def\CandT{\textsl{Computers~\& Typesetting}} |
| 726 |
% must not define \CJK, because the CJK package does. |
| 727 |
% \end{macrocode} |
| 728 |
% We place our \cs{kern} after \cs{-} so that it disappears if the |
| 729 |
% hyphenation is taken: |
| 730 |
% \begin{macrocode} |
| 731 |
\def\ConTeXt{\texorpdfstring{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt} |
| 732 |
{ConTeXt}} |
| 733 |
\def\CMkIV{\ConTeXt\ \MkIV} |
| 734 |
\def\Cplusplus{C\plusplus} |
| 735 |
% |
| 736 |
% Turns out this original TUB definition has different output under |
| 737 |
% pdftex and lua/xetex, because, ultimately, the axis in the OTF math |
| 738 |
% cm fonts (newcm, latinmodern-math) fonts is at 57 units instead of 70 |
| 739 |
% units. Why Jacko did this is unknown, but can't be changed now. |
| 740 |
%original TUGboat: \def\plusplus{\raisebox{.7ex}{$_{++}$}} |
| 741 |
% |
| 742 |
% We can't avoid OTF math in general. So we change the definition not to |
| 743 |
% use math. The results are the same within a couple of decimal places |
| 744 |
% (didn't seem to matter to make it exact), and it's simpler besides. |
| 745 |
\def\plusplus{\raise .351ex \hbox{\scriptsize ++}} |
| 746 |
% |
| 747 |
% consider rm vs. bold + tb139may-automata.ltx |
| 748 |
\def\CPU{\acro{CPU}} |
| 749 |
\def\CSczabbr{\ensuremath{\cal C}\kern-.1667em\lower.5ex\hbox{$\cal S$}} |
| 750 |
\def\CSS{\acro{CSS}} |
| 751 |
\def\CSTUG{\CSczabbr\kern.05em\acro{TUG}} |
| 752 |
\def\CSV{\acro{CSV}} |
| 753 |
\def\CTAN{\acro{CTAN}} |
| 754 |
\def\DTD{\acro{DTD}} |
| 755 |
\def\DTK{\acro{DTK}} |
| 756 |
\def\DVD{\acro{DVD}} |
| 757 |
\def\DVI{\acro{DVI}} |
| 758 |
\def\DVIPDFMx{\acro{DVIPDFM}$x$} |
| 759 |
\def\DVItoVDU{DVIto\kern-.12em VDU} |
| 760 |
\def\ECMA{\acro{ECMA}} |
| 761 |
\def\EPS{\acro{EPS}} |
| 762 |
% no line break at this hyphen please, and try to get a bold \varepsilon. |
| 763 |
\def\TUBdefaulteTeX{\ensuremath{\varepsilon}\mbox{-}\kern-.125em\TeX}% |
| 764 |
\DeclareRobustCommand{\eTeX}{% |
| 765 |
\ifx\f@series\bfseries@rm |
| 766 |
\ifx\boldsymbol\undefined % \boldsymbol is from amsmath; also support bm? |
| 767 |
\TBWarning{bold varepsilon for \string\eTeX\space not available; load amsmath}% |
| 768 |
\TUBdefaulteTeX |
| 769 |
\else |
| 770 |
\ensuremath{\boldsymbol{\varepsilon}}\mbox{-}\kern-.125em\TeX |
| 771 |
\fi |
| 772 |
\else |
| 773 |
\TUBdefaulteTeX |
| 774 |
\fi |
| 775 |
} |
| 776 |
\DeclareRobustCommand{\ExTeX}{% |
| 777 |
\ensuremath{\textstyle\varepsilon_{\kern-0.15em\cal{X}}}\kern-.2em\TeX} |
| 778 |
\def\FAQ{\acro{FAQ}} |
| 779 |
\def\FTP{\acro{FTP}} |
| 780 |
\def\Ghostscript{Ghost\-script} |
| 781 |
\def\GNU{\acro{GNU}} |
| 782 |
\def\GUI{\acro{GUI}} |
| 783 |
\DeclareRobustCommand{\HarfBuzz}{Harf\discretionary{-}{}{\kern.077em}Buzz} |
| 784 |
\def\Hawaii{Hawai`i} |
| 785 |
\def\HTML{\acro{HTML}} |
| 786 |
\def\HTTP{\acro{HTTP}} |
| 787 |
\def\HTTPS{\acro{HTTPS}} |
| 788 |
\def\iOS{i\acro{OS}} |
| 789 |
\def\IDE{\acro{IDE}} |
| 790 |
\def\IEEE{\acro{IEEE}} |
| 791 |
\def\ISBN{\acro{ISBN}} |
| 792 |
\def\ISO{\acro{ISO}} |
| 793 |
\def\ISSN{\acro{ISSN}} |
| 794 |
\def\JPEG{\acro{JPEG}} |
| 795 |
\def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}} |
| 796 |
\def\JoT{\textsl{The Joy of \TeX}} |
| 797 |
\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em% |
| 798 |
M\kern.05em A\kern.1em\hyph\kern.1em Script}} |
| 799 |
\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em |
| 800 |
$\m@th$\fontsize\sf@size\z@\selectfont |
| 801 |
$\m@th\mathcal{A}$}% |
| 802 |
\kern-.2em\lower.376ex\hbox{$\m@th\mathcal{M}$}\kern-.125em |
| 803 |
{$\m@th\mathcal{S}$}-\TeX} |
| 804 |
% This code |
| 805 |
% is hacked from its definition of \cs{LaTeX}; it allows slants (for |
| 806 |
% example) to propagate into the raised (small) `A': |
| 807 |
% \begin{macrocode} |
| 808 |
\DeclareRobustCommand{\La}% |
| 809 |
{L\kern-.36em |
| 810 |
{\setbox0\hbox{T}% |
| 811 |
\vbox to\ht0{\hbox{$\m@th$% |
| 812 |
\csname S@\f@size\endcsname |
| 813 |
\fontsize\sf@size\z@ |
| 814 |
\math@fontsfalse\selectfont |
| 815 |
A}% |
| 816 |
\vss}% |
| 817 |
}} |
| 818 |
% \end{macrocode} |
| 819 |
% |
| 820 |
% We started with the intention that we wouldn't redefine \cs{LaTeX} |
| 821 |
% when we're running under it, so as not to trample on an existing |
| 822 |
% definition. However, this proves less than satisfactory; a single |
| 823 |
% logo may be OK for the run of documents, but for \TUB{}, we find |
| 824 |
% that something noticeably better is necessary; see section |
| 825 |
% \ref{sec:latex-logo}. |
| 826 |
% |
| 827 |
% \begin{macrocode} |
| 828 |
%<!latex>\def\LaTeX{\La\kern-.15em\TeX} |
| 829 |
\def\LMTX{\acro{LMTX}} |
| 830 |
\def\LuaHBTeX{Lua\acro{HB}\-\TeX}% |
| 831 |
\def\LuaHBLaTeX{Lua\acro{HB}\-\LaTeX}% |
| 832 |
\def\LuaLaTeX{Lua\-\LaTeX}% dtk-logos defines it and people like to use it |
| 833 |
\def\LuaTeX{Lua\-\TeX}% ditto |
| 834 |
\def\luatex{\LuaTeX}% ditto |
| 835 |
\def\LyX{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX} |
| 836 |
\def\macOS{mac\acro{OS}} |
| 837 |
\def\MacOSX{Mac\,\acro{OS\,X}} |
| 838 |
\def\MathML{Math\acro{ML}} |
| 839 |
\def\Mc{\setbox\TestBox=\hbox{M}M\vbox |
| 840 |
to\ht\TestBox{\hbox{c}\vfil}} % for Robert McGaffey |
| 841 |
% \end{macrocode} |
| 842 |
% |
| 843 |
% If we're running under \LaTeXe, we use Ulrik Vieth's |mflogo.sty| if |
| 844 |
% it's present. Otherwise, we're using a short extract of Vieth's |
| 845 |
% stuff. Either way, we don't need to specify \cs{MF} or \cs{MP}. |
| 846 |
% |
| 847 |
% \begin{macrocode} |
| 848 |
\def\mf{\textsc{Metafont}} |
| 849 |
\def\MFB{\textsl{The \MF\kern.1em\-book}} |
| 850 |
\def\MkIV{Mk\acro{IV}} |
| 851 |
\let\TB@@mp\mp |
| 852 |
\DeclareRobustCommand{\mp}{\ifmmode\TB@@mp\else MetaPost\fi} |
| 853 |
\def\mtex{T\kern-.1667em\lower.424ex\hbox{\^E}\kern-.125emX\@} |
| 854 |
% |
| 855 |
% In order that the \cs{OMEGA} command will switch to using the TS1 |
| 856 |
% variant of the capital Omega character if \texttt{textcomp.sty} is |
| 857 |
% loaded, we define it in terms of the \cs{textohm} command. Note |
| 858 |
% that this requires us to interpose a level of indirection, rather |
| 859 |
% than to use \cs{let}\dots |
| 860 |
% Revised definition of \cs{NTS} based on that used by Phil Taylor. |
| 861 |
% |
| 862 |
% \begin{macrocode} |
| 863 |
\DeclareRobustCommand{\NTG}{\acro{NTG}} |
| 864 |
\DeclareRobustCommand{\NTS}{\ensuremath{\mathcal{N}\mkern-4mu |
| 865 |
\raisebox{-0.5ex}{$\mathcal{T}$}\mkern-2mu \mathcal{S}}} |
| 866 |
\DeclareTextSymbol{\textohm}{OT1}{'012} |
| 867 |
\DeclareTextSymbolDefault{\textohm}{OT1} |
| 868 |
\newcommand{\OMEGA}{\textohm} |
| 869 |
\DeclareRobustCommand{\OCP}{\OMEGA\acro{CP}} |
| 870 |
\DeclareRobustCommand{\OOXML}{\acro{OOXML}} |
| 871 |
\DeclareRobustCommand{\OTF}{\acro{OTF}} |
| 872 |
\DeclareRobustCommand{\OTP}{\OMEGA\acro{TP}} |
| 873 |
\DeclareRobustCommand{\OpTeX}{\texorpdfstring{Op\kern-.05em\TeX}{OpTeX}} |
| 874 |
% \end{macrocode} |
| 875 |
% \begin{macrocode} |
| 876 |
\def\Pas{Pascal} |
| 877 |
\def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}MF\@} |
| 878 |
\def\PCTeX{PC\thinspace\TeX} |
| 879 |
\def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}\TeX} |
| 880 |
\def\pdfLaTeX{pdf\/\-\LaTeX}% dtk-logos |
| 881 |
\def\pdflatex{\pdfLaTeX} |
| 882 |
\def\pdfTeX{pdf\/\-\TeX}% dtk-logos |
| 883 |
\def\pdftex{\pdfTeX} |
| 884 |
\def\PDF{\acro{PDF}} |
| 885 |
\def\PDFUA{\acro{PDF/UA}} |
| 886 |
\def\PGF{\acro{PGF}} |
| 887 |
\def\PHP{\acro{PHP}} |
| 888 |
\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\@} |
| 889 |
\def\PiCTeX{\PiC\kern-.11em\TeX} |
| 890 |
\def\plain{\texttt{plain}} |
| 891 |
\def\PNG{\acro{PNG}} |
| 892 |
\def\POBox{P.\thinspace O.~Box } |
| 893 |
\def\PS{{Post\-Script}} |
| 894 |
\def\PSTricks{\acro{PST}ricks} |
| 895 |
\def\RIT{\acro{RIT}} |
| 896 |
\def\RTF{\acro{RTF}} |
| 897 |
\def\SC{Steering Committee} |
| 898 |
\def\SGML{\acro{SGML}} |
| 899 |
\def\SliTeX{\textrm{S\kern-.06em\textsc{l\kern-.035emi}% |
| 900 |
\kern-.06em\TeX}} |
| 901 |
\def\slMF{\textsl{\MF}} % should never be used |
| 902 |
\def\SQL{\acro{SQL}} |
| 903 |
\def\stTeX{\textsc{st}\kern-0.13em\TeX} |
| 904 |
\def\STIX{\acro{STIX}} |
| 905 |
\def\SVG{\acro{SVG}} |
| 906 |
\def\TANGLE{\texttt{TANGLE}\@} |
| 907 |
\def\TB{\textsl{The \TeX\-book}} |
| 908 |
\def\TIFF{\acro{TIFF}} |
| 909 |
\def\TP{\textsl{\TeX:\ The Program}} |
| 910 |
\DeclareRobustCommand{\TeX}{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@} |
| 911 |
\def\TeXhax{\TeX hax} |
| 912 |
\def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}% |
| 913 |
\kern-.2267emG\@} |
| 914 |
\def\TeXtures{\textit{Textures}} |
| 915 |
\let\Textures=\TeXtures |
| 916 |
\def\TeXworks{\TeX\kern-.07em works} |
| 917 |
\def\TeXXeT{\TeX-{}-\XeT} |
| 918 |
\def\TFM{\acro{TFM}} |
| 919 |
\ifTBunicodeengine |
| 920 |
\AtBeginDocument{% in case a different font is loaded |
| 921 |
% \iffontchar is from e-TeX; safe to use under Unicode engines. |
| 922 |
\iffontchar\font"1EBF |
| 923 |
\def\TBecircacute{\char"1EBF }% |
| 924 |
\else |
| 925 |
\def\TBecircacute{\^e\llap{\raise 0.5ex\hbox{\'{}}}}% |
| 926 |
\fi |
| 927 |
\def\Thanh{H\`an~Th\TBecircacute~Th\`anh}% |
| 928 |
}% |
| 929 |
\else % non-Unicode engine, use our traditional definition. |
| 930 |
\def\Thanh{H\`an~Th\^e\llap{\raise 0.5ex\hbox{\'{}}}~Th\`anh} |
| 931 |
% We could also go the other direction, and always use the Unicode |
| 932 |
% character, after: |
| 933 |
% \ifdefined\DeclareUnicodeCharacter |
| 934 |
% \DeclareUnicodeCharacter{1EBF}{\^e\llap{\raise 0.5ex\hbox{\'{}}}} |
| 935 |
% \fi |
| 936 |
% but let's make the smaller change. |
| 937 |
\fi |
| 938 |
\def\TikZ{Ti\/{\em k}Z} |
| 939 |
\def\ttn{\textsl{TTN}\@} |
| 940 |
\def\TTN{\textsl{\TeX{} and TUG News}} |
| 941 |
\def\TUB{\texttub{TUGboat}}\def\texttub{\textsl} % redefined in some situations |
| 942 |
\def\TUG{\TeX\ \UG} |
| 943 |
\def\tug{\acro{TUG}} |
| 944 |
\def\UG{Users Group} |
| 945 |
\def\UNIX{\acro{UNIX}} |
| 946 |
% Don't define \UTF, since other packages use it for Unicode character access. |
| 947 |
% On the other hand, we want a macro for UTF-8 that doesn't break at a |
| 948 |
% following -, as in \tbUTF-8. |
| 949 |
\def\tbUTF{\acro{UTF}\futurelet\@nextchar\@tbUTFcheck} |
| 950 |
\def\@tbUTFcheck{\ifx\@nextchar-% |
| 951 |
\mbox{-}\let\next=\tbgobbledash |
| 952 |
\else |
| 953 |
\let\next=\empty |
| 954 |
\fi\next} |
| 955 |
\def\tbgobbledash-{} |
| 956 |
\def\VAX{V\kern-.12em A\kern-.1em X\@} |
| 957 |
\def\VnTeX{V\kern-.03em n\kern-.02em \TeX} |
| 958 |
\def\VorTeX{V\kern-2.7\p@\lower.5ex\hbox{O\kern-1.4\p@ R}\kern-2.6\p@\TeX} |
| 959 |
\def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\@} |
| 960 |
\def\XML{\acro{XML}} |
| 961 |
\def\XMP{\acro{XMP}} |
| 962 |
\def\WEB{\texorpdfstring{\texttt{WEB}\@}{WEB}} |
| 963 |
\def\WEAVE{\texttt{WEAVE}\@} |
| 964 |
\def\WYSIWYG{\acro{WYSIWYG}} |
| 965 |
% \end{macrocode} |
| 966 |
% |
| 967 |
% Xe\TeX{} requires reflecting the first E, hence we complain if the |
| 968 |
% graphics package is not present. (For plain documents, this can be |
| 969 |
% loaded via \texttt{miniltx} or Eplain.) Also, at Barbara's |
| 970 |
% suggestion, if the current font is slanted, we rotate by 180 instead |
| 971 |
% of reflecting so there is a better chance to look ok. (The magic |
| 972 |
% values here seem more or less ok for \texttt{cmsl} and \texttt{cmti}.) |
| 973 |
% |
| 974 |
% \begin{macrocode} |
| 975 |
\def\tubreflect#1{% |
| 976 |
\@ifundefined{reflectbox}{% |
| 977 |
\TBError{A graphics package must be loaded to use \string\XeTeX} |
| 978 |
{Load graphicx or graphics.}% |
| 979 |
}{% |
| 980 |
\ifdim \fontdimen1\font>0pt |
| 981 |
\raise 1.75ex \hbox{\kern.1em\rotatebox{180}{#1}}\kern-.1em |
| 982 |
\else |
| 983 |
\reflectbox{#1}% |
| 984 |
\fi |
| 985 |
}% |
| 986 |
} |
| 987 |
\def\tubhideheight#1{\setbox0=\hbox{#1}\ht0=0pt \dp0=0pt \box0 } |
| 988 |
\def\XekernbeforeE{-.125em} |
| 989 |
\def\XekernafterE{-.1667em} |
| 990 |
% From Max, mail of 13sep24: |
| 991 |
% hyperref is trying to expand \Xe to get a string for |
| 992 |
% the embedded PDF table of contents, but \Xe is unsafe in an |
| 993 |
% expansion-only context [even when defined with \DeclareRobustCommand, |
| 994 |
% for reasons unknown]. |
| 995 |
% An easy way to fix this is to replace \DeclareRobustCommand with |
| 996 |
% \NewDocumentCommand, which defines the macro as ``\protected'' instead |
| 997 |
% as ``\protect''ed. |
| 998 |
\NewDocumentCommand\tub@Xe{}{\leavevmode |
| 999 |
\tubhideheight{\hbox{X% |
| 1000 |
\setbox0=\hbox{\TeX}\setbox1=\hbox{E}% |
| 1001 |
\ifdim \fontdimen1\font>0pt |
| 1002 |
% XeTeX logo needs tinkering when slanted/italic font, |
| 1003 |
% so make kerns changeable |
| 1004 |
\def\XekernbeforeE{-.11em}% |
| 1005 |
\def\XekernafterE{-.16em}% |
| 1006 |
\dp1=-.17ex |
| 1007 |
\fi |
| 1008 |
\lower\dp0\hbox{\raise\dp1\hbox{\kern\XekernbeforeE\tubreflect{E}}}% |
| 1009 |
\kern\XekernafterE}}} |
| 1010 |
% [But then,] For hyperref to be able to see the \texorpdfstring, it |
| 1011 |
% needs to be inside of a non-protected macro, but we still want the |
| 1012 |
% graphics commands to be protected, so we need to make a wrapper command: |
| 1013 |
\newcommand\Xe{\texorpdfstring{\tub@Xe}{Xe}} |
| 1014 |
\def\XeTeX{\texorpdfstring{\Xe\TeX}{XeTeX}} |
| 1015 |
\def\XeLaTeX{\texorpdfstring{\Xe{\kern.11em \LaTeX}}{XeLaTeX}} |
| 1016 |
% |
| 1017 |
\def\XHTML{\acro{XHTML}} |
| 1018 |
\def\XSL{\acro{XSL}} |
| 1019 |
\def\XSLFO{\acro{XSL}\raise.08ex\hbox{-}\acro{FO}} |
| 1020 |
\def\XSLT{\acro{XSLT}} |
| 1021 |
\def\YAML{\acro{YAML}} |
| 1022 |
% \end{macrocode} |
| 1023 |
% |
| 1024 |
% \subsection{General typesetting rules} |
| 1025 |
% |
| 1026 |
% \begin{macrocode} |
| 1027 |
\newlinechar=`\^^J |
| 1028 |
\normallineskiplimit=\p@ |
| 1029 |
\clubpenalty=10000 |
| 1030 |
\widowpenalty=10000 |
| 1031 |
\def\NoParIndent{\parindent=\z@} |
| 1032 |
\newdimen\normalparindent |
| 1033 |
\normalparindent=20\p@ |
| 1034 |
\def\NormalParIndent{\global\parindent=\normalparindent} |
| 1035 |
\NormalParIndent |
| 1036 |
\def\BlackBoxes{\overfullrule=5\p@} |
| 1037 |
\def\NoBlackBoxes{\overfullrule=\z@} |
| 1038 |
\def\newline{\hskip\z@\@plus\pagewd\break} |
| 1039 |
% \end{macrocode} |
| 1040 |
% |
| 1041 |
% \begin{macro}{\tubsentencespace} |
| 1042 |
% Occasionally, notably after citations that need to come after a |
| 1043 |
% sentence-ending period, we want to tell \TeX\ that it's still at the |
| 1044 |
% end of a sentence. As in: |
| 1045 |
% |... whatever. \cite{foo}\tubsentencespace| |
| 1046 |
% This happens when, e.g., the reference applies to more than the final |
| 1047 |
% sentence. Also can be needed when \cs{@} cannot be used because the |
| 1048 |
% sentence-ending punctuation itself occurs inside a control sequence |
| 1049 |
% that prevents it. |
| 1050 |
% |
| 1051 |
% \begin{macrocode} |
| 1052 |
\def\tubsentencespace{\spacefactor=3000{}\space\ignorespaces} |
| 1053 |
% \end{macrocode} |
| 1054 |
% \end{macro} |
| 1055 |
% |
| 1056 |
% \begin{macro}{\tubdots} |
| 1057 |
% Latin Modern and many other fonts irritatingly make the Unicode |
| 1058 |
% ellipsis character (U+2026) a single character's width, typically more |
| 1059 |
% squashed together than three period characters. This just looks wrong. |
| 1060 |
% It is too painful to try to redefine in general, but provide the |
| 1061 |
% normal definition to reset in individual papers with, e.g.: |
| 1062 |
% |\ifx\tubdots\undefined \else \let\dots\tubdots \let\ldots\tubdots \fi| |
| 1063 |
% |
| 1064 |
% The |plain.tex| definition does not have the small space before the |
| 1065 |
% first dot, but that space makes the result look better in cases like |
| 1066 |
% |[\tubdots]| where something other than a space comes before the ellipsis. |
| 1067 |
% |
| 1068 |
% \begin{macrocode} |
| 1069 |
\def\tubdots{\ifmmode\mathellipsis\else |
| 1070 |
\kern\fontdimen3\font % space before first dot |
| 1071 |
.\kern\fontdimen3\font |
| 1072 |
.\kern\fontdimen3\font |
| 1073 |
.\kern\fontdimen3\font\fi} |
| 1074 |
% \end{macrocode} |
| 1075 |
% \end{macro} |
| 1076 |
% |
| 1077 |
% \begin{macro}{\allowhyphens} |
| 1078 |
% Hyphen control: first, we save (via \cs{edef}) the hyphenpenalties in |
| 1079 |
% \cs{allowhyphens}. This allows us to permit hyphens temporarily in |
| 1080 |
% things like \cs{netaddress}es, which typically occur when |
| 1081 |
% \cs{raggedright} is set, but which need to be allowed to break at |
| 1082 |
% their artificial discretionaries. |
| 1083 |
% |
| 1084 |
% \begin{macrocode} |
| 1085 |
\edef\allowhyphens{\noexpand\hyphenpenalty\the\hyphenpenalty\relax |
| 1086 |
\noexpand\exhyphenpenalty\the\exhyphenpenalty\relax} |
| 1087 |
\def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M} |
| 1088 |
% \end{macrocode} |
| 1089 |
% \end{macro} |
| 1090 |
% |
| 1091 |
% \subsection{Utility registers and definitions} |
| 1092 |
% |
| 1093 |
% We define a few scratch registers (and the like) for transient use; |
| 1094 |
% they're all paired: an internal one (\cs{T@st*}) and an external one |
| 1095 |
% (\cs{Test*}). |
| 1096 |
% |
| 1097 |
% \begin{description} |
| 1098 |
% \item[\emph{Comment:}] Exercise for an idle day: find whether all |
| 1099 |
% these are necessary, or whether we can use the \LaTeX{} temporaries |
| 1100 |
% for some (or all) of the \cs{T@st*} ones. |
| 1101 |
% \item[\emph{Comment:}] (bb) All these registers are used in the |
| 1102 |
% plain version, |tugboat.sty|. |
| 1103 |
% \end{description} |
| 1104 |
% |
| 1105 |
% \begin{macrocode} |
| 1106 |
\newbox\T@stBox \newbox\TestBox |
| 1107 |
\newcount\T@stCount \newcount\TestCount |
| 1108 |
\newdimen\T@stDimen \newdimen\TestDimen |
| 1109 |
\newif\ifT@stIf \newif\ifTestIf |
| 1110 |
% \end{macrocode} |
| 1111 |
% |
| 1112 |
% Control sequence existence test, stolen from \TeX book exercise 7.7 |
| 1113 |
% (note that this provides functionality that in some sense duplicates |
| 1114 |
% something within \LaTeX). |
| 1115 |
% |
| 1116 |
% \begin{macrocode} |
| 1117 |
\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax } |
| 1118 |
% \end{macrocode} |
| 1119 |
% |
| 1120 |
% \LaTeX\ conventions which are also useful here. |
| 1121 |
% |
| 1122 |
% \begin{macrocode} |
| 1123 |
%<*!latex> |
| 1124 |
\let\@@input\input |
| 1125 |
\def\iinput#1{\@@input#1 } |
| 1126 |
\def\@inputcheck{\if\@nextchar\bgroup |
| 1127 |
\expandafter\iinput\else\expandafter\@@input\fi} |
| 1128 |
\def\input{\futurelet\@nextchar\@inputcheck} |
| 1129 |
%</!latex> |
| 1130 |
% \end{macrocode} |
| 1131 |
% |
| 1132 |
% Smashes repeated from AMS-\TeX; plain \TeX{} implements only full |
| 1133 |
% |\smash|. |
| 1134 |
% |
| 1135 |
% \begin{macrocode} |
| 1136 |
\newif\iftop@ \newif\ifbot@ |
| 1137 |
\def\topsmash{\top@true\bot@false\smash@} |
| 1138 |
\def\botsmash{\top@false\bot@true\smash@} |
| 1139 |
\def\smash{\top@true\bot@true\smash@} |
| 1140 |
\def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}% |
| 1141 |
\else\let\next\makesm@sh\fi \next } |
| 1142 |
\def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@} |
| 1143 |
% \end{macrocode} |
| 1144 |
% |
| 1145 |
% Vertical `laps'; cf.\ |\llap| and |\rlap| |
| 1146 |
% |
| 1147 |
% \begin{macrocode} |
| 1148 |
\long\def\ulap#1{\vbox to \z@{\vss#1}} |
| 1149 |
\long\def\dlap#1{\vbox to \z@{#1\vss}} |
| 1150 |
% \end{macrocode} |
| 1151 |
% And centered horizontal and vertical `laps' |
| 1152 |
% \begin{macrocode} |
| 1153 |
\def\xlap#1{\hb@xt@\z@{\hss#1\hss}} |
| 1154 |
\long\def\ylap#1{\vbox to \z@{\vss#1\vss}} |
| 1155 |
\long\def\zlap#1{\ylap{\xlap{#1}}} |
| 1156 |
% \end{macrocode} |
| 1157 |
% Avoid unwanted vertical glue when making up pages. |
| 1158 |
% \begin{macrocode} |
| 1159 |
\def\basezero{\baselineskip\z@skip \lineskip\z@skip} |
| 1160 |
% \end{macrocode} |
| 1161 |
% Empty rules for special occasions |
| 1162 |
% \begin{macrocode} |
| 1163 |
\def\nullhrule{\hrule \@height\z@ \@depth\z@ \@width\z@ } |
| 1164 |
\def\nullvrule{\vrule \@height\z@ \@depth\z@ \@width\z@ } |
| 1165 |
% \end{macrocode} |
| 1166 |
% Support ad-hoc strut construction. |
| 1167 |
% \begin{macrocode} |
| 1168 |
\def\makestrut[#1;#2]{\vrule \@height#1 \@depth#2 \@width\z@ } |
| 1169 |
% \end{macrocode} |
| 1170 |
% Construct box for figure pasteup, etc.; |
| 1171 |
% height = \#1, width = \#2, rule thickness = \#3 |
| 1172 |
% \begin{macrocode} |
| 1173 |
\def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3 |
| 1174 |
\vbox to#1{\hrule \@height\T@stDimen \@depth\z@ |
| 1175 |
\vss\hb@xt@#2{\vrule \@width\T@stDimen |
| 1176 |
\hfil\makestrut[#1;\z@]% |
| 1177 |
\vrule \@width\T@stDimen}\vss |
| 1178 |
\hrule \@height\T@stDimen \@depth\z@}} |
| 1179 |
% \end{macrocode} |
| 1180 |
% Today's date, to be printed on drafts. Based on \TeX book, p.406. |
| 1181 |
% \begin{macrocode} |
| 1182 |
%<*!latex> |
| 1183 |
\def\today{\number\day\space \ifcase\month\or |
| 1184 |
Jan \or Feb \or Mar \or Apr \or May \or Jun \or |
| 1185 |
Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi |
| 1186 |
\number\year} |
| 1187 |
%</!latex> |
| 1188 |
% \end{macrocode} |
| 1189 |
% Current time; this may be system dependent! |
| 1190 |
% \begin{macrocode} |
| 1191 |
\newcount\hours |
| 1192 |
\newcount\minutes |
| 1193 |
\def\SetTime{\hours=\time |
| 1194 |
\global\divide\hours by 60 |
| 1195 |
\minutes=\hours |
| 1196 |
\multiply\minutes by 60 |
| 1197 |
\advance\minutes by-\time |
| 1198 |
\global\multiply\minutes by-1 } |
| 1199 |
\SetTime |
| 1200 |
\def\now{\ifnum\hours<10 0\fi\number\hours:% |
| 1201 |
\ifnum\minutes<10 0\fi\number\minutes} |
| 1202 |
\def\Now{\today\ \now} |
| 1203 |
\newif\ifPrelimDraft % true if ([draft] or [preprint] or pageno>900) |
| 1204 |
\def\midrtitle{} % center of running heads |
| 1205 |
\def\rtitlenexttopage{\ifPrelimDraft \textsl{\small draft: \Now}\fi} |
| 1206 |
%\def\rtitlenexttopage{\ifnum\value{page}>900 \textsl{\small draft: \Now}\fi} |
| 1207 |
% \end{macrocode} |
| 1208 |
% |
| 1209 |
% Sometimes we want to refer to the pages of another article in the same |
| 1210 |
% issue. |tugboat.dates| makes the real definition; here we define a |
| 1211 |
% placeholder so it won't be undefined when we send the source back to |
| 1212 |
% the author. |
| 1213 |
% \begin{macrocode} |
| 1214 |
\let\thisissuepageref\empty |
| 1215 |
% \end{macrocode} |
| 1216 |
% |
| 1217 |
% \subsection{Ragged right and friends} |
| 1218 |
% |
| 1219 |
% \begin{macro}{\raggedskip} |
| 1220 |
% \begin{macro}{\raggedstretch} |
| 1221 |
% \begin{macro}{\raggedparfill} |
| 1222 |
% \begin{macro}{\raggedspaces} |
| 1223 |
% Plain \TeX{}'s definition of |\raggedright| doesn't permit any |
| 1224 |
% stretch, and results in too many overfull boxes. We also turn off |
| 1225 |
% hyphenation. This code lies somewhere between that of Plain \TeX{} |
| 1226 |
% and of \LaTeX{}. |
| 1227 |
% \begin{macrocode} |
| 1228 |
\newdimen\raggedskip \raggedskip=\z@ |
| 1229 |
\newdimen\raggedstretch \raggedstretch=5em % ems of font set now (10pt) |
| 1230 |
\newskip\raggedparfill \raggedparfill=\z@\@plus 1fil |
| 1231 |
\def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax } |
| 1232 |
% \end{macrocode} |
| 1233 |
% \end{macro} |
| 1234 |
% \end{macro} |
| 1235 |
% \end{macro} |
| 1236 |
% \end{macro} |
| 1237 |
% |
| 1238 |
% \begin{macro}{\raggedright} |
| 1239 |
% \begin{macro}{\raggedleft} |
| 1240 |
% \begin{macro}{\raggedcenter} |
| 1241 |
% \begin{macro}{\normalspaces} |
| 1242 |
% Some applications may have to add stretch, in order to avoid |
| 1243 |
% all overfull boxes. We define the following uses of the above |
| 1244 |
% skips, etc. |
| 1245 |
% \begin{macrocode} |
| 1246 |
\def\raggedright{% |
| 1247 |
\nohyphens \raggedspaces |
| 1248 |
\rightskip=\raggedskip\@plus\raggedstretch |
| 1249 |
\parfillskip=\raggedparfill |
| 1250 |
} |
| 1251 |
\def\raggedleft{% |
| 1252 |
\nohyphens \raggedspaces |
| 1253 |
\leftskip=\raggedskip\@plus\raggedstretch |
| 1254 |
\parfillskip=\z@skip |
| 1255 |
\let\\ \@centercr % else tabulararray fails, |
| 1256 |
% https://github.com/lvjr/tabularray/issues/348 |
| 1257 |
} |
| 1258 |
\def\raggedcenter{% |
| 1259 |
\nohyphens \raggedspaces |
| 1260 |
\leftskip=\raggedskip\@plus\raggedstretch |
| 1261 |
\rightskip=\leftskip |
| 1262 |
\parindent=\z@ |
| 1263 |
\parfillskip=\z@skip |
| 1264 |
} |
| 1265 |
% |
| 1266 |
% Undo |\raggedspaces|. |
| 1267 |
\def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip} |
| 1268 |
% \end{macrocode} |
| 1269 |
% \end{macro} |
| 1270 |
% \end{macro} |
| 1271 |
% \end{macro} |
| 1272 |
% \end{macro} |
| 1273 |
% |
| 1274 |
% \begin{macro}{\tubjustifiedpar} |
| 1275 |
% Undo the \cs{raggedright} (or other such) settings, restoring normality. |
| 1276 |
% \begin{macrocode} |
| 1277 |
\def\tubjustifiedpar{\rightskip=0pt \parfillskip=0pt plus1fil |
| 1278 |
\allowhyphens \normalspaces} |
| 1279 |
% \end{macrocode} |
| 1280 |
% \end{macro} |
| 1281 |
% |
| 1282 |
% \subsection{Assorted user-level markup} |
| 1283 |
% |
| 1284 |
% We provide a new definition of |~| by redefining \cs{\nobreakspace} |
| 1285 |
% (\cs{DeclareRobustCommand} doesn't mind redefinition, fortunately). |
| 1286 |
% This is based on the version in AMS-\TeX---the \LaTeXe{} version |
| 1287 |
% (|ltspace.dtx|) has \cs{leavevmode} and does not do anything with the |
| 1288 |
% surrounding space(s). Our version messes up with the \cs{pfill} used in |
| 1289 |
% |doc|-generated indexes (\url{github.com/latex3/latex2e/issues/75}), |
| 1290 |
% but later (2018++) versions of |doc| should protect against our redefinition. |
| 1291 |
% |
| 1292 |
% \begin{macrocode} |
| 1293 |
\let\latexnobreakspace=\nobreakspace |
| 1294 |
\DeclareRobustCommand{\nobreakspace}{\unskip\nobreak\ \ignorespaces} |
| 1295 |
% \end{macrocode} |
| 1296 |
% |
| 1297 |
% Plain \TeX{} defines \cs{newbox} as \cs{outer}. We solemnly |
| 1298 |
% preserve the following, which removes the \cs{outer}ness; of course, |
| 1299 |
% we carefully exclude it from what we generate\dots{} (\cs{outer}ness is a |
| 1300 |
% spawn of the devil, is it not? Barbara Beeton responded to the |
| 1301 |
% previous sentence ``\cs{outer}ness has its place: it avoids register |
| 1302 |
% buildup, hence running out of memory''. In another context, David |
| 1303 |
% Carlisle remarked that an error control mechanism that causes more |
| 1304 |
% confusing errors than it prevents is rather a poor one. This is |
| 1305 |
% perhaps not the place to conduct a serious debate\dots) |
| 1306 |
% |
| 1307 |
% \begin{macrocode} |
| 1308 |
\def\boxcs#1{\box\csname#1\endcsname} |
| 1309 |
\def\setboxcs#1{\setbox\csname#1\endcsname} |
| 1310 |
\def\newboxcs#1{\expandafter\newbox\csname#1\endcsname} |
| 1311 |
\let\gobble\@gobble |
| 1312 |
\def\vellipsis{% |
| 1313 |
\leavevmode\kern0.5em |
| 1314 |
\raise\p@\vbox{\baselineskip6\p@\vskip7\p@\hbox{.}\hbox{.}\hbox{.}} |
| 1315 |
} |
| 1316 |
% \bull doesn't work with tagging; requires ActualText using, e.g., |
| 1317 |
% accsup, but the ActualText is ignored since it's just a rule. |
| 1318 |
% (Lots of our other commands also are not properly tagged.) |
| 1319 |
% https://github.com/latex3/tagging-project/pull/535 |
| 1320 |
\def\bull{\vrule \@height 1ex \@width .8ex \@depth -.2ex } |
| 1321 |
\DeclareRobustCommand{\cents}{\textcent} |
| 1322 |
\def\tubcentsold{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}} |
| 1323 |
\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em |
| 1324 |
/\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces} |
| 1325 |
\def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}} |
| 1326 |
% |
| 1327 |
\DeclareRobustCommand{\sfrac}[1]{\@ifnextchar/{\@sfrac{#1}}% |
| 1328 |
{\@sfrac{#1}/}} |
| 1329 |
\def\@sfrac#1/#2{\leavevmode\kern.1em\raise.5ex |
| 1330 |
\hbox{$\m@th\mbox{\fontsize\sf@size\z@ |
| 1331 |
\selectfont#1}$}\kern-.1em |
| 1332 |
/\kern-.15em\lower.25ex |
| 1333 |
\hbox{$\m@th\mbox{\fontsize\sf@size\z@ |
| 1334 |
\selectfont#2}$}} |
| 1335 |
% |
| 1336 |
% don't stay bold in description items, bold italic is too weird. |
| 1337 |
\DeclareRobustCommand\meta[1]{% |
| 1338 |
\ensuremath{\langle}% |
| 1339 |
\ifmmode \expandafter\mbox \fi % if in math |
| 1340 |
{\it #1\/}% no typewriter italics, please |
| 1341 |
\ensuremath{\rangle}% |
| 1342 |
} |
| 1343 |
% |
| 1344 |
% Use \tt rather than \texttt because italic typewriter is just too strange |
| 1345 |
% and upright works well enough in both italic and bold contexts. |
| 1346 |
% Would be nice to change catcode of _ for \LaTeX3, but we don't. |
| 1347 |
% |
| 1348 |
% By the way, it would be possible to substitute typewriter slanted for |
| 1349 |
% typewriter italic in general: |
| 1350 |
% \url{https://tex.stackexchange.com/questions/692277}. |
| 1351 |
% But it feels like that is too intrusive a change, even though in |
| 1352 |
% practice we always prefer tt slanted. |
| 1353 |
\DeclareRobustCommand{\cs}[1]{\texorpdfstring |
| 1354 |
{{\tt \char`\\#1}\@}% |
| 1355 |
{\textbackslash #1}% |
| 1356 |
} |
| 1357 |
% |
| 1358 |
% This command was defined much later than the others around here, so |
| 1359 |
% let's not conflict with any existing definitions that might be out there. |
| 1360 |
% Don't allow hyphenations or other line breaks. |
| 1361 |
\DeclareRobustCommand{\tubbraced}[1]{\texorpdfstring |
| 1362 |
{\mbox{\texttt{\char`\{#1\char`\}}}}% |
| 1363 |
{\textbraceleft #1\textbraceright}% |
| 1364 |
} |
| 1365 |
% |
| 1366 |
% Literal text, such as class names, package names, filenames, etc, |
| 1367 |
% Trying to define separate commands for each seems impossible and pointless. |
| 1368 |
% Usually we don't want hyphenation or any other kind of break. |
| 1369 |
\DeclareRobustCommand{\tbcode}[1]{\mbox{\texttt{#1}}} |
| 1370 |
% |
| 1371 |
% On the other hand, sometimes we need to break such code fragments. |
| 1372 |
% If |hyperref| is loaded, we want |\nolinkurl|, else just |\url|. |
| 1373 |
\AtBeginDocument{% |
| 1374 |
\ifx\nolinkurl\undefined |
| 1375 |
\DeclareRobustCommand{\tbcodebreak}{\url} |
| 1376 |
\else |
| 1377 |
\DeclareRobustCommand{\tbcodebreak}{\nolinkurl} |
| 1378 |
\fi |
| 1379 |
} |
| 1380 |
% |
| 1381 |
% Not sure why we ever want this instead of LaTeX's \, (using \kern), |
| 1382 |
% but fine, just keeping it. |
| 1383 |
\DeclareRobustCommand{\thinskip}{\hskip 0.16667em\relax} |
| 1384 |
% |
| 1385 |
% Ah, urls. Nowadays, we like the visible url to not have any protocol, |
| 1386 |
% if it is \texttt{http://} or \texttt{https://}. But we need to include |
| 1387 |
% the protocol if we are making live links, since a string like |
| 1388 |
% \texttt{tug.org/whatever} will be taken as a local filename by |
| 1389 |
% browsers and PDF readers. Since we need to check for |
| 1390 |
% \texttt{hyperref}, make the definition \cs{AtBeginDocument}. In the |
| 1391 |
% end, \cs{tbsurl}\tubbraced{foo} produces \texttt{https://foo} and |
| 1392 |
% \cs{tbhurl}\tubbraced{foo} produces \texttt{http://foo}. |
| 1393 |
\AtBeginDocument{% |
| 1394 |
\ifx\hyper@normalise\undefined |
| 1395 |
\ifx\url\undefined % define our own simplistic non-hyperref \url |
| 1396 |
\def\url{\begingroup % might as well catch common special chars |
| 1397 |
\catcode`\#=12 \catcode`\$=12 \catcode`\%=12 \catcode`\^=12 |
| 1398 |
\catcode`\&=12 \catcode`\_=12 \catcode`\~=12 |
| 1399 |
\finish@tub@url} |
| 1400 |
\def\finish@tub@url#1{\tt #1\endgroup} |
| 1401 |
\fi |
| 1402 |
\let\tburl\url % no hyperref, so just \url is fine; |
| 1403 |
\let\tbsurl\url % \let instead of \def so we can still |
| 1404 |
\let\tbhurl\url % use \def\url{\tbsurl} without infloop. |
| 1405 |
\else |
| 1406 |
% This hyperref hook-in is due to Ulrike Fischer. |
| 1407 |
% \url{https://github.com/latex3/hyperref/issues/125}. |
| 1408 |
% \tb[sh]url@ are defined next. |
| 1409 |
\DeclareRobustCommand*{\tburl}{\tbsurl}% |
| 1410 |
\DeclareRobustCommand*{\tbsurl}{\hyper@normalise\tbsurl@}% |
| 1411 |
\DeclareRobustCommand*{\tbhurl}{\hyper@normalise\tbhurl@}% |
| 1412 |
\fi |
| 1413 |
} |
| 1414 |
% |
| 1415 |
% Outside \AtBeginDocument, back at the top level of the dtx, we |
| 1416 |
% turn on expl syntax for the main definitions of \tb[sh]url. We want |
| 1417 |
% to auto-remove an explicit protocol in case it |
| 1418 |
% was given. |
| 1419 |
% |
| 1420 |
% Only the correct protocol is removed; if \verb|http://| is |
| 1421 |
% given to \cs{tbsurl}, it is used (and printed) as-is. This is useful |
| 1422 |
% so we can do \verb|\let\url\tbsurl| when printing bibliographies. |
| 1423 |
% |
| 1424 |
% Giving \verb|https://| to \cs{tbhurl}, on the other hand, generates an |
| 1425 |
% invalid link; in practice there's no use for that so we don't bother |
| 1426 |
% to check for it. |
| 1427 |
% |
| 1428 |
\ExplSyntaxOn |
| 1429 |
% Test whether #1 matches the leading characters of #2. |
| 1430 |
\cs_new:Npn \str_if_starts_with:nnTF #1#2 |
| 1431 |
{ |
| 1432 |
% #1 = prefix to test |
| 1433 |
% #2 = full string |
| 1434 |
% |
| 1435 |
% compare the first N characters (tokens) of the full string #2, |
| 1436 |
% where N is the length of the prefix #1, |
| 1437 |
% to the prefix. |
| 1438 |
\str_if_eq:eeTF |
| 1439 |
{ \str_range:nnn {#2} {1} { \str_count:n {#1} } } |
| 1440 |
{#1} |
| 1441 |
} |
| 1442 |
|
| 1443 |
% the main function to handle url #1. |
| 1444 |
\def\tbsurl@#1 % https |
| 1445 |
{ |
| 1446 |
\str_set:Nn \l_tmpa_str {#1} |
| 1447 |
% this checks if http:// is contained anywhere within the argument url, |
| 1448 |
% but that is not good enough, since http:// might occur inside the url, |
| 1449 |
% e.g., https://web.archive.org/web/20090809184749/http://www.eco-log.de/ |
| 1450 |
% \str_if_in:NnTF \l_tmpa_str {http://} |
| 1451 |
% Another fix would have been to insert a constant string "foo" before |
| 1452 |
% the argument and the prefix, but since the clean solution is at hand, |
| 1453 |
% might as well use it. |
| 1454 |
\str_if_starts_with:nnTF {http://} {#1} |
| 1455 |
{ |
| 1456 |
\tbhurl@{#1} % if http, redirect to remove protocol |
| 1457 |
% this version prints the http, as we originally thought was better. |
| 1458 |
% \expandafter\hyper@linkurl |
| 1459 |
% \expandafter{\expandafter\Hurl\expandafter{\l_tmpa_str}}{\l_tmpa_str} |
| 1460 |
} |
| 1461 |
{ |
| 1462 |
\str_remove_once:Nn \l_tmpa_str {https://} |
| 1463 |
\expandafter\hyper@linkurl |
| 1464 |
\expandafter{\expandafter\Hurl\expandafter{\l_tmpa_str}} |
| 1465 |
{https://\l_tmpa_str} |
| 1466 |
} |
| 1467 |
} |
| 1468 |
% explicit http, handle similarly but don't bother checking for https |
| 1469 |
\def\tbhurl@#1 |
| 1470 |
{ |
| 1471 |
\str_set:Nn\l_tmpa_str{#1} |
| 1472 |
\str_remove_once:Nn \l_tmpa_str {http://} |
| 1473 |
\expandafter\hyper@linkurl\expandafter{\expandafter\Hurl\expandafter |
| 1474 |
{\l_tmpa_str}}{http://\l_tmpa_str} |
| 1475 |
} |
| 1476 |
\ExplSyntaxOff |
| 1477 |
% |
| 1478 |
% Now let's use those macros for putting a url into a simple |
| 1479 |
% ragged-right footnote. |
| 1480 |
\def\tburlfootnote{\tbsurlfootnote} |
| 1481 |
\def\tbsurlfootnote#1{\unskip\footnote{\raggedright\tbsurl{#1}}} |
| 1482 |
\def\tbhurlfootnote#1{\unskip\footnote{\raggedright\tbhurl{#1}}} |
| 1483 |
% |
| 1484 |
% Close up space between footnote mark and punctuation (``pre-punctuation''). |
| 1485 |
\DeclareRobustCommand{\tbppkernfoot}{\tubthinnerspace} |
| 1486 |
|
| 1487 |
% Make \! work in text mode, for older LaTeX. |
| 1488 |
\DeclareRobustCommand{\!}{\ifmmode\mskip-\thinmuskip \else\kern-0.16667em \fi} |
| 1489 |
% |
| 1490 |
% Half a thinspace, positive and negative. Should have named these |
| 1491 |
% \cs{tb} instead of \cs{tub}, but not worth changing now. |
| 1492 |
\DeclareRobustCommand{\tubthinnerspace} |
| 1493 |
{\ifmmode\mskip.5\thinmuskip \else\kern0.08333em \fi} |
| 1494 |
\DeclareRobustCommand{\tubthinnerspaceneg} |
| 1495 |
{\ifmmode\mskip-.5\thinmuskip \else\kern-0.08333em \fi} |
| 1496 |
% |
| 1497 |
% Half a smallskip. |
| 1498 |
\DeclareRobustCommand{\tubsmallerskip} |
| 1499 |
{\vskip 1.5pt plus .75pt minus .75pt\relax} |
| 1500 |
% |
| 1501 |
% \end{macrocode} |
| 1502 |
% |
| 1503 |
% We play a merry game with dashes, providing all conceivable options |
| 1504 |
% of breakability before and after. |
| 1505 |
% |
| 1506 |
% \begin{macrocode} |
| 1507 |
\def\endash{--} |
| 1508 |
\def\emdash{\endash-} |
| 1509 |
\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces} |
| 1510 |
\def\dash{\d@sh\nobreak\endash} |
| 1511 |
\def\Dash{\d@sh\nobreak\emdash} |
| 1512 |
\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}} |
| 1513 |
\def\rdash{\d@sh\nobreak\endash} |
| 1514 |
\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}} |
| 1515 |
\def\Rdash{\d@sh\nobreak\emdash} |
| 1516 |
% \end{macrocode} |
| 1517 |
% |
| 1518 |
% Hacks to permit automatic hyphenation after an actual hyphen, or |
| 1519 |
% after a slash. |
| 1520 |
% |
| 1521 |
% \begin{macrocode} |
| 1522 |
\def\hyph{-\penalty\z@\hskip\z@skip } |
| 1523 |
\def\slash{/\penalty\z@\hskip\z@skip } |
| 1524 |
% \end{macrocode} |
| 1525 |
% |
| 1526 |
% Adapted from |comp.text.tex| posting by Donald Arseneau, 26 May 93. |
| 1527 |
% \LaTeXe-isation added by Robin Fairbairns. Destroys both the |
| 1528 |
% |TestCount|s. |
| 1529 |
% |
| 1530 |
% \begin{macrocode} |
| 1531 |
\def\nth#1{% |
| 1532 |
\def\reserved@a##1##2\@nil{\ifcat##1n% |
| 1533 |
0% |
| 1534 |
\let\reserved@b\ensuremath |
| 1535 |
\else##1##2% |
| 1536 |
\let\reserved@b\relax |
| 1537 |
\fi}% |
| 1538 |
\TestCount=\reserved@a#1\@nil\relax |
| 1539 |
\ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives |
| 1540 |
\T@stCount=\TestCount |
| 1541 |
\divide\T@stCount by 100 \multiply\T@stCount by 100 |
| 1542 |
\advance\TestCount by-\T@stCount % n mod 100 |
| 1543 |
\ifnum\TestCount >20 \T@stCount=\TestCount |
| 1544 |
\divide\T@stCount by 10 \multiply\T@stCount by 10 |
| 1545 |
\advance\TestCount by-\T@stCount % n mod 10 |
| 1546 |
\fi |
| 1547 |
\reserved@b{#1}% |
| 1548 |
\textsuperscript{\ifcase\TestCount th% 0th |
| 1549 |
\or st% 1st |
| 1550 |
\or nd% 2nd |
| 1551 |
\or rd% 3rd |
| 1552 |
\else th% nth |
| 1553 |
\fi}% |
| 1554 |
} |
| 1555 |
% \end{macrocode} |
| 1556 |
% |
| 1557 |
% \subsection{Reviews} |
| 1558 |
% |
| 1559 |
% Format information on reviewed items for book review articles. |
| 1560 |
% For the \LaTeXe{} version, we follow Fairbairns' maxim, and define |
| 1561 |
% something that can even look like a \LaTeX{} macro\dots |
| 1562 |
% |
| 1563 |
% \begin{macrocode} |
| 1564 |
\def\Review{\@ifnextchar:{\@Review}{\@Review:}} |
| 1565 |
\def\@Review:{\@ifnextchar[%] |
| 1566 |
{\@Rev}% |
| 1567 |
{\@Rev[Book review]}} |
| 1568 |
\def\@Rev[#1]#2{{\ignorespaces#1\unskip:\enspace\ignorespaces |
| 1569 |
\slshape\mdseries#2}} |
| 1570 |
\def\reviewitem{\addvspace{\BelowTitleSkip}% |
| 1571 |
\def\revauth##1{\def\therevauth{##1, }\ignorespaces}% |
| 1572 |
\def\revtitle##1{\def\therevtitle{{\slshape##1}. }\ignorespaces}% |
| 1573 |
\def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}% |
| 1574 |
} |
| 1575 |
\def\endreviewitem{{\noindent\interlinepenalty=10000 |
| 1576 |
\therevauth\therevtitle\therevpubinfo\endgraf}% |
| 1577 |
\vskip\medskipamount |
| 1578 |
} |
| 1579 |
\def\titleref#1{{\slshape\frenchspacing#1\nocorr}} |
| 1580 |
\let\booktitle=\titleref % older name |
| 1581 |
% \end{macrocode} |
| 1582 |
% |
| 1583 |
% \subsection{Dates, volume and issue numbers, etc.} |
| 1584 |
% |
| 1585 |
% Dates and other items which identify the volume and issue. |
| 1586 |
% \cs{issueseqno} is a sequential issue number starting from the |
| 1587 |
% first issue published; volume 15,4 has \cs{issueseqno=45}. |
| 1588 |
% |
| 1589 |
% To use: \begin{tabular}{l} |
| 1590 |
% |\vol 19, 1.|\\ |
| 1591 |
% |\issdate March 1998.|\\ |
| 1592 |
% |\issueseqno=58|\\ |
| 1593 |
% \end{tabular} |
| 1594 |
% |
| 1595 |
% Starting with volume 23 (nominal 2002), we have \cs{issyear} instead |
| 1596 |
% of \cs{issdate}, because issues don't have months any more. |
| 1597 |
% |
| 1598 |
% For production, these are set in a separate file, |
| 1599 |
% |tugboat.dates|, which is issue-specific. |
| 1600 |
% |
| 1601 |
% \begin{macrocode} |
| 1602 |
\newcount\issueseqno \issueseqno=-1 |
| 1603 |
\def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}} |
| 1604 |
\def\volyr{} |
| 1605 |
\def\volno{} |
| 1606 |
\def\vol#1, #2.{% |
| 1607 |
\gdef\volno{#1}% |
| 1608 |
\gdef\issno{#2}% |
| 1609 |
\setbox\TestBox=\hbox{\volyr}% |
| 1610 |
\ifdim \wd\TestBox > .2em \v@lx \fi } |
| 1611 |
\def\issyear#1.{% |
| 1612 |
\gdef\issdt{#1}\gdef\volyr{#1}% |
| 1613 |
\gdef\bigissdt{#1}% |
| 1614 |
\setbox\TestBox=\hbox{\volno}% |
| 1615 |
\ifdim \wd\TestBox > .2em \v@lx \fi } |
| 1616 |
\def\issdate#1#2 #3.{% |
| 1617 |
\gdef\issdt{#1#2 #3}\gdef\volyr{#3}% |
| 1618 |
\gdef\bigissdt{#1{\smc\uppercase{#2}} #3}% |
| 1619 |
\setbox\TestBox=\hbox{\volno}% |
| 1620 |
\ifdim \wd\TestBox > .2em \v@lx \fi } |
| 1621 |
% The \vol command must be invoked precisely like this, including spaces. |
| 1622 |
% Since we are the only ones who write it, we can be strict. |
| 1623 |
\vol 0, 0. |
| 1624 |
\issdate Thermidor, 9999. |
| 1625 |
% \end{macrocode} |
| 1626 |
% |
| 1627 |
% (The curious may like to know that \emph{Thermidor} was one of the French |
| 1628 |
% revolutionary month names.) |
| 1629 |
% |
| 1630 |
% For \LaTeX{} use, define a version of the issue declaration that can |
| 1631 |
% take or leave the old plain syntax |
| 1632 |
% |
| 1633 |
% \begin{macrocode} |
| 1634 |
%<!latex>\def\tubissue#1(#2)% |
| 1635 |
%<*latex> |
| 1636 |
\def\tubissue#1{\@ifnextchar(%) |
| 1637 |
{\@tubissue@b{#1}} |
| 1638 |
{\@tubissue@a{#1}}} |
| 1639 |
\def\@tubissue@b#1(#2){\@tubissue@a{#1}{#2}} |
| 1640 |
\def\@tubissue@a#1#2% |
| 1641 |
%</latex> |
| 1642 |
{\TUB~#1, no.~#2} |
| 1643 |
% \end{macrocode} |
| 1644 |
% |
| 1645 |
% \TUB{} conventions include the sequential issue number in the file name. |
| 1646 |
% Permit this to be incorporated into file names automatically. |
| 1647 |
% If \(\mbox{issue number} = 11\), \cs{Input filnam} will read |
| 1648 |
% |tb11filnam.tex| |
| 1649 |
% |
| 1650 |
% \begin{macrocode} |
| 1651 |
\def\infil@{\jobname} |
| 1652 |
\def\Input #1 {\ifnum\issueseqno<0 |
| 1653 |
\def\infil@{#1}% |
| 1654 |
\else |
| 1655 |
\def\infil@{tb\number\issueseqno#1} |
| 1656 |
\fi |
| 1657 |
\edef\jobname{\infil@}\@readFLN |
| 1658 |
\@@input \infil@\relax |
| 1659 |
\if@RMKopen |
| 1660 |
\immediate\closeout\@TBremarkfile\@RMKopenfalse |
| 1661 |
\fi |
| 1662 |
} |
| 1663 |
% \end{macrocode} |
| 1664 |
% |
| 1665 |
% \cs{TBremark}s are things that need to be drawn to the attention of |
| 1666 |
% the editors; the conscientious author will include such things in |
| 1667 |
% the article file. By default, remarks are suppressed, but their |
| 1668 |
% appearance may be enabled by the \cs{TBEnableRemarks} command, which |
| 1669 |
% can be included in the configuration file |ltugboat.cfg| (or |
| 1670 |
% |ltugproc.cfg|, if that's what we're at). |
| 1671 |
% |
| 1672 |
% \begin{macrocode} |
| 1673 |
\newif\if@RMKopen \@RMKopenfalse |
| 1674 |
\newwrite\@TBremarkfile |
| 1675 |
\def\@TBremark#1{% |
| 1676 |
\if@RMKopen |
| 1677 |
\else |
| 1678 |
\@RMKopentrue\immediate\openout\@TBremarkfile=\[email protected] |
| 1679 |
\fi |
| 1680 |
\toks@={#1}% |
| 1681 |
\immediate\write\@TBremarkfile{^^J\the\toks@}% |
| 1682 |
\immediate\write16{^^JTBremark:: \the\toks@^^J}% |
| 1683 |
} |
| 1684 |
% \end{macrocode} |
| 1685 |
% |
| 1686 |
% We initialise \cs{TBremark} to ignore its argument (this used to |
| 1687 |
% involve a \cs{TBremarkOFF} which was cunningly defined exactly the |
| 1688 |
% same as \cs{gobble}) |
| 1689 |
% |
| 1690 |
% \begin{macrocode} |
| 1691 |
\let\TBremark=\gobble |
| 1692 |
% \end{macrocode} |
| 1693 |
% |
| 1694 |
% \cs{TBEnableRemarks} simply involves setting \cs{TBremark} to use |
| 1695 |
% the functional \cs{@TBremark} defined above. |
| 1696 |
% |
| 1697 |
% \begin{macrocode} |
| 1698 |
\def\TBEnableRemarks{\let\TBremark\@TBremark} |
| 1699 |
% \end{macrocode} |
| 1700 |
% |
| 1701 |
% For marking locations in articles that pertain to remarks |
| 1702 |
% in another file of editorial comments |
| 1703 |
% |
| 1704 |
% \begin{macrocode} |
| 1705 |
\def\TUBedit#1{} |
| 1706 |
% \end{macrocode} |
| 1707 |
% |
| 1708 |
% For using different filenames in the production process than those |
| 1709 |
% supplied by authors |
| 1710 |
% |
| 1711 |
% \begin{macrocode} |
| 1712 |
\def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}} |
| 1713 |
\newread\@altfilenames |
| 1714 |
\def\@readFLN{\immediate\openin\@altfilenames=\jobname.fln |
| 1715 |
\ifeof\@altfilenames\let\@result\relax\else |
| 1716 |
\def\@result{\@@input\jobname.fln }\fi |
| 1717 |
\immediate\closein\@altfilenames |
| 1718 |
\@result} |
| 1719 |
\@readFLN |
| 1720 |
\everyjob=\expandafter{\the\everyjob\@readFLN} |
| 1721 |
\InputIfFileExists{\jobname.fln}% |
| 1722 |
{\TBInfo{Reading alternative file \jobname.fln}} |
| 1723 |
{} |
| 1724 |
% \end{macrocode} |
| 1725 |
% |
| 1726 |
% The following needs to work entirely in \TeX's mouth |
| 1727 |
% \begin{macrocode} |
| 1728 |
\def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax |
| 1729 |
#1\else\csname file@@#1\endcsname\fi} |
| 1730 |
\def\fileinput#1{\@@input\@tubfilename{#1} } |
| 1731 |
% \end{macrocode} |
| 1732 |
% |
| 1733 |
% Write out (both to a file and to the log) the starting page number |
| 1734 |
% of an article, to be used for cross references and in contents. |
| 1735 |
% |\pagexref| is used for articles fully processed in the \TUB{} |
| 1736 |
% run. |\PageXref| is used for `extra' pages, where an item is |
| 1737 |
% submitted as camera copy, and only running heads (at most) are run. |
| 1738 |
% |
| 1739 |
% \begin{macrocode} |
| 1740 |
%<*!latex> |
| 1741 |
\def\pagexrefON#1{% |
| 1742 |
\write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}% |
| 1743 |
\write\ppoutfile{% |
| 1744 |
\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}% |
| 1745 |
} |
| 1746 |
\def\PageXrefON#1{% |
| 1747 |
\immediate\write-1{\def\expandafter |
| 1748 |
\noexpand\csname#1\endcsname{\number\pageno}}% |
| 1749 |
\immediate\write\ppoutfile{\def\expandafter |
| 1750 |
\noexpand\csname#1\endcsname{\number\pageno}}} |
| 1751 |
%</!latex> |
| 1752 |
%<*latex> |
| 1753 |
\def\pagexrefON#1{% |
| 1754 |
\write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}% |
| 1755 |
\write\ppoutfile{% |
| 1756 |
\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}% |
| 1757 |
} |
| 1758 |
\def\PageXrefON#1{% |
| 1759 |
\immediate\write-1{\def\expandafter |
| 1760 |
\noexpand\csname#1\endcsname{\number\c@page}}% |
| 1761 |
\immediate\write\ppoutfile{\def\expandafter |
| 1762 |
\noexpand\csname#1\endcsname{\number\c@page}}} |
| 1763 |
%</latex> |
| 1764 |
\def\pagexrefOFF#1{} |
| 1765 |
\let\pagexref=\pagexrefOFF |
| 1766 |
\def\PageXrefOFF#1{} |
| 1767 |
\let\PageXref=\PageXrefOFF |
| 1768 |
\def\xreftoON#1{% |
| 1769 |
\ifundefined{#1}% |
| 1770 |
???\TBremark{Need cross reference for #1.}% |
| 1771 |
\else\csname#1\endcsname\fi} |
| 1772 |
\def\xreftoOFF#1{???} |
| 1773 |
\let\xrefto=\xreftoOFF |
| 1774 |
% \end{macrocode} |
| 1775 |
% |
| 1776 |
% \cs{TBdriver} `marks code for use when articles are run together in |
| 1777 |
% a driver file'. Since we don't yet have a definition of that |
| 1778 |
% arrangement, we don't have a definition of \cs{TBdriver}. Its |
| 1779 |
% argument (which one presumes was intended as the code for this |
| 1780 |
% unusual state) is just gobbled. |
| 1781 |
% |
| 1782 |
% \begin{macrocode} |
| 1783 |
\let\TBdriver\gobble |
| 1784 |
% \end{macrocode} |
| 1785 |
% |
| 1786 |
% Hyphenation exceptions. We read our own full |ushyphex.tex| (generated |
| 1787 |
% from |tb0hyf.tex|) if it's available. The additional exceptions are |
| 1788 |
% nearly all included in the file, but keep defining them anyway, since |
| 1789 |
% we have for many years. |
| 1790 |
% |
| 1791 |
% But do not define any exceptions if |\tubomithyphenations| is defined. |
| 1792 |
% This is needed for the |hyf| articles themselves. |
| 1793 |
% |
| 1794 |
% \begin{macrocode} |
| 1795 |
\ifx\tubomithyphenations\@thisisundefined |
| 1796 |
\InputIfFileExists{ushyphex.tex}{}{} % ok if it's missing |
| 1797 |
\hyphenation{Del-a-ware Dijk-stra Duane Eijk-hout |
| 1798 |
Flor-i-da Free-BSD Ghost-script |
| 1799 |
Hara-lam-bous Jac-kow-ski Ja-pa-nese Karls-ruhe Lua-Meta |
| 1800 |
Mac-OS Math-Sci-Net |
| 1801 |
Net-BSD Open-BSD Open-Office |
| 1802 |
Pak-i-stan Post-Script Rich-ard Skoup South-all |
| 1803 |
Vieth VM-ware Win-Edt |
| 1804 |
acro-nym acro-nyms analy-sis ap-pen-di-ces ap-pen-dix asyn-chro-nous |
| 1805 |
bib-lio-graph-i-cal bit-map bit-mapped bit-maps buf-fer buf-fers bool-ean |
| 1806 |
col-umns com-put-able com-put-abil-ity |
| 1807 |
data-base data-bases |
| 1808 |
de-allo-cate de-allo-cates de-allo-cated de-allo-ca-tion |
| 1809 |
de-riv-a-tive de-riv-a-tives de-riv-a-ble der-i-va-tion dis-trib-ut-able |
| 1810 |
es-sence |
| 1811 |
fall-ing |
| 1812 |
half-way |
| 1813 |
in-fra-struc-ture |
| 1814 |
key-note |
| 1815 |
long-est |
| 1816 |
ma-gyar man-u-script man-u-scripts meta-table meta-tables |
| 1817 |
mne-mon-ic mne-mon-ics mono-space mono-spaced |
| 1818 |
name-space name-spaces |
| 1819 |
off-line over-view |
| 1820 |
pal-ettes par-a-digm par-a-dig-matic par-a-digms |
| 1821 |
pipe-line pipe-lines |
| 1822 |
plug-in plug-ins pres-ent-ly pro-gram-mable |
| 1823 |
re-allo-cate re-allo-cates re-allo-cated re-printed |
| 1824 |
set-ups se-vere-ly spell-ing spell-ings stand-alone strong-est |
| 1825 |
sub-ex-pres-sion sub-tables sur-gery syn-chro-ni-city syn-chro-nous |
| 1826 |
text-height text-length text-width |
| 1827 |
time-stamp time-stamped time-stamps |
| 1828 |
vis-ual vis-ual-ly |
| 1829 |
which-ever white-space white-spaces wide-spread wrap-around |
| 1830 |
} |
| 1831 |
\fi |
| 1832 |
%<!latex>\restorecat\@ |
| 1833 |
%</common> |
| 1834 |
%<*classtail> |
| 1835 |
\PrelimDrafttrue |
| 1836 |
% \end{macrocode} |
| 1837 |
% \subsection{Page dimensions, glue, penalties, etc.} |
| 1838 |
% \begin{macrocode} |
| 1839 |
\textheight 54pc % 648pt = 645.58bp = 8.97in |
| 1840 |
\textwidth 39pc % 468pt = 466.25bp = 6.48in |
| 1841 |
\columnsep 1.5pc % 18pt = 17.93bp = .249in |
| 1842 |
\columnwidth 18.75pc % 225pt = 224.16bp = 3.11in |
| 1843 |
\hfuzz 1pt |
| 1844 |
\parindent \normalparindent % 20pt |
| 1845 |
\parskip \z@ % \@plus\p@ |
| 1846 |
\leftmargini 2em |
| 1847 |
\leftmarginv .5em |
| 1848 |
\leftmarginvi .5em |
| 1849 |
\oddsidemargin \z@ |
| 1850 |
\evensidemargin \z@ |
| 1851 |
\topmargin -2.5pc % 30pt = 29.89bp = .415in |
| 1852 |
\headheight 12\p@ |
| 1853 |
\headsep 20\p@ |
| 1854 |
\marginparwidth 48\p@ |
| 1855 |
\marginparsep 10\p@ |
| 1856 |
\partopsep=\z@ |
| 1857 |
\topsep=3\p@\@plus\p@\@minus\p@ |
| 1858 |
\parsep=3\p@\@plus\p@\@minus\p@ |
| 1859 |
\itemsep=\parsep |
| 1860 |
% |
| 1861 |
% The width of one column plus gutter (=243pt =242.09bp) is useful sometimes. |
| 1862 |
\newdimen\tubcolwidthandgutter |
| 1863 |
\tubcolwidthandgutter=\columnwidth |
| 1864 |
\advance\tubcolwidthandgutter by \columnsep |
| 1865 |
% |
| 1866 |
% Ordinarily we typeset in two columns, but the onecolumn option |
| 1867 |
% goes to one. In which case we want to center the text block on an |
| 1868 |
% 8.5in width, given the default 72.27pt offset with margins of zero. |
| 1869 |
% We are always in LaTeX's twoside mode because of how we load article, |
| 1870 |
% and this is a good thing, since we want different headings. |
| 1871 |
\if@tubtwocolumn \twocolumn \else |
| 1872 |
\onecolumn |
| 1873 |
\textwidth=34pc |
| 1874 |
\oddsidemargin=30.8775pt |
| 1875 |
\evensidemargin=\oddsidemargin |
| 1876 |
\fi |
| 1877 |
% |
| 1878 |
\newdimen\pagewd \pagewd=\textwidth |
| 1879 |
\newdimen\trimwd \trimwd=\pagewd |
| 1880 |
\newdimen\trimlgt \trimlgt=11in |
| 1881 |
\newdimen\headmargin \headmargin=3.5pc |
| 1882 |
% \end{macrocode} |
| 1883 |
% |
| 1884 |
% Don't go to a float page so soon. Not all of these are relevant to all |
| 1885 |
% articles, but we may as well set them all. |
| 1886 |
% \begin{macrocode} |
| 1887 |
\renewcommand{\topfraction}{.9} % don't go to a float page so soon |
| 1888 |
\renewcommand{\dbltopfraction}{.9} |
| 1889 |
\renewcommand{\bottomfraction}{.7} |
| 1890 |
\renewcommand{\textfraction}{.1} |
| 1891 |
\renewcommand{\floatpagefraction}{.8} |
| 1892 |
\renewcommand{\dblfloatpagefraction}{.8} % the most common one used |
| 1893 |
% \end{macrocode} |
| 1894 |
% |
| 1895 |
% \subsection{Messing about with the \LaTeX{} logo} |
| 1896 |
% \label{sec:latex-logo} |
| 1897 |
% |
| 1898 |
% Barbara Beeton's pleas for \LaTeX{} logos that look right in any |
| 1899 |
% font shape provoked me to generate the following stuff that is |
| 1900 |
% configurable. |
| 1901 |
% |
| 1902 |
% Here's the command for the user to define a new version. The |
| 1903 |
% arguments are font family, series and shape, and then the two kern |
| 1904 |
% values used in placing the raised `A' of \LaTeX. |
| 1905 |
% |
| 1906 |
% \begin{macrocode} |
| 1907 |
\newcommand{\DeclareLaTeXLogo}[5]{\expandafter\def |
| 1908 |
\csname @LaTeX@#1/#2/#3\endcsname{{#4}{#5}}} |
| 1909 |
% \end{macrocode} |
| 1910 |
% |
| 1911 |
% The default values are as used in the source of \LaTeX{} itself: |
| 1912 |
% |
| 1913 |
% \begin{macrocode} |
| 1914 |
\def\@LaTeX@default{{.36}{.15}} |
| 1915 |
% \end{macrocode} |
| 1916 |
% |
| 1917 |
% More are defined in the initial version, for bold CM sans (which is |
| 1918 |
% used as \cs{SecTitleFont}), and CM italic medium and bold, and |
| 1919 |
% Bitstream Charter (which Nelson Beebe likes to use). Duplicate for |
| 1920 |
% Latin Modern. |
| 1921 |
% |
| 1922 |
% \begin{macrocode} |
| 1923 |
\DeclareLaTeXLogo{cmss}{bx}{n}{.3}{.15} |
| 1924 |
\DeclareLaTeXLogo{lmss}{bx}{n}{.3}{.15} |
| 1925 |
% |
| 1926 |
\DeclareLaTeXLogo{cmr}{m}{it}{.29}{.2} |
| 1927 |
\DeclareLaTeXLogo{lmr}{m}{it}{.29}{.2} |
| 1928 |
% |
| 1929 |
\DeclareLaTeXLogo{cmr}{m}{sl}{.29}{.15} |
| 1930 |
\DeclareLaTeXLogo{lmr}{m}{sl}{.29}{.15} |
| 1931 |
% |
| 1932 |
\DeclareLaTeXLogo{cmr}{bx}{it}{.29}{.2} |
| 1933 |
\DeclareLaTeXLogo{lmr}{bx}{it}{.29}{.2} |
| 1934 |
% |
| 1935 |
\DeclareLaTeXLogo{cmr}{bx}{sl}{.29}{.2} |
| 1936 |
\DeclareLaTeXLogo{lmr}{bx}{sl}{.29}{.2} |
| 1937 |
% |
| 1938 |
\DeclareLaTeXLogo{bch}{m}{n}{.2}{.08} |
| 1939 |
\DeclareLaTeXLogo{bch}{m}{it}{.2}{.08} |
| 1940 |
% \end{macrocode} |
| 1941 |
% |
| 1942 |
% Redefine \cs{LaTeX} to choose the parameters for the current font, |
| 1943 |
% or to use the default value otherwise: |
| 1944 |
% |
| 1945 |
% \begin{macrocode} |
| 1946 |
\DeclareRobustCommand{\LaTeX}{\expandafter\let\expandafter\reserved@a |
| 1947 |
\csname @LaTeX@\f@family/\f@series/\f@shape\endcsname |
| 1948 |
\ifx\reserved@a\relax\let\reserved@a\@LaTeX@default\fi |
| 1949 |
\expandafter\@LaTeX\reserved@a} |
| 1950 |
% \end{macrocode} |
| 1951 |
% |
| 1952 |
% Here's the body of what was originally \cs{LaTeX}, pulled out with its |
| 1953 |
% roots dripping onto the smoking ruin of original \LaTeX, and then |
| 1954 |
% bits stuck in on the side. |
| 1955 |
% |
| 1956 |
% \cs{@LaTeX@default} provides parameters as one finds in the |
| 1957 |
% original; other versions are added as needed. |
| 1958 |
% |
| 1959 |
% \begin{macrocode} |
| 1960 |
\newcommand{\@LaTeX}[2]{% |
| 1961 |
%\wlog{latex logo family=\f@family/\f@series/\f@shape -> #1, #2.}% |
| 1962 |
L\kern-#1em |
| 1963 |
{\sbox\z@ T% |
| 1964 |
\vbox to\ht0{\hbox{$\m@th$% |
| 1965 |
\csname S@\f@size\endcsname |
| 1966 |
\fontsize\sf@size\z@ |
| 1967 |
\math@fontsfalse\selectfont |
| 1968 |
A}% |
| 1969 |
\vss}% |
| 1970 |
}% |
| 1971 |
\kern-#2em% |
| 1972 |
\TeX} |
| 1973 |
% \end{macrocode} |
| 1974 |
% |
| 1975 |
% \subsection{Authors, contributors, addresses, signatures} |
| 1976 |
% |
| 1977 |
% An article may have several authors (of course), so we permit an |
| 1978 |
% \cs{author} command for each of them. The names are then stored in |
| 1979 |
% a set of \cs{csname}s called \cs{author1}, \cs{author2}, \dots |
| 1980 |
% Similarly, there are several \cs{address<n>} and \cs{netaddress<n>} |
| 1981 |
% and \cs{PersonalURL<n>} and \cs{ORCID<n>} commands set up for each article. |
| 1982 |
% |
| 1983 |
% \begin{description} |
| 1984 |
% \item[\emph{Comment:}] [RF] I would like to make provision for several |
| 1985 |
% authors at the same address, but (short of preempting the |*| |
| 1986 |
% marker, which it would be nice to retain so as to preserve |
| 1987 |
% compatibility with the |plain| style) I'm not sure how one would |
| 1988 |
% signal it. [KB] Current kludges for multiple author affiliations |
| 1989 |
% in tb143rishi-xml-first, tb140rishi-elsarticle, tb128ruckert-hint, etc. |
| 1990 |
% \end{description} |
| 1991 |
% \begin{macrocode} |
| 1992 |
\def\theauthor#1{\csname theauthor#1\endcsname} |
| 1993 |
\def\theaddress#1{\csname theaddress#1\endcsname} |
| 1994 |
\def\thenetaddress#1{\csname thenetaddress#1\endcsname} |
| 1995 |
\def\thePersonalURL#1{\csname thePersonalURL#1\endcsname} |
| 1996 |
\def\theORCID#1{\csname theORCID#1\endcsname} |
| 1997 |
% \end{macrocode} |
| 1998 |
% |
| 1999 |
% The standard way of listing authors is to iterate from 1 to |
| 2000 |
% \cs{count@} and to pick the author names as we go. |
| 2001 |
% |
| 2002 |
% \begin{macrocode} |
| 2003 |
%<!latex>\newcount\@tempcnta |
| 2004 |
\def\@defaultauthorlist{% |
| 2005 |
\@getauthorlist\@firstofone |
| 2006 |
} |
| 2007 |
% \end{macrocode} |
| 2008 |
% |
| 2009 |
% \cs{@getauthorlist} processes the author list, passing every bit of |
| 2010 |
% stuff that needs to be typeset to the macro specified as its argument. |
| 2011 |
% \begin{macrocode} |
| 2012 |
\def\@getauthorlist#1{% |
| 2013 |
\count@\authornumber |
| 2014 |
\advance\count@ by -2 |
| 2015 |
\@tempcnta0 |
| 2016 |
% \end{macrocode} |
| 2017 |
% |
| 2018 |
% Loop to output the first \ensuremath{n-2} of the \ensuremath{n} |
| 2019 |
% authors (the loop does nothing if there are two or fewer authors) |
| 2020 |
% |
| 2021 |
% \begin{macrocode} |
| 2022 |
\loop |
| 2023 |
\ifnum\count@>0 |
| 2024 |
\advance\@tempcnta by \@ne |
| 2025 |
#1{\ignorespaces\theauthor{\number\@tempcnta}\unskip, }% |
| 2026 |
\advance\count@ by \m@ne |
| 2027 |
\repeat |
| 2028 |
\count@\authornumber |
| 2029 |
\advance\count@ by -\@tempcnta |
| 2030 |
\ifnum\authornumber>0 |
| 2031 |
% \end{macrocode} |
| 2032 |
% |
| 2033 |
% If there are two or more authors, we output the penultimate author's |
| 2034 |
% name here, followed by `and' |
| 2035 |
% |
| 2036 |
% \begin{macrocode} |
| 2037 |
\ifnum\count@>1 |
| 2038 |
\count@\authornumber |
| 2039 |
\advance\count@ by \m@ne |
| 2040 |
#1{\ignorespaces\theauthor{\number\count@}\unskip\@tubauthorlastsep}% |
| 2041 |
\fi |
| 2042 |
% \end{macrocode} |
| 2043 |
% |
| 2044 |
% Finally (if there were any authors at all) output the last author's |
| 2045 |
% name: |
| 2046 |
% |
| 2047 |
% \begin{macrocode} |
| 2048 |
#1{\ignorespaces\theauthor{\number\authornumber}\unskip} |
| 2049 |
\fi |
| 2050 |
} |
| 2051 |
% |
| 2052 |
\def\@tubauthorlastsep{, }% until 2018, was: "\ and " |
| 2053 |
% \end{macrocode} |
| 2054 |
% |
| 2055 |
% Signature blocks. The author can (in principle) define a different |
| 2056 |
% sort of signature block using \cs{signature}, though this could well |
| 2057 |
% cause the editorial group to have collective kittens (unless it had |
| 2058 |
% been discussed in advance\dots) |
| 2059 |
% |
| 2060 |
% \begin{macrocode} |
| 2061 |
\def\signature#1{\def\@signature{#1}} |
| 2062 |
\def\@signature{\@defaultsignature} |
| 2063 |
% \end{macrocode} |
| 2064 |
% |
| 2065 |
% \cs{@defaultsignature} loops through all the authors, outputting the |
| 2066 |
% details we have about that author, or (if we're in a sub-article) |
| 2067 |
% outputs the contributor's name and closes the group opened by |
| 2068 |
% \cs{contributor}. It is (as its name implies) the default body for |
| 2069 |
% \cs{makesignature} |
| 2070 |
% |
| 2071 |
% \begin{macrocode} |
| 2072 |
\def\@defaultsignature{{% |
| 2073 |
\let\thanks\@gobble |
| 2074 |
\frenchspacing |
| 2075 |
% |
| 2076 |
\ifnum\authornumber<0 |
| 2077 |
% \end{macrocode} |
| 2078 |
% if \cs{authornumber}$<0$, we are in a contributor's section |
| 2079 |
% \begin{macrocode} |
| 2080 |
\medskip |
| 2081 |
\signaturemark |
| 2082 |
\theauthor{\number\authornumber}\\ |
| 2083 |
\theaddress{\number\authornumber}\\ |
| 2084 |
\allowhyphens |
| 2085 |
\thenetaddress{\number\authornumber}\\ |
| 2086 |
\thePersonalURL{\number\authornumber}\\ |
| 2087 |
\theORCID{\number\authornumber}\\ |
| 2088 |
% \end{macrocode} |
| 2089 |
% |
| 2090 |
% \cs{authornumber}$\ge0$, so we are in the body of an ordinary article: |
| 2091 |
% |
| 2092 |
% \begin{macrocode} |
| 2093 |
\else |
| 2094 |
\count@=0 |
| 2095 |
\loop |
| 2096 |
\ifnum\count@<\authornumber |
| 2097 |
\medskip |
| 2098 |
\advance\count@ by \@ne |
| 2099 |
\signaturemark |
| 2100 |
\theauthor{\number\count@}\\ |
| 2101 |
\theaddress{\number\count@}\\ |
| 2102 |
{% |
| 2103 |
\allowhyphens |
| 2104 |
\thenetaddress{\number\count@}\\ |
| 2105 |
\thePersonalURL{\number\count@}\\ |
| 2106 |
\theORCID{\number\count@}\\ |
| 2107 |
}% |
| 2108 |
\repeat |
| 2109 |
\fi |
| 2110 |
}% |
| 2111 |
} |
| 2112 |
\newdimen\signaturewidth \signaturewidth=12pc |
| 2113 |
% \end{macrocode} |
| 2114 |
% The optional argument to \cs{makesignature} is useful in some |
| 2115 |
% circumstances (e.g., multi-contributor articles) |
| 2116 |
% \begin{macrocode} |
| 2117 |
\newcommand{\makesignature}[1][\medskipamount]{% |
| 2118 |
% \end{macrocode} |
| 2119 |
% |
| 2120 |
% check the value the user has put in \cs{signaturewidth}: it may be |
| 2121 |
% at most \verb|1.5pc| short of \cs{columnwidth} |
| 2122 |
% \begin{macrocode} |
| 2123 |
\@tempdima\signaturewidth |
| 2124 |
\advance\@tempdima 1.5pc |
| 2125 |
\ifdim \@tempdima>\columnwidth |
| 2126 |
\signaturewidth \columnwidth |
| 2127 |
\advance\signaturewidth -1.5pc |
| 2128 |
\fi |
| 2129 |
\par |
| 2130 |
\penalty9000 |
| 2131 |
\vspace{#1}% |
| 2132 |
\rightline{% |
| 2133 |
\vbox{\hsize\signaturewidth \ninepoint \raggedright |
| 2134 |
\parindent \z@ \everypar={\hangindent 1pc }% |
| 2135 |
\parskip \z@skip |
| 2136 |
\def\|{\unskip\hfil\break}% |
| 2137 |
\def\\{\endgraf}% |
| 2138 |
\def\phone{\rm Phone: }% |
| 2139 |
\def\tubmultipleaffilauthor{\unskip,\\\hspace*{1em}}% |
| 2140 |
\rm\@signature}% |
| 2141 |
}% |
| 2142 |
\ifnum\authornumber<0 \endgroup\fi |
| 2143 |
} |
| 2144 |
\def\signaturemark{\leavevmode\llap{$\diamond$\enspace}} |
| 2145 |
% \end{macrocode} |
| 2146 |
% |
| 2147 |
% The idea here is that if multiple authors share affiliation |
| 2148 |
% information, we need only typeset the affiliation once. We separate by |
| 2149 |
% commas for the \cs{maketitle}, and put on separate lines, also with commas, |
| 2150 |
% in the \cs{makesignature}. |
| 2151 |
% |
| 2152 |
% Similarly, within \cs{netaddress}, |!tubmultipleaffilnet| separates |
| 2153 |
% with a space before and after the |
| 2154 |
% comma. (All this per bb.) See |tb122childs-trotter.ltx|, |
| 2155 |
% |tb131sojka-czech.ltx| for examples. |
| 2156 |
% |
| 2157 |
% \begin{macrocode} |
| 2158 |
\def\tubmultipleaffilauthor{\unskip,\ \ignorespaces}% |
| 2159 |
\def\tubmultipleaffilnet{\unskip\textrm{\,,\ \ignorespaces}} |
| 2160 |
% \end{macrocode} |
| 2161 |
% |
| 2162 |
% Now all the awful machinery of author definitions. |
| 2163 |
% \cs{authornumber} records the number of authors we have recorded to |
| 2164 |
% date. |
| 2165 |
% |
| 2166 |
% \begin{macrocode} |
| 2167 |
\newcount\authornumber |
| 2168 |
\authornumber=0 |
| 2169 |
% \end{macrocode} |
| 2170 |
% |
| 2171 |
% \cs{author} `allocates' another author name (by bumping |
| 2172 |
% \cs{authornumber}) and also sets up the address and netaddress for |
| 2173 |
% this author to produce a warning and to prevent oddities if they're |
| 2174 |
% invoked. This last assumes that invocation will be in the context |
| 2175 |
% of \cs{signature} (|ltugboat.cls|) or \cs{maketitle} |
| 2176 |
% (|ltugproc.cls|); in both cases, invocation is followed by a line |
| 2177 |
% break (tabular line break |\\| in |ltugproc|, \cs{endgraf} in |
| 2178 |
% \cs{makesignature} in |ltugboat|). |
| 2179 |
% |
| 2180 |
% \begin{macrocode} |
| 2181 |
\def\author{% |
| 2182 |
\global\advance\authornumber\@ne |
| 2183 |
\TB@author |
| 2184 |
} |
| 2185 |
% \end{macrocode} |
| 2186 |
% \cs{contributor} is for a small part of a multiple-part article; it |
| 2187 |
% begins a group that will be ended in \cs{makesignature}. |
| 2188 |
% \begin{macrocode} |
| 2189 |
\def\contributor{% |
| 2190 |
\begingroup |
| 2191 |
\authornumber\m@ne |
| 2192 |
\TB@author |
| 2193 |
} |
| 2194 |
% \end{macrocode} |
| 2195 |
% |
| 2196 |
% Both `types' of author fall through here to set up the author name |
| 2197 |
% and to initialise author-related things. \cs{EDITORno*} commands |
| 2198 |
% allow the editor to record that there's good reason for an |
| 2199 |
% \emph{address} or \emph{netaddress} not to be there, but nowadays, we |
| 2200 |
% consider all address information optional. |
| 2201 |
% \begin{macrocode} |
| 2202 |
\def\TB@author#1{% |
| 2203 |
\expandafter\def\csname theauthor\number\authornumber\endcsname |
| 2204 |
{\ignorespaces#1\unskip}% |
| 2205 |
% \expandafter\def\csname theaddress\number\authornumber\endcsname |
| 2206 |
% {\TBWarningNL{Address for #1\space missing}\@gobble}% |
| 2207 |
% \expandafter\def\csname thenetaddress\number\authornumber\endcsname |
| 2208 |
% {\TBWarningNL{Net address for #1\space missing}\@gobble}% |
| 2209 |
\expandafter\let\csname thePersonalURL\number\authornumber\endcsname |
| 2210 |
\@gobble |
| 2211 |
\expandafter\let\csname theORCID\number\authornumber\endcsname |
| 2212 |
\@gobble |
| 2213 |
} |
| 2214 |
\def\EDITORnoaddress{% |
| 2215 |
\expandafter\let\csname theaddress\number\authornumber\endcsname |
| 2216 |
\@gobble |
| 2217 |
} |
| 2218 |
\def\EDITORnonetaddress{% |
| 2219 |
\expandafter\let\csname thenetaddress\number\authornumber\endcsname |
| 2220 |
\@gobble |
| 2221 |
} |
| 2222 |
% \end{macrocode} |
| 2223 |
% |
| 2224 |
% \cs{address} copies its argument into the \cs{theaddress<n>} |
| 2225 |
% for this author. |
| 2226 |
% |
| 2227 |
% \begin{macrocode} |
| 2228 |
\def\address#1{% |
| 2229 |
\expandafter\def\csname theaddress\number\authornumber\endcsname |
| 2230 |
{\leavevmode\ignorespaces#1\unskip}} |
| 2231 |
% \end{macrocode} |
| 2232 |
% |
| 2233 |
% \cs{network} is for use within the optional argument of |
| 2234 |
% \cs{netaddress}; it defines the \emph{name} of the network the user |
| 2235 |
% is on. |
| 2236 |
% |
| 2237 |
% \begin{description} |
| 2238 |
% \item[\emph{Comment:}] I think this is a fantasy, since everyone (in |
| 2239 |
% practice, nowadays) quotes an internet address. In principle, there |
| 2240 |
% are people who will quote |X.400| addresses (but they're few and far |
| 2241 |
% between) and I have (during 1995!)\ seen an address with an |UUCP| |
| 2242 |
% bang-path component on |comp.text.tex|, but \emph{really}! |
| 2243 |
% \end{description} |
| 2244 |
% |
| 2245 |
% \begin{macrocode} |
| 2246 |
\def\network#1{\def\@network{#1: }} |
| 2247 |
% \end{macrocode} |
| 2248 |
% |
| 2249 |
% \cs{netaddress} begins a group, executes an optional argument (which |
| 2250 |
% should not, presumably, contain global commands) and then relays to |
| 2251 |
% \cs{@relay@netaddress} with both |@| and |%| made active (so that |
| 2252 |
% they can be discretionary points in the address). If we're using |
| 2253 |
% \LaTeXe, we use the default-argument form of \cs{newcommand}; |
| 2254 |
% otherwise we write it out in all its horribleness. |
| 2255 |
% |
| 2256 |
% \begin{macrocode} |
| 2257 |
\newcommand{\netaddress}[1][\relax]{% |
| 2258 |
\begingroup |
| 2259 |
\def\@network{}% |
| 2260 |
% \end{macrocode} |
| 2261 |
% |
| 2262 |
% Unfortunately, because of the catcode hackery, we have still to do |
| 2263 |
% one stage of relaying within our own code, even if we're using |
| 2264 |
% \LaTeXe. |
| 2265 |
% |
| 2266 |
% \begin{macrocode} |
| 2267 |
#1\@sanitize\makespace\ \makeactive\@% |
| 2268 |
\makeescape! \makebgroup[ \makeegroup]% seems more useful than literals |
| 2269 |
\makeactive\.\makeactive\%\@relay@netaddress}% |
| 2270 |
% \end{macrocode} |
| 2271 |
% |
| 2272 |
% \cs{@relay@netaddress} finishes the job. It sets \cs{thenetaddress} |
| 2273 |
% for this author to contain the network name followed by the address. |
| 2274 |
% As a result of our kerfuffle above, |@| and |%| are active at the |
| 2275 |
% point we're entered. We ensure they're active when |
| 2276 |
% \cs{thenetaddress} gets expanded, too. (\textbf{\emph{WOT}?!}) |
| 2277 |
% |
| 2278 |
% \begin{macrocode} |
| 2279 |
\def\@relay@netaddress#1{% |
| 2280 |
\ProtectNetChars |
| 2281 |
\expandafter\protected@xdef |
| 2282 |
\csname thenetaddress\number\authornumber\endcsname |
| 2283 |
{\protect\leavevmode\textrm{\@network}% |
| 2284 |
{\protect\NetAddrChars\net |
| 2285 |
\ignorespaces#1\unskip}}% |
| 2286 |
\endgroup |
| 2287 |
} |
| 2288 |
% \end{macrocode} |
| 2289 |
% |
| 2290 |
% We \cs{personalURL} quite differently from \cs{netaddress}: it |
| 2291 |
% is set up to simply call \cs{tburl}, which makes a live link if |
| 2292 |
% possible, and also removes a leading protocol. Thus the argument has |
| 2293 |
% to be a true url, not just a random string, but that restriction seems |
| 2294 |
% ok to get the benefits. Since \cs{tburl} handles all the catcoding, no |
| 2295 |
% need to do any of that here. |
| 2296 |
% |
| 2297 |
% \begin{macrocode} |
| 2298 |
\def\personalURL#1{% |
| 2299 |
% define \cs{thePersonalURL}\meta{n} for author \meta{n}'s \personalURL. |
| 2300 |
\expandafter\protected@xdef |
| 2301 |
\csname thePersonalURL\number\authornumber\endcsname{% |
| 2302 |
\protect\leavevmode |
| 2303 |
\ignorespaces |
| 2304 |
\protect\tburl{#1}% |
| 2305 |
\unskip |
| 2306 |
}% |
| 2307 |
} |
| 2308 |
% \end{macrocode} |
| 2309 |
% |
| 2310 |
% Previously: \cs{personalURL} was similar to \cs{netaddress}, apart |
| 2311 |
% from (1) the lack of the eccentric optional argument, (2) the |
| 2312 |
% activation of `|/|'. This is the old definition, no longer used (left |
| 2313 |
% here just for posterity); new definition is just above. |
| 2314 |
% |
| 2315 |
% \begin{macrocode} |
| 2316 |
%\def\personalURL{\begingroup |
| 2317 |
% \@sanitize\makespace\ \makeactive\@% |
| 2318 |
% \makeactive\.\makeactive\%\makeactive\/% |
| 2319 |
% \@personalURL}% |
| 2320 |
%\def\@personalURL#1{% |
| 2321 |
% \ProtectNetChars |
| 2322 |
% % define \cs{thePersonalURL}\meta{n} for author \meta{n}. |
| 2323 |
% \expandafter\protected@xdef |
| 2324 |
% \csname thePersonalURL\number\authornumber\endcsname{% |
| 2325 |
% \protect\leavevmode |
| 2326 |
% {% |
| 2327 |
% \protect\URLchars |
| 2328 |
% \net |
| 2329 |
% \ignorespaces\protect\tburl{#1}\unskip |
| 2330 |
% }% |
| 2331 |
% }% |
| 2332 |
% \endgroup |
| 2333 |
%} |
| 2334 |
% \end{macrocode} |
| 2335 |
% |
| 2336 |
% Define the activation mechanism for `|@|', `|%|', `|.|' and `|/|', for use |
| 2337 |
% in the above. Note that, since the code has `|%|' active, we have |
| 2338 |
% `|*|' as a comment character, which has a tendency to make things |
| 2339 |
% look peculiar\dots |
| 2340 |
% |
| 2341 |
% \begin{macrocode} |
| 2342 |
{% |
| 2343 |
\makecomment\* |
| 2344 |
\makeactive\@ |
| 2345 |
\gdef\netaddrat{\makeactive\@* |
| 2346 |
\def@{\discretionary{\char"40}{}{\char"40}}} |
| 2347 |
\makeactive\% |
| 2348 |
\gdef\netaddrpercent{\makeactive\%* |
| 2349 |
\def%{\discretionary{\char"25}{}{\char"25}}} |
| 2350 |
\makeactive\. |
| 2351 |
\gdef\netaddrdot{\makeactive\.* |
| 2352 |
\def.{\discretionary{\char"2E}{}{\char"2E}}} |
| 2353 |
% \end{macrocode} |
| 2354 |
% |
| 2355 |
% \cs{NetAddrChars} is what \emph{we} use (we're constrained to retain |
| 2356 |
% the old interface to this stuff, but it \emph{is} clunky\dots). |
| 2357 |
% Since {\small URL}s are a new idea, we are at liberty not to define |
| 2358 |
% a separate \cs{netaddrslash} command, and we only have |
| 2359 |
% \cs{URLchars}. |
| 2360 |
% |
| 2361 |
% \begin{macrocode} |
| 2362 |
\gdef\NetAddrChars{\netaddrat \netaddrpercent \netaddrdot} |
| 2363 |
\makeactive\/ |
| 2364 |
\gdef\URLchars{* |
| 2365 |
\NetAddrChars |
| 2366 |
\makeactive\/* |
| 2367 |
\def/{\discretionary{\char"2F}{}{\char"2F}}} |
| 2368 |
% \end{macrocode} |
| 2369 |
% |
| 2370 |
% \cs{ProtectNetChars} includes protecting `|/|', since this does no |
| 2371 |
% harm in the case of net addresses (where it's not going to be |
| 2372 |
% active) and we thereby gain by not having yet another csname. |
| 2373 |
% |
| 2374 |
% \begin{macrocode} |
| 2375 |
\gdef\ProtectNetChars{* |
| 2376 |
\def@{\protect@}* |
| 2377 |
\def%{\protect%}* |
| 2378 |
\def.{\protect.}* |
| 2379 |
\def/{\protect/}* |
| 2380 |
} |
| 2381 |
} |
| 2382 |
% \end{macrocode} |
| 2383 |
% |
| 2384 |
% \LaTeXe{} (in its wisdom) suppresses |
| 2385 |
% \cs{DeclareOldFontCommand} when in compatibility mode, so that in |
| 2386 |
% that circumstance we need to use a declaration copied from |
| 2387 |
% |latex209.def| rather than the way we would normally do the thing |
| 2388 |
% (using the command \LaTeXe{} defines for the job). |
| 2389 |
% |
| 2390 |
% \begin{macrocode} |
| 2391 |
\if@compatibility |
| 2392 |
\DeclareRobustCommand{\net}{\normalfont\ttfamily\mathgroup\symtypewriter} |
| 2393 |
\else |
| 2394 |
\DeclareOldFontCommand{\net}{\ttfamily\upshape\mdseries}{\mathtt} |
| 2395 |
\fi |
| 2396 |
\def\authorlist#1{\def\@author{#1}} |
| 2397 |
\def\@author{\@defaultauthorlist} |
| 2398 |
% \end{macrocode} |
| 2399 |
% |
| 2400 |
% \cs{ORCID} inserts `ORCID' and then argument into the \cs{theORCID<n>} |
| 2401 |
% for this author. Also, we want \cs{small} for this. |
| 2402 |
% |
| 2403 |
% \begin{macrocode} |
| 2404 |
\def\ORCID#1{% |
| 2405 |
\expandafter\def\csname theORCID\number\authornumber\endcsname |
| 2406 |
{\leavevmode \ignorespaces {\SMC ORCID} #1\unskip}} |
| 2407 |
% \end{macrocode} |
| 2408 |
% |
| 2409 |
% For the online re-publication (as of 2009) by Mathematical Sciences |
| 2410 |
% Publishers |http://mathscipub.org|, lots and lots of metadata is |
| 2411 |
% needed, much of it redundant with things we already do. They are |
| 2412 |
% flexible enough to allow us to specify it in any reasonable way, so |
| 2413 |
% let's make one command \cs{mspmetavar} which takes two arguments. |
| 2414 |
% Example: |\mspmetavar{volumenumber}{30}|. For our purposes, it is |
| 2415 |
% just a no-op. And this initiative never came to anything, so it is |
| 2416 |
% not used at all. |
| 2417 |
% |
| 2418 |
% \begin{macro}{\mspmetavar} |
| 2419 |
% \begin{macrocode} |
| 2420 |
\def\mspmetavar#1#2{} |
| 2421 |
% \end{macrocode} |
| 2422 |
% \end{macro} |
| 2423 |
% |
| 2424 |
% \subsection{Article title} |
| 2425 |
% |
| 2426 |
% \begin{macro}{\if@articletitle} |
| 2427 |
% \begin{macro}{\maketitle} |
| 2428 |
% \begin{macro}{\@r@maketitle} |
| 2429 |
% \cs{maketitle} takes an optional ``*''; if present, the operation is |
| 2430 |
% not defining the title of a paper, merely that of a ``business'' |
| 2431 |
% section (such as the participants at a meeting) that has no credited |
| 2432 |
% author or other title. In this case, the command flushes out the |
| 2433 |
% latest \cs{sectitle} (or whatever) but does nothing else. |
| 2434 |
% |
| 2435 |
% Provide machinery (|\PreTitleDrop| to skip extra space, even one or |
| 2436 |
% more full columns, |
| 2437 |
% above the top of an article to leave space to paste up a previous |
| 2438 |
% article that has finished on the same page. This is a fall back to |
| 2439 |
% accommodate the fact that multiple articles cannot be run together % easily. |
| 2440 |
% |
| 2441 |
% In addition, if the |secondcolstart| option was specified, do |
| 2442 |
% |\null\newpage| to move over. This is separate from |\PreTitleDrop|, |
| 2443 |
% for no particular reason. |
| 2444 |
% |
| 2445 |
% \begin{macrocode} |
| 2446 |
\newif\if@articletitle |
| 2447 |
\def\maketitle{\@ifstar |
| 2448 |
{\@articletitlefalse\@r@maketitle}% |
| 2449 |
{\@articletitletrue\@r@maketitle}% |
| 2450 |
} |
| 2451 |
\def\@r@maketitle{\par |
| 2452 |
\iftubsecondcolstart \null\newpage\tubsecondcolstartextra \fi |
| 2453 |
\ifdim\PreTitleDrop > \z@ |
| 2454 |
\loop |
| 2455 |
\ifdim \PreTitleDrop > \textheight |
| 2456 |
\vbox{}\vfil\eject |
| 2457 |
\advance\PreTitleDrop by -\textheight |
| 2458 |
\repeat |
| 2459 |
\vbox to \PreTitleDrop{\vfil}% |
| 2460 |
\global\PreTitleDrop=\z@ |
| 2461 |
\fi |
| 2462 |
\begingroup |
| 2463 |
\setcounter{footnote}{0} |
| 2464 |
\global\@topnum\z@ % disallow floats above the title |
| 2465 |
\def\thefootnote{\fnsymbol{footnote}} |
| 2466 |
\@maketitle |
| 2467 |
\@thanks |
| 2468 |
\endgroup |
| 2469 |
\setcounter{footnote}{0} |
| 2470 |
\gdef\@thanks{} |
| 2471 |
} |
| 2472 |
% \end{macrocode} |
| 2473 |
% \end{macro} |
| 2474 |
% \end{macro} |
| 2475 |
% \end{macro} |
| 2476 |
% |
| 2477 |
% \begin{macro}{\title} |
| 2478 |
% \begin{macro}{\TB@title} |
| 2479 |
% We redefine the \cs{title} command, so as to set the \cs{rhTitle} |
| 2480 |
% command at the same time. While we're at it, we redefine it to have |
| 2481 |
% optional arguments for use as `short' versions, thus obviating the |
| 2482 |
% need for users to use the \cs{shortTitle} command. |
| 2483 |
% \begin{macrocode} |
| 2484 |
\def\rhTitle{}% avoid error if no author or title |
| 2485 |
\renewcommand{\title}{\@dblarg\TB@title} |
| 2486 |
\def\TB@title[#1]#2{\gdef\@title{#2}% |
| 2487 |
\bgroup |
| 2488 |
\let\thanks\@gobble |
| 2489 |
\def\\{\unskip\space\ignorespaces}% |
| 2490 |
\protected@xdef\rhTitle{#1}% |
| 2491 |
\egroup |
| 2492 |
} |
| 2493 |
% \end{macrocode} |
| 2494 |
% \end{macro} |
| 2495 |
% \end{macro} |
| 2496 |
% |
| 2497 |
% \begin{macro}{\shortTitle} |
| 2498 |
% \begin{macro}{\ifshortAuthor} |
| 2499 |
% \begin{macro}{\shortAuthor} |
| 2500 |
% The \cs{rh*} commands are versions to be used in the running head of |
| 2501 |
% the article. Normally, they are the same things as the author and |
| 2502 |
% title of the article, but in the case that there are confusions |
| 2503 |
% therein, the text should provide substitutes, using the \cs{short*} |
| 2504 |
% commands. |
| 2505 |
% \begin{macrocode} |
| 2506 |
\def\shortTitle #1{\def\rhTitle{#1}} |
| 2507 |
\newif\ifshortAuthor |
| 2508 |
\def\shortAuthor #1{\def\rhAuthor{#1}\shortAuthortrue} |
| 2509 |
% \end{macrocode} |
| 2510 |
% \end{macro} |
| 2511 |
% \end{macro} |
| 2512 |
% \end{macro} |
| 2513 |
% |
| 2514 |
% \subsection{Section titles} |
| 2515 |
% |
| 2516 |
% The following macros are used to set the large \TUB{} section heads |
| 2517 |
% (e.g.\ ``General Delivery'', ``Fonts'', etc.) |
| 2518 |
% |
| 2519 |
% Define the distance between articles which are run together: |
| 2520 |
% |
| 2521 |
% \begin{macrocode} |
| 2522 |
\def\secsep{\vskip 5\baselineskip} |
| 2523 |
% \end{macrocode} |
| 2524 |
% |
| 2525 |
% Note that \cs{stbaselineskip} is used in the definition of |
| 2526 |
% \cs{sectitlefont}, in \LaTeXe, so that it has (at least) to be |
| 2527 |
% defined before \cs{sectitlefont} is used (we do the whole job). |
| 2528 |
% |
| 2529 |
% \begin{macrocode} |
| 2530 |
\newdimen\stbaselineskip \stbaselineskip=18\p@ |
| 2531 |
\newdimen\stfontheight |
| 2532 |
\settoheight{\stfontheight}{\sectitlefont O} |
| 2533 |
% \end{macrocode} |
| 2534 |
% |
| 2535 |
% Declaring section titles; the conditional \cs{ifSecTitle} records |
| 2536 |
% the occurence of a \cs{sectitle} command. If (when) a subsequent |
| 2537 |
% \cs{maketitle} occurs, the section title box will get flushed out; |
| 2538 |
% as a result of this, one could in principle have a set of |
| 2539 |
% \cs{sectitle} commands in a semi-fixed steering file, and inclusions |
| 2540 |
% of files inserted only as and when papers have appeared. Only the |
| 2541 |
% last \cs{sectitle} will actually be executed. |
| 2542 |
% |
| 2543 |
% \begin{macrocode} |
| 2544 |
\newif\ifWideSecTitle |
| 2545 |
\newif\iftubtitlerulefullwidth |
| 2546 |
\newif\ifSecTitle \SecTitlefalse |
| 2547 |
\newcommand{\sectitle}{% |
| 2548 |
\SecTitletrue |
| 2549 |
\@ifstar |
| 2550 |
{\WideSecTitletrue\def\s@ctitle}% |
| 2551 |
{\WideSecTitlefalse\def\s@ctitle}% |
| 2552 |
} |
| 2553 |
% \end{macrocode} |
| 2554 |
% |
| 2555 |
% \cs{PreTitleDrop} records the amount of column-space we need to |
| 2556 |
% eject before we start any given paper. It gets zeroed after that |
| 2557 |
% ejection has happened. |
| 2558 |
% |
| 2559 |
% \begin{macrocode} |
| 2560 |
\newdimen\PreTitleDrop \PreTitleDrop=\z@ |
| 2561 |
% \end{macrocode} |
| 2562 |
% |
| 2563 |
% The other parameters used in \cs{@sectitle}; I don't think there's |
| 2564 |
% the slightest requirement for them to be registers (since they're |
| 2565 |
% constant values, AFAIK), but converting them to macros would remove |
| 2566 |
% the essentially useless functionality of being able to change them |
| 2567 |
% using assignment, which I'm not about to struggle with just now... |
| 2568 |
% |
| 2569 |
% \cs{AboveTitleSkip} is glue above the article title; |
| 2570 |
% \cs{BelowTitleSkip} is glue below the authors in the title block. |
| 2571 |
% \cs{strulethickness} is the value to use for \cs{fboxrule} when |
| 2572 |
% setting the title, and for the rule above titles when there is no box. |
| 2573 |
% |
| 2574 |
% For \cs{BelowTitleSkip}, add some stretch and shrink since the first |
| 2575 |
% column of an article often needs it; otherwise, a first column of all |
| 2576 |
% text will come out underfull. Use |plus2pt| since that is the same |
| 2577 |
% as the glue above sections, but |minus1pt| since we'd usually prefer |
| 2578 |
% to shrink somewhere else if possible. |
| 2579 |
% |
| 2580 |
% \begin{macrocode} |
| 2581 |
\newskip\AboveTitleSkip \AboveTitleSkip=12pt |
| 2582 |
\newskip\BelowTitleSkip \BelowTitleSkip=8pt plus2pt minus1pt |
| 2583 |
\newdimen\strulethickness \strulethickness=.6pt |
| 2584 |
% \end{macrocode} |
| 2585 |
% |
| 2586 |
% \cs{@sectitle} actually generates the section title (in a rather |
| 2587 |
% generous box). It gets called from \cs{maketitle} under conditional |
| 2588 |
% \cs{ifSecTitle}; by the time \cs{@sectitle} takes control, we |
| 2589 |
% already have \cs{SecTitlefalse}. This implementation uses \LaTeX's |
| 2590 |
% \cs{framebox} command, on the grounds that one doesn't keep a dog |
| 2591 |
% and bark for oneself\dots |
| 2592 |
% |
| 2593 |
% \begin{macrocode} |
| 2594 |
\def\@sectitle #1{% |
| 2595 |
\par |
| 2596 |
\penalty-1000 |
| 2597 |
% \end{macrocode} |
| 2598 |
% |
| 2599 |
% If we're setting a wide title, the stuff will be at the top of a |
| 2600 |
% page (let alone a column) but inside a box, so that the separator |
| 2601 |
% won't be discardable: so don't create the separator in this case. |
| 2602 |
% |
| 2603 |
% \begin{macrocode} |
| 2604 |
\ifWideSecTitle\else\secsep\fi |
| 2605 |
{% |
| 2606 |
\fboxrule\strulethickness |
| 2607 |
\fboxsep\z@ |
| 2608 |
\noindent\framebox[\hsize]{% |
| 2609 |
\vbox{% |
| 2610 |
\raggedcenter |
| 2611 |
\let\\\@sectitle@newline |
| 2612 |
\sectitlefont |
| 2613 |
\makestrut[2\stfontheight;\z@]% |
| 2614 |
#1% |
| 2615 |
\makestrut[\z@;\stfontheight]\endgraf |
| 2616 |
}% |
| 2617 |
}% |
| 2618 |
}% |
| 2619 |
\nobreak |
| 2620 |
\vskip\baselineskip |
| 2621 |
} |
| 2622 |
% \end{macrocode} |
| 2623 |
% |
| 2624 |
% \begin{macro}{\@sectitle@newline} |
| 2625 |
% For use inside \cs{sectitle} as |\\|. Works similarly to |\\| in |
| 2626 |
% the ``real world''---uses an optional argument |
| 2627 |
% \begin{macrocode} |
| 2628 |
\newcommand{\@sectitle@newline}[1][\z@]{% |
| 2629 |
\ifdim#1>\z@ |
| 2630 |
\makestrut[\z@;#1]% |
| 2631 |
\fi |
| 2632 |
\unskip\break |
| 2633 |
} |
| 2634 |
% \end{macrocode} |
| 2635 |
% \end{macro} |
| 2636 |
% |
| 2637 |
% We need to trigger the making of a section title in some cases where |
| 2638 |
% we don't have a section title proper (for example, in material taken |
| 2639 |
% over from |
| 2640 |
%^^A \acro |
| 2641 |
% {TTN}). |
| 2642 |
% \begin{macrocode} |
| 2643 |
\def\@makesectitle{\ifSecTitle |
| 2644 |
\global\SecTitlefalse |
| 2645 |
\ifWideSecTitle |
| 2646 |
\twocolumn[\@sectitle{\s@ctitle}]% |
| 2647 |
\global\WideSecTitlefalse |
| 2648 |
\else |
| 2649 |
\@sectitle{\s@ctitle}% |
| 2650 |
\fi |
| 2651 |
\else |
| 2652 |
\vskip\AboveTitleSkip |
| 2653 |
\kern\topskip |
| 2654 |
\hrule \@height\z@ \@depth\z@ \@width 10\p@ |
| 2655 |
\kern-\topskip |
| 2656 |
\kern-\strulethickness |
| 2657 |
\iftubtitlerulefullwidth |
| 2658 |
\hrule \@height\strulethickness \@depth\z@ width\textwidth |
| 2659 |
\else |
| 2660 |
\hrule \@height\strulethickness \@depth\z@ |
| 2661 |
\fi |
| 2662 |
\kern\medskipamount |
| 2663 |
\nobreak |
| 2664 |
\fi |
| 2665 |
} |
| 2666 |
% \end{macrocode} |
| 2667 |
% |
| 2668 |
% \begin{macro}{\@maketitle} |
| 2669 |
% Finally, the body of \cs{maketitle} itself. |
| 2670 |
% \begin{macrocode} |
| 2671 |
\def\@maketitle{% |
| 2672 |
\@makesectitle |
| 2673 |
\if@articletitle{% |
| 2674 |
\nohyphens \interlinepenalty\@M |
| 2675 |
\setbox0=\hbox{% |
| 2676 |
\let\thanks\@gobble |
| 2677 |
\let\\=\quad |
| 2678 |
\let\and=\quad |
| 2679 |
\ignorespaces\@author}% |
| 2680 |
{% |
| 2681 |
\noindent\bf\raggedright\ignorespaces\frenchspacing |
| 2682 |
\let\BibTeX=\bfBibTeX % else LaTeX Font Warning: |
| 2683 |
% Font shape `OT1/cmr/bx/sc' undefined |
| 2684 |
\@title\endgraf |
| 2685 |
}% |
| 2686 |
\ifdim \wd0 < 5\p@ % omit if author is null |
| 2687 |
\else |
| 2688 |
% \end{macrocode} |
| 2689 |
% Since we have \(\hbox{\cs{BelowTitleSkip}} + \mathtt{4pt} = |
| 2690 |
% \hbox{\cs{baselineskip}}\), we skip by |4pt| here. However, an |
| 2691 |
% all-text first column still comes out underfull, maybe because of the |
| 2692 |
% top rule? Thus \cs{BelowTitleSkip} is given a little stretch and shrink. |
| 2693 |
% \begin{macrocode} |
| 2694 |
\nobreak \vskip 4\p@ |
| 2695 |
{% |
| 2696 |
\leftskip=\normalparindent |
| 2697 |
\raggedright |
| 2698 |
\def\and{\unskip\\}% |
| 2699 |
\noindent\@author\endgraf |
| 2700 |
}% |
| 2701 |
\fi |
| 2702 |
\nobreak |
| 2703 |
\vskip\BelowTitleSkip |
| 2704 |
}\fi% |
| 2705 |
\global\@afterindentfalse |
| 2706 |
\aftergroup\@afterheading |
| 2707 |
} |
| 2708 |
% \end{macrocode} |
| 2709 |
% \end{macro} |
| 2710 |
% |
| 2711 |
% Dedications are ragged right, in italics. |
| 2712 |
% |
| 2713 |
% \begin{macrocode} |
| 2714 |
\newenvironment{dedication}% |
| 2715 |
{\raggedright\noindent\itshape\ignorespaces}% |
| 2716 |
{\endgraf\medskip} |
| 2717 |
% \end{macrocode} |
| 2718 |
% |
| 2719 |
% The |abstract| and |longabstract| environments both use \cs{section*}. |
| 2720 |
% For one-column articles (or in |ltugproc| class), indent the |
| 2721 |
% abstract. This is done in the usual bizarre \LaTeX\ way, by treating |
| 2722 |
% it as a one-item list with an empty item marker. |
| 2723 |
% |
| 2724 |
% \begin{macrocode} |
| 2725 |
\def\@tubonecolumnabstractstart{% |
| 2726 |
\list{}{\listparindent\normalparindent |
| 2727 |
\itemindent\z@ \leftmargin\@tubfullpageindent |
| 2728 |
\rightmargin\leftmargin \parsep \z@}\item[]\ignorespaces |
| 2729 |
} |
| 2730 |
\def\@tubonecolumnabstractfinish{% |
| 2731 |
\endlist |
| 2732 |
} |
| 2733 |
\renewenvironment{abstract}% |
| 2734 |
{\begin{SafeSection}% |
| 2735 |
\section*{% |
| 2736 |
\if@tubtwocolumn\else \hspace*{\@tubfullpageindent}\fi |
| 2737 |
Abstract}% |
| 2738 |
\if@tubtwocolumn\else \@tubonecolumnabstractstart \fi |
| 2739 |
}% |
| 2740 |
{\if@tubtwocolumn\else \@tubonecolumnabstractfinish \fi |
| 2741 |
\end{SafeSection}} |
| 2742 |
\newenvironment{longabstract}% |
| 2743 |
{\begin{SafeSection}% |
| 2744 |
\section*{Abstract}% |
| 2745 |
\bgroup\small |
| 2746 |
}% |
| 2747 |
{\endgraf\egroup |
| 2748 |
\end{SafeSection}% |
| 2749 |
\vspace{.25\baselineskip} |
| 2750 |
\begin{center} |
| 2751 |
{$--*--$} |
| 2752 |
\end{center} |
| 2753 |
\vspace{.5\baselineskip}} |
| 2754 |
% \end{macrocode} |
| 2755 |
% |
| 2756 |
% \subsection{Section headings} |
| 2757 |
% |
| 2758 |
% Redefine style of section headings to match plain \TUB. |
| 2759 |
% Negative beforeskip suppresses following parindent. (So |
| 2760 |
% negate the stretch and shrink too). |
| 2761 |
% |
| 2762 |
% These macros are called \cs{*head} in the plain styles. |
| 2763 |
% |
| 2764 |
% Relaying via \cs{TB@startsection} detects inappropriate use of |
| 2765 |
% \cs{section*}. Of course, if (when) \emph{we} use it, we need to |
| 2766 |
% avoid that relaying; this can be done by \cs{let}ting |
| 2767 |
% \cs{TB@startsection} to \cs{TB@safe@startsection}, within a group. |
| 2768 |
% |
| 2769 |
% First the version for use in the default case, when class option |
| 2770 |
% \textsc{numbersec} is in effect. |
| 2771 |
% |
| 2772 |
% The \cs{tubsecfmt} macro defines our standard formatting for section |
| 2773 |
% titles: ragged right, french spacing, no hyphenation. |
| 2774 |
% The \cs{tubruninsecfmt} macro is the simpler form for run-in section |
| 2775 |
% headings (when the afterskip is negative), with the afterskip glue |
| 2776 |
% given by \cs{tubruninglue}. |
| 2777 |
% The \cs{tubsechook} macro allows overriding the defaults. |
| 2778 |
% |
| 2779 |
% \begin{macrocode} |
| 2780 |
\def\tubsechook{} |
| 2781 |
\def\tubsecfmt{\normalsize\bf\raggedright\frenchspacing\nohyphens\tubsechook} |
| 2782 |
\def\tubruninglue{-1em plus-2\fontdimen3\font minus-\fontdimen4\font} |
| 2783 |
\def\tubruninsecfmt{\normalsize\bf\tubsechook} |
| 2784 |
% |
| 2785 |
\if@numbersec |
| 2786 |
\def\section{\TB@startsection{% |
| 2787 |
{section} % name of counter |
| 2788 |
{1} % level |
| 2789 |
{0pt} % indent |
| 2790 |
{-8pt plus-2pt minus-2pt} % beforeskip; negative -> \noindent after |
| 2791 |
{4pt} % afterskip; negative -> hspace for run-in |
| 2792 |
{\tubsecfmt}}} % style |
| 2793 |
% |
| 2794 |
\def\subsection{\TB@startsection{% |
| 2795 |
{subsection}% |
| 2796 |
2% |
| 2797 |
\z@ |
| 2798 |
{-8\p@ \@plus-2\p@ \@minus-2\p@}% |
| 2799 |
{4\p@}% |
| 2800 |
{\tubsecfmt}}} |
| 2801 |
% |
| 2802 |
\def\subsubsection{\TB@startsection{% |
| 2803 |
{subsubsection}% |
| 2804 |
3% |
| 2805 |
\z@ |
| 2806 |
{-8\p@ \@plus-2\p@ \@minus-2\p@}% |
| 2807 |
{4\p@}% |
| 2808 |
{\tubsecfmt}}} |
| 2809 |
% |
| 2810 |
\def\paragraph{\TB@startsection{% |
| 2811 |
{paragraph}% |
| 2812 |
4% |
| 2813 |
\z@ |
| 2814 |
{4\p@ \@plus1\p@ \@minus1\p@}% |
| 2815 |
{\tubruninglue} |
| 2816 |
{\tubruninsecfmt}}} |
| 2817 |
% \end{macrocode} |
| 2818 |
% |
| 2819 |
% Now the version if class option \texttt{nonumber} is in effect, |
| 2820 |
% i.e., if \cs{if@numbersec} is false. |
| 2821 |
% |
| 2822 |
% \begin{macrocode} |
| 2823 |
\else |
| 2824 |
\setcounter{secnumdepth}{0} |
| 2825 |
\def\section{\TB@nolimelabel\TB@startsection{% |
| 2826 |
{section}% same as numbered |
| 2827 |
1% |
| 2828 |
\z@ |
| 2829 |
{-8\p@ \@plus-2\p@ \@minus-2\p@}% |
| 2830 |
{4\p@}% |
| 2831 |
{\tubsecfmt}}} |
| 2832 |
% |
| 2833 |
\def\subsection{\TB@nolimelabel\TB@startsection{% |
| 2834 |
{subsection}% |
| 2835 |
2% |
| 2836 |
\z@ |
| 2837 |
{-8\p@ \@plus-2\p@ \@minus-2\p@}% |
| 2838 |
{\tubruninglue} |
| 2839 |
{\tubruninsecfmt}}} |
| 2840 |
% |
| 2841 |
\def\subsubsection{\TB@nolimelabel\TB@startsection{% |
| 2842 |
{subsubsection}% |
| 2843 |
3% |
| 2844 |
\parindent |
| 2845 |
{-8\p@ \@plus-2\p@ \@minus-2\p@}% |
| 2846 |
{\tubruninglue} |
| 2847 |
{\tubruninsecfmt}}} |
| 2848 |
\fi |
| 2849 |
% \end{macrocode} |
| 2850 |
% |
| 2851 |
% \cs{TB@startsection} used to warn about \verb"*" versions of sectioning |
| 2852 |
% commands when numbering wasn't in effect. But that eventually seemed |
| 2853 |
% a useless complaint, since it can be useful to switch back and forth between |
| 2854 |
% numbered and unnumbered can be useful during article development. |
| 2855 |
% So now \cs{TB@startsection} is just a synonym for \cs{@startsection}. |
| 2856 |
% |
| 2857 |
% \begin{macrocode} |
| 2858 |
\def\TB@startsection#1{\@startsection#1}% |
| 2859 |
% \end{macrocode} |
| 2860 |
% |
| 2861 |
% \cs{TB@safe@startsection} is to be used where \cs{section*} (etc.)\ |
| 2862 |
% appear in places where the request is OK (because it's built in to |
| 2863 |
% some macro we don't fiddle with). |
| 2864 |
% |
| 2865 |
% \begin{macrocode} |
| 2866 |
\def\TB@safe@startsection#1{\@startsection#1} |
| 2867 |
% \end{macrocode} |
| 2868 |
% |
| 2869 |
% The \texttt{SafeSection} environment allows use of \texttt{*}-forms |
| 2870 |
% of sectioning environments. It's not documented for the general |
| 2871 |
% public: it's intended as an editor's facility. |
| 2872 |
% |
| 2873 |
% \begin{macrocode} |
| 2874 |
\newenvironment{SafeSection}% |
| 2875 |
{\let\TB@startsection\TB@safe@startsection}% |
| 2876 |
{} |
| 2877 |
% \end{macrocode} |
| 2878 |
% |
| 2879 |
% And now for the exciting sectioning commands that \LaTeX{} defines |
| 2880 |
% but we don't have a definition for (whatever else, we don't want |
| 2881 |
% Lamport's originals, which come out `like the blare of a bugle in a |
| 2882 |
% lullaby'\footnote{Thurber, \emph{The Wonderful O}}). |
| 2883 |
% |
| 2884 |
% The three inappropriate ones are subparagraph (indistinguishable |
| 2885 |
% from paragraph), and chapter and part. The last seemed almost to be |
| 2886 |
% defined in an early version of these macros, since there was a |
| 2887 |
% definition of \cs{l@part}. I've not got down to where that came |
| 2888 |
% from (or why). If class option \textsc{nonumber} is in effect, we |
| 2889 |
% also suppress \cs{paragraph}, since it has no parallel in the plain |
| 2890 |
% style. |
| 2891 |
% |
| 2892 |
% \begin{macrocode} |
| 2893 |
\if@numbersec |
| 2894 |
\def\subparagraph{\TB@nosection\subparagraph\paragraph} |
| 2895 |
\else |
| 2896 |
\def\paragraph{\TB@nosection\paragraph\subsubsection} |
| 2897 |
\def\subparagraph{\TB@nosection\subparagraph\subsubsection} |
| 2898 |
\fi |
| 2899 |
\def\chapter{\TB@nosection\chapter\section} |
| 2900 |
\def\part{\TB@nosection\part\section} |
| 2901 |
\def\TB@nosection#1#2{\TBWarning{class does not support \string#1, |
| 2902 |
\string#2\space used instead}#2} |
| 2903 |
% \end{macrocode} |
| 2904 |
% |
| 2905 |
% \cs{l@<sectioninglevel>} is for table of contents (of an article). |
| 2906 |
% We define new macros to allow easily changing the font used for toc |
| 2907 |
% entries (for \TUB, we usually want roman, not bold), and the space |
| 2908 |
% between entries. Nelson Beebe and Frank Mittelbach's articles |
| 2909 |
% often have toc's (and few others). Also turn off microtype |
| 2910 |
% protrusion after \tableofcontents, or leaders get messed up. |
| 2911 |
% |
| 2912 |
% \begin{macrocode} |
| 2913 |
\def\TBtocsectionfont{\normalfont} |
| 2914 |
\newskip\TBtocsectionspace \TBtocsectionspace=1.0ex\@plus\p@ |
| 2915 |
% \end{macrocode} |
| 2916 |
% |
| 2917 |
% \begin{macrocode} |
| 2918 |
% |#1| is both the section number and title, as in |
| 2919 |
% |{\numberline {1}Introduction}|. |
| 2920 |
% |#2| is the page number. |
| 2921 |
% |
| 2922 |
% Per Ulrike, the hook calls are for tagging, introduced with the |
| 2923 |
% June 2023 \LaTeX. |
| 2924 |
% qqq need to also do subsections like tb137carlisle to avoid hyphenation |
| 2925 |
\def\l@section#1#2{% |
| 2926 |
\addpenalty{\@secpenalty}% |
| 2927 |
\addvspace{\TBtocsectionspace}% |
| 2928 |
\@tempdima 1.5em |
| 2929 |
\begingroup |
| 2930 |
\parindent\z@ |
| 2931 |
\rightskip=0pt plus2em |
| 2932 |
\parfillskip\z@ |
| 2933 |
\hyphenpenalty=10000 |
| 2934 |
\TBtocsectionfont |
| 2935 |
\leavevmode |
| 2936 |
\advance\leftskip by \@tempdima % space between section number and text |
| 2937 |
\hskip-\leftskip |
| 2938 |
% |
| 2939 |
\ifx\UseHookWithArguments\undefined\else % hook before number and text |
| 2940 |
\UseHookWithArguments{contentsline/text/before}{4} |
| 2941 |
{\toclevel@part}{#1}{#2}{\@contentsline@destination}% |
| 2942 |
\fi |
| 2943 |
% |
| 2944 |
% don't worry if this cs is not defined, hence the \csname. |
| 2945 |
% If it doesn't exist, we just typeset #1 as text. |
| 2946 |
\csname contentsline@text@1@format\endcsname |
| 2947 |
{#1% number and title |
| 2948 |
\unskip % avoid extra space just in case |
| 2949 |
\csname pdffakespace\endcsname % fake space if pdftex |
| 2950 |
~% ensure at least a word space between text and page number |
| 2951 |
} |
| 2952 |
% |
| 2953 |
\ifx\UseHookWithArguments\undefined\else % hook after number and text |
| 2954 |
\UseHookWithArguments{contentsline/text/after}{4} |
| 2955 |
{\toclevel@part}{#1}{#2}{\@contentsline@destination}% |
| 2956 |
\fi |
| 2957 |
\nobreak\hfil |
| 2958 |
\nobreak |
| 2959 |
% page number |
| 2960 |
\hb@xt@\@pnumwidth{\hfil |
| 2961 |
\ifx\UseHookWithArguments\undefined\else |
| 2962 |
\UseHookWithArguments{contentsline/page/before}{4} |
| 2963 |
{\toclevel@part}{#1}{#2}{\@contentsline@destination}% |
| 2964 |
\fi |
| 2965 |
\tubtypesetpageno{#2}% |
| 2966 |
\ifx\UseHookWithArguments\undefined\else |
| 2967 |
\UseHookWithArguments{contentsline/page/after}{4} |
| 2968 |
{\toclevel@part}{#1}{#2}{\@contentsline@destination}% |
| 2969 |
\fi |
| 2970 |
}\par |
| 2971 |
\endgroup} |
| 2972 |
% \end{macrocode} |
| 2973 |
% |
| 2974 |
% \subsection{Appendices} |
| 2975 |
% |
| 2976 |
% Appendices (which are really just another sort of section heading) |
| 2977 |
% raise a problem: if the sections are unnumbered, we plainly need to |
| 2978 |
% restore the section numbering, which in turn allows labelling of |
| 2979 |
% section numbers again (\cs{TBnolimelabel} happens before the |
| 2980 |
% \cs{refstepcounter}, so its effects get lost \dots~what a clever |
| 2981 |
% piece of design that was). So here we go: |
| 2982 |
% |
| 2983 |
% \begin{macrocode} |
| 2984 |
\renewcommand{\appendix}{\par |
| 2985 |
\renewcommand{\thesection}{\@Alph\c@section}% |
| 2986 |
\setcounter{section}{0}% |
| 2987 |
\if@numbersec |
| 2988 |
\else |
| 2989 |
\setcounter{secnumdepth}{1}% |
| 2990 |
\fi |
| 2991 |
% \end{macrocode} |
| 2992 |
% |
| 2993 |
% Now: is this the start of an appendix environment? This can be |
| 2994 |
% detected by looking at \cs{@currenvir}; if we are, we need to relay |
| 2995 |
% to \cs{@appendix@env} to pick up the optional argument. |
| 2996 |
% |
| 2997 |
% \begin{macrocode} |
| 2998 |
\def\@tempa{appendix} |
| 2999 |
\ifx\@tempa\@currenvir |
| 3000 |
\expandafter\@appendix@env |
| 3001 |
\fi |
| 3002 |
} |
| 3003 |
% \end{macrocode} |
| 3004 |
% |
| 3005 |
% Here we deal with \cs{begin}|{appendix}|\oarg{app-name} |
| 3006 |
% |
| 3007 |
% \begin{macrocode} |
| 3008 |
\newcommand{\app@prefix@section}{} |
| 3009 |
\newcommand{\@appendix@env}[1][Appendix]{% |
| 3010 |
\renewcommand{\@seccntformat}[1]{\csname app@prefix@##1\endcsname |
| 3011 |
\csname the##1\endcsname\quad}% |
| 3012 |
\renewcommand{\app@prefix@section}{#1 }% |
| 3013 |
} |
| 3014 |
% \end{macrocode} |
| 3015 |
% |
| 3016 |
% Ending an appendix environment is pretty trivial\dots |
| 3017 |
% |
| 3018 |
% \begin{macrocode} |
| 3019 |
\let\endappendix\relax |
| 3020 |
% \end{macrocode} |
| 3021 |
% |
| 3022 |
% |
| 3023 |
% \subsection{References} |
| 3024 |
% |
| 3025 |
% If the sections aren't numbered, the natural tendency of the |
| 3026 |
% author to cross-reference (which, after all, is one of the things |
| 3027 |
% \LaTeX{} is for ever being advertised as being good at) can cause |
| 3028 |
% headaches. |
| 3029 |
% |
| 3030 |
% The following command is used by each of the sectioning commands to |
| 3031 |
% make a following \cs{ref} command bloop at the author. Even if the |
| 3032 |
% author then ignores the complaint, the poor old editor may find the |
| 3033 |
% offending \cs{label} rather more easily. |
| 3034 |
% |
| 3035 |
% (Note that macro name is to be read as ``\emph{noli me} label'' (I |
| 3036 |
% don't know the medi\ae val Latin for `label'). |
| 3037 |
% |
| 3038 |
% \begin{description} |
| 3039 |
% \item[\emph{Comment}] To come (perhaps): detection of the act of |
| 3040 |
% labelling, and an analogue of \cs{ifG@refundefined} for this sort of |
| 3041 |
% label |
| 3042 |
% \end{description} |
| 3043 |
% |
| 3044 |
% \begin{macrocode} |
| 3045 |
\def\TB@nolimelabel{% |
| 3046 |
\def\@currentlabel{% |
| 3047 |
\protect\TBWarning{% |
| 3048 |
Invalid reference to numbered label on page \thepage |
| 3049 |
\MessageBreak made% |
| 3050 |
}% |
| 3051 |
\textbf{?!?}% |
| 3052 |
}% |
| 3053 |
} |
| 3054 |
% \end{macrocode} |
| 3055 |
% |
| 3056 |
% \subsection{Title references} |
| 3057 |
% |
| 3058 |
% This is a first cut at a mechanism for referencing by the title of a |
| 3059 |
% section; it employs the delightfully simple idea Sebastian Rahtz has |
| 3060 |
% in the \texttt{nameref} package (which is part of |
| 3061 |
% \texttt{hyperref}). As it stands, it lacks some of the bells and |
| 3062 |
% whistles of the original, but they could be added; this is merely |
| 3063 |
% proof-of-concept. |
| 3064 |
% |
| 3065 |
% The name label comes from the moveable bit of the section argument; |
| 3066 |
% we subvert the \cs{@sect} and \cs{@ssect} commands (the latter |
| 3067 |
% deals with starred section commands) to grab the relevant argument. |
| 3068 |
% |
| 3069 |
% As of the June 2023 \LaTeX\ (or somewhat earlier, but this is good |
| 3070 |
% enough), there are hooks that allow us to avoid redefinig |
| 3071 |
% \cs{@sect} and \cs{@ssect}. |
| 3072 |
% |
| 3073 |
% \begin{macrocode} |
| 3074 |
\@ifl@t@r\fmtversion{2023-06-01}{}{% |
| 3075 |
\let\TB@@sect\@sect |
| 3076 |
\let\TB@@ssect\@ssect |
| 3077 |
\def\@sect#1#2#3#4#5#6[#7]#8{% |
| 3078 |
\def\@currentlabelname{#7}% |
| 3079 |
\TB@@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}% |
| 3080 |
} |
| 3081 |
\def\@ssect#1#2#3#4#5{% |
| 3082 |
\def\@currentlabelname{#5}% |
| 3083 |
\TB@@ssect{#1}{#2}{#3}{#4}{#5}% |
| 3084 |
} |
| 3085 |
} % LaTeX earlier than June 2023 |
| 3086 |
% \end{macrocode} |
| 3087 |
% |
| 3088 |
% We output the name label as a second \cs{newlabel} command |
| 3089 |
% in the \texttt{.aux} file. That way, packages such as |varioref| |
| 3090 |
% which also read the \texttt{.aux} information can still work. |
| 3091 |
% So we redefine \cs{label} to first call the standard \LaTeX\ |
| 3092 |
% \cs{label} and then write our named label as |nr<label>|. |
| 3093 |
% |
| 3094 |
% Similarly, we only need this with pre-June 2023 \LaTeX. |
| 3095 |
% With more recent LaTeX, define \@currentlabelname via hooks. |
| 3096 |
% \begin{macrocode} |
| 3097 |
\@ifl@t@r\fmtversion{2023-06-01}{% |
| 3098 |
\RequirePackage{gettitlestring} |
| 3099 |
\AddToHookWithArguments{cmd/@sect/before}{% |
| 3100 |
\GetTitleString{#7}% |
| 3101 |
\let\@currentlabelname\GetTitleStringResult}% |
| 3102 |
\AddToHookWithArguments{cmd/@ssect/before}{% |
| 3103 |
\GetTitleString{#5}% |
| 3104 |
\let\@currentlabelname\GetTitleStringResult}% |
| 3105 |
}{% else older latex: |
| 3106 |
\let\@savelatexlabel=\label % so save original LaTeX command |
| 3107 |
% |
| 3108 |
\def\label#1{% |
| 3109 |
\@savelatexlabel{#1}% |
| 3110 |
\@bsphack |
| 3111 |
\if@filesw |
| 3112 |
\protected@write\@auxout{}% |
| 3113 |
{\string\newlabel{nr@#1}{{\@currentlabel}{\@currentlabelname}}}% |
| 3114 |
\fi |
| 3115 |
\@esphack} |
| 3116 |
% in case there are no sectioning commands: |
| 3117 |
\let\@currentlabelname\@empty |
| 3118 |
} |
| 3119 |
% \end{macrocode} |
| 3120 |
% |
| 3121 |
% Getting named references is then just like getting page references in |
| 3122 |
% the \LaTeX\ kernel (see |ltxref.dtx|). |
| 3123 |
% |
| 3124 |
% The above was written by RobinF decades ago; the macros in \TUB\ were |
| 3125 |
% never changed. Meanwhile, the \cs{nameref} in \texttt{hyperref} has |
| 3126 |
% changed many times, and we want to use its version if available. So we |
| 3127 |
% provide our \cs{nameref} \cs{AtBeginDocument}, so as not to overwrite |
| 3128 |
% any previous version. Until May 2022, \texttt{hyperref} silently |
| 3129 |
% overwrote an existing definition, that is, \TUB's. But now it is no |
| 3130 |
% longer silent. |
| 3131 |
% |
| 3132 |
% It seems that all the internal definitions above do not cause |
| 3133 |
% problems, so just let them alone. |
| 3134 |
% |
| 3135 |
% \begin{macrocode} |
| 3136 |
\AtBeginDocument{% |
| 3137 |
\@ifl@t@r\fmtversion{2023-06-01}% |
| 3138 |
{ % after June 2023, LaTeX stores the label name; use that. |
| 3139 |
\long\def\@thirdoffive#1#2#3#4#5{#3} |
| 3140 |
\providecommand\nameref[1]{% |
| 3141 |
\expandafter\@setref |
| 3142 |
\csname r@#1\endcsname\@thirdoffive{#1}}% |
| 3143 |
} |
| 3144 |
{ % for earlier versions, still avoid overwriting \nameref per above. |
| 3145 |
% but if not otherwise defined, use the "nr" label defined by our \label. |
| 3146 |
\providecommand\nameref[1]{% |
| 3147 |
\expandafter\@setref |
| 3148 |
\csname r@nr@#1\endcsname\@secondoftwo{#1}}% |
| 3149 |
}% |
| 3150 |
} |
| 3151 |
% \end{macrocode} |
| 3152 |
% |
| 3153 |
% \subsection{Float captions} |
| 3154 |
% |
| 3155 |
% By analogy with what we've just done to section titles and the like, |
| 3156 |
% we now do our best to discourage hyphenation within captions. We also |
| 3157 |
% typeset them in \cs{small} (actually \cs{tubcaptionfonts}). |
| 3158 |
% |
| 3159 |
% First, let's define a dimension by which we will indent full-page |
| 3160 |
% captions. We'll also use this to indent abstracts in proceedings style. |
| 3161 |
% \begin{macro}{\@tubfullpageindent} |
| 3162 |
% \begin{macrocode} |
| 3163 |
\newdimen\@tubfullpageindent |
| 3164 |
\@tubfullpageindent = \if@tubtwocolumn 4.875pc \else 3.875pc \fi |
| 3165 |
% \end{macrocode} |
| 3166 |
% \end{macro} |
| 3167 |
% |
| 3168 |
% One-line captions are normally centered, but sometimes we want to set |
| 3169 |
% them flush left for consistency with other nearby figures. |
| 3170 |
% \begin{macro}{\tubcaptionleftglue} |
| 3171 |
% \begin{macrocode} |
| 3172 |
\let\tubcaptionleftglue=\hfil |
| 3173 |
% \end{macrocode} |
| 3174 |
% \end{macro} |
| 3175 |
% |
| 3176 |
% For \TUB, we like 9pt captions to help differentiate from the main |
| 3177 |
% text. Make a macro so we can easily override. |
| 3178 |
% \begin{macrocode} |
| 3179 |
\def\tubcaptionfonts{\small}% |
| 3180 |
% \end{macrocode} |
| 3181 |
% |
| 3182 |
% Ok, here is \cs{@makecaption}. |
| 3183 |
% \begin{macrocode} |
| 3184 |
\long\def\@makecaption#1#2{% |
| 3185 |
\vskip\abovecaptionskip |
| 3186 |
% try in an hbox: |
| 3187 |
\sbox\@tempboxa{\tubcaptionfonts \frenchspacing \tubmakecaptionbox{#1}{#2}}% |
| 3188 |
\ifdim \wd\@tempboxa > \hsize |
| 3189 |
{% caption doesn't fit on one line; set as a paragraph. |
| 3190 |
\tubcaptionfonts \raggedright \hyphenpenalty=\@M \parindent=1em |
| 3191 |
% indent full-width captions {figure*}, but not single-column {figure}. |
| 3192 |
\ifdim\hsize = \textwidth |
| 3193 |
\leftskip=\@tubfullpageindent \rightskip=\leftskip |
| 3194 |
\advance\rightskip by 0pt plus2em % increase acceptable raggedness |
| 3195 |
\fi |
| 3196 |
\noindent \tubmakecaptionbox{#1}{#2}\par}% |
| 3197 |
\else |
| 3198 |
% fits on one line; use the hbox, usually centered. Do not reset its glue. |
| 3199 |
\global\@minipagefalse |
| 3200 |
\hb@xt@\hsize{\tubcaptionleftglue\box\@tempboxa\hfil}% |
| 3201 |
\fi |
| 3202 |
\vskip\belowcaptionskip} |
| 3203 |
% \end{macrocode} |
| 3204 |
% |
| 3205 |
% Also use \cs{tubcaptionfonts} for the caption |
| 3206 |
% labels, and put the label (e.g., ``Figure~1'') in bold. |
| 3207 |
% Use a macro so we can override. |
| 3208 |
% \begin{macrocode} |
| 3209 |
\def\tubmakecaptionbox#1#2{{\tubcaptionfonts\textbf{#1}}:\ #2}% |
| 3210 |
% \end{macrocode} |
| 3211 |
% |
| 3212 |
% We used to switch the labels into bold this way, but it's better to do |
| 3213 |
% it as part of |\@makecaption| since then it will apply to other |
| 3214 |
% floating types, such as those created by the |newfloat| package. |
| 3215 |
% (E.g., |tb142duck-pylatex|.) |
| 3216 |
%|\def\fnum@figure{{\tubcaptionfonts \bf \figurename\nobreakspace\thefigure}}| |
| 3217 |
%|\def\fnum@table{{\tubcaptionfonts \bf \tablename\nobreakspace\thetable}}| |
| 3218 |
% |
| 3219 |
% If the \texttt{listings} package is being used, bold for its |
| 3220 |
% label too; this \cs{def} is too early, but maybe listings will |
| 3221 |
% play nice later. |
| 3222 |
% |
| 3223 |
% \begin{macrocode} |
| 3224 |
\def\lstlistingnamestyle{\bfseries} |
| 3225 |
% \end{macrocode} |
| 3226 |
% |
| 3227 |
% Let's reduce the default space above captions a bit, and give it some |
| 3228 |
% flexibility. The default is |10pt|, which seems too much. |
| 3229 |
% \begin{macrocode} |
| 3230 |
\setlength\abovecaptionskip{3pt plus1pt minus1pt} |
| 3231 |
% \end{macrocode} |
| 3232 |
% |
| 3233 |
% Let's also reduce the space between floats, and between floats and text. |
| 3234 |
% Strangely, it seems to be these that count, rather than |\dbl...|, |
| 3235 |
% at least sometimes. |
| 3236 |
% \begin{macrocode} |
| 3237 |
\setlength\floatsep { 9pt plus3pt minus2pt} % default 12pt plus2pt minus2pt |
| 3238 |
\setlength\textfloatsep{12pt plus4pt minus3pt} % default 20pt plus2pt minus4pt |
| 3239 |
% \end{macrocode} |
| 3240 |
% |
| 3241 |
% We want to allow more floats at the top/bottom/everywhere on |
| 3242 |
% a page; all depends on their content. |
| 3243 |
% \begin{macrocode} |
| 3244 |
\setcounter{bottomnumber}{2} % default 1 |
| 3245 |
\setcounter{topnumber}{4} % default 2 |
| 3246 |
\setcounter{totalnumber}{6} % default 3 |
| 3247 |
% \end{macrocode} |
| 3248 |
% |
| 3249 |
% \subsection{Size changing commands} |
| 3250 |
% |
| 3251 |
% Apart from their `normal' effects, these commands change the glue |
| 3252 |
% around displays. |
| 3253 |
% \begin{macrocode} |
| 3254 |
\renewcommand{\normalsize}{% |
| 3255 |
\@setfontsize\normalsize\@xpt\@xiipt |
| 3256 |
\abovedisplayskip=3\p@\@plus 3\p@\@minus\p@ |
| 3257 |
\belowdisplayskip=\abovedisplayskip |
| 3258 |
\abovedisplayshortskip=\z@\@plus 3\p@ |
| 3259 |
\belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@ |
| 3260 |
} |
| 3261 |
|
| 3262 |
\renewcommand{\small}{% |
| 3263 |
\@setfontsize\small\@ixpt{11}% |
| 3264 |
\abovedisplayskip=2.5\p@\@plus 2.5\p@\@minus\p@ |
| 3265 |
\belowdisplayskip=\abovedisplayskip |
| 3266 |
\abovedisplayshortskip=\z@\@plus 2\p@ |
| 3267 |
\belowdisplayshortskip=\p@\@plus 2\p@\@minus\p@ |
| 3268 |
} |
| 3269 |
|
| 3270 |
\renewcommand{\footnotesize}{% |
| 3271 |
\@setfontsize\footnotesize\@viiipt{9.5}% |
| 3272 |
\abovedisplayskip=3\p@\@plus 3\p@\@minus\p@ |
| 3273 |
\belowdisplayskip=\abovedisplayskip |
| 3274 |
\abovedisplayshortskip=\z@\@plus 3\p@ |
| 3275 |
\belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@ |
| 3276 |
} |
| 3277 |
% \end{macrocode} |
| 3278 |
% |
| 3279 |
% \subsection{Lists and other text inclusions} |
| 3280 |
% |
| 3281 |
% \begin{macrocode} |
| 3282 |
\def\@listi{% |
| 3283 |
\leftmargin\leftmargini\parsep=\p@\@plus\p@\@minus\p@ |
| 3284 |
\itemsep=\parsep |
| 3285 |
\listparindent=1em |
| 3286 |
} |
| 3287 |
|
| 3288 |
\def\@listii{% |
| 3289 |
\leftmargin\leftmarginii |
| 3290 |
\labelwidth=\leftmarginii \advance\labelwidth-\labelsep |
| 3291 |
\topsep=2\p@\@plus\p@\@minus\p@ % space between first item and preceding |
| 3292 |
\parsep=\p@\@plus\p@\@minus\p@ |
| 3293 |
\itemsep=\parsep % space between successive items |
| 3294 |
\listparindent=1em % indentation of subsequent paragraphs |
| 3295 |
} |
| 3296 |
|
| 3297 |
\def\@listiii{% |
| 3298 |
\leftmargin=\leftmarginiii |
| 3299 |
\labelwidth=\leftmarginiii \advance\labelwidth-\labelsep |
| 3300 |
\topsep=\p@\@plus\p@\@minus\p@ |
| 3301 |
\parsep=\z@ |
| 3302 |
\itemsep=\topsep |
| 3303 |
\listparindent=1em |
| 3304 |
} |
| 3305 |
\def\quote{\list{}{\rightmargin.5\leftmargin}\item[]} |
| 3306 |
% \end{macrocode} |
| 3307 |
% |
| 3308 |
% From Dominik Wujastyk's font article. First paragraph of a quotation |
| 3309 |
% will not be indented, and right margin is decreased for narrow columns. |
| 3310 |
% \begin{macrocode} |
| 3311 |
\renewcommand{\quotation}{\list{}{\listparindent 1.5em |
| 3312 |
\rightmargin.5\leftmargin\parsep \z@\@plus\p@}\item[]} |
| 3313 |
% \end{macrocode} |
| 3314 |
% |
| 3315 |
% The |compactitemize|, |compactenumerate|, and |compactdescription| |
| 3316 |
% environments, without space between the items. |
| 3317 |
% |
| 3318 |
% \begin{macrocode} |
| 3319 |
\newenvironment{compactitemize}% |
| 3320 |
{\begin{itemize}% |
| 3321 |
\setlength{\itemsep}{0pt}% |
| 3322 |
\setlength{\parskip}{0pt}% |
| 3323 |
\setlength{\parsep} {0pt}% |
| 3324 |
}% |
| 3325 |
{\end{itemize}} |
| 3326 |
% |
| 3327 |
\newenvironment{compactenumerate}% |
| 3328 |
{\begin{enumerate}% |
| 3329 |
\setlength{\itemsep}{0pt}% |
| 3330 |
\setlength{\parskip}{0pt}% |
| 3331 |
\setlength{\parsep} {0pt}% |
| 3332 |
}% |
| 3333 |
{\end{enumerate}} |
| 3334 |
% |
| 3335 |
\newenvironment{compactdescription}% |
| 3336 |
{\begin{description}% |
| 3337 |
\setlength{\itemsep}{0pt}% |
| 3338 |
\setlength{\parskip}{0pt}% |
| 3339 |
\setlength{\parsep} {0pt}% |
| 3340 |
}% |
| 3341 |
{\end{description}} |
| 3342 |
% |
| 3343 |
% \end{macrocode} |
| 3344 |
% |
| 3345 |
% \subsection{Some fun with \texttt{verbatim}} |
| 3346 |
% |
| 3347 |
% The |plain| \TUB{} style allows \verb|[optional]| arguments to its |
| 3348 |
% \cs{verbatim} command. This will allow the author (or editor) to |
| 3349 |
% specify a range of exciting features; we would definitely like the |
| 3350 |
% numbered verbatim style for code (that facility is reserved for a |
| 3351 |
% future version of this package), and the present little bit of code |
| 3352 |
% imposes the \cs{ruled} option on the built-in \textsf{verbatim} |
| 3353 |
% environment. (Note that we don't yet deal with |
| 3354 |
% \textsf{verbatim}$*$, which is in itself an option to the |plain| |
| 3355 |
% original.) |
| 3356 |
% |
| 3357 |
% We start by saving various bits and bobs whose operation we're going |
| 3358 |
% to subvert. |
| 3359 |
% |
| 3360 |
% \begin{macrocode} |
| 3361 |
%\let\@TB@verbatim\@verbatim |
| 3362 |
\let\@TBverbatim\verbatim |
| 3363 |
\let\@TBendverbatim\endverbatim |
| 3364 |
% \end{macrocode} |
| 3365 |
% |
| 3366 |
% Impose an optional argument on the environment. |
| 3367 |
% |
| 3368 |
% We start the macro with \cs{par} to avoid a common error: if the |
| 3369 |
% optional argument is \cs{small}, and the document has no blank line |
| 3370 |
% before the verbatim block, we don't want that preceding paragraph to |
| 3371 |
% be set with \cs{small}'s line spacing. |
| 3372 |
% |
| 3373 |
% (\cs{obeylines} added to prevent the \cs{futurelet} from propagating |
| 3374 |
% into the body of the verbatim, thus causing lines that start with |
| 3375 |
% odd characters (like |#| or even |\|) to behave peculiarly.) |
| 3376 |
% \begin{macrocode} |
| 3377 |
\def\verbatim{\par\obeylines |
| 3378 |
\futurelet\reserved@a\@switch@sqbverbatim} |
| 3379 |
% |
| 3380 |
\def\@switch@sqbverbatim{\ifx\reserved@a[%] |
| 3381 |
\expandafter\@sqbverbatim\else |
| 3382 |
\def\reserved@b{\@sqbverbatim[]}\expandafter\reserved@b\fi} |
| 3383 |
% |
| 3384 |
\def\@sqbverbatim[#1]{% |
| 3385 |
% \end{macrocode} |
| 3386 |
% |
| 3387 |
% The optional argument consists entirely of functions that modify the |
| 3388 |
% appearance of the environment. Following the |plain| style, we |
| 3389 |
% define the functions we can execute in the optional argument here. |
| 3390 |
% |
| 3391 |
% The command \cs{ruled} tells us that there should be rules above and |
| 3392 |
% below the verbatim block. |
| 3393 |
% |
| 3394 |
% \begin{macrocode} |
| 3395 |
\def\ruled{\let\if@ruled\iftrue}% |
| 3396 |
% \end{macrocode} |
| 3397 |
% |
| 3398 |
% The command \cs{makevmeta} says to make !<...> do \meta{...}. |
| 3399 |
% |
| 3400 |
% \begin{macrocode} |
| 3401 |
\def\makevmeta{\makeescape\! \let\<\tubverb@meta \tubverb@clearliglist} |
| 3402 |
\def\tubverb@meta##1>{\meta{##1}} |
| 3403 |
% \end{macrocode} |
| 3404 |
% |
| 3405 |
% The default verbatim defines `'<>,- as active characters to |
| 3406 |
% stop ligatures; remove <> from the list so we get normal characters. |
| 3407 |
% Just hope that the CM <> ligatures aren't used. |
| 3408 |
% \begin{macrocode} |
| 3409 |
\def\tubverb@clearliglist{% |
| 3410 |
\def\verbatim@nolig@list{\do\`\do\,\do\'\do\-}% |
| 3411 |
} |
| 3412 |
% \end{macrocode} |
| 3413 |
% |
| 3414 |
% Then we execute the arguments we've got, and relay to a (hacked) |
| 3415 |
% copy of the \LaTeX\ verbatim environment. |
| 3416 |
% |
| 3417 |
% \begin{macrocode} |
| 3418 |
#1\@TBverbatim} |
| 3419 |
% \end{macrocode} |
| 3420 |
% |
| 3421 |
% The built-in environment itself relays to \cs{@verbatim}, which |
| 3422 |
% we've subverted to impose our views on appearance. |
| 3423 |
% |
| 3424 |
% \begin{macrocode} |
| 3425 |
\def\@verbatim{% |
| 3426 |
% \end{macrocode} |
| 3427 |
% |
| 3428 |
% First, we deal with \cs{ruled}: |
| 3429 |
% |
| 3430 |
% \begin{macrocode} |
| 3431 |
\if@ruled\trivlist\item\hrule\kern5\p@\nobreak\fi |
| 3432 |
% \end{macrocode} |
| 3433 |
% |
| 3434 |
% Now, the code out of the original \textsf{verbatim} environment: |
| 3435 |
% |
| 3436 |
% \begin{macrocode} |
| 3437 |
\trivlist \item\relax |
| 3438 |
\if@minipage\else\vskip\parskip\fi |
| 3439 |
\leftskip\@totalleftmargin\rightskip\z@skip |
| 3440 |
\parindent\z@\parfillskip\@flushglue\parskip\z@skip |
| 3441 |
\@@par |
| 3442 |
\@tempswafalse |
| 3443 |
\def\par{% |
| 3444 |
\if@tempswa |
| 3445 |
\leavevmode \null \@@par\penalty\interlinepenalty |
| 3446 |
\else |
| 3447 |
\@tempswatrue |
| 3448 |
\ifhmode\@@par\penalty\interlinepenalty\fi |
| 3449 |
\fi}% |
| 3450 |
\obeylines \verbatim@font \@noligs |
| 3451 |
\let\do\@makeother \dospecials |
| 3452 |
\everypar \expandafter{\the\everypar \unpenalty}% |
| 3453 |
}% end |\@sqbverbatim| |
| 3454 |
% \end{macrocode} |
| 3455 |
% |
| 3456 |
% To end the environment, we do everything in reverse order: relay via |
| 3457 |
% the copy we made of \cs{endverbatim}, and then finish off the option |
| 3458 |
% changes (again \cs{ruled} only, so far). |
| 3459 |
% |
| 3460 |
% \begin{macrocode} |
| 3461 |
\def\endverbatim{\@TBendverbatim |
| 3462 |
\if@ruled\kern5\p@\hrule\endtrivlist\fi} |
| 3463 |
% \end{macrocode} |
| 3464 |
% |
| 3465 |
% Define the \cs{if} used by the \cs{ruled} option: |
| 3466 |
% |
| 3467 |
% \begin{macrocode} |
| 3468 |
\let\if@ruled\iffalse |
| 3469 |
% \end{macrocode} |
| 3470 |
% |
| 3471 |
% Finally, if |microtype| is loaded, we want it to be deactivated in |
| 3472 |
% verbatim blocks. It often manipulates a leading |\| rather too much, |
| 3473 |
% thus messing with the visible fixed-width alignment. |
| 3474 |
% \begin{macrocode} |
| 3475 |
\AtBeginDocument{% |
| 3476 |
\@ifpackageloaded{microtype} |
| 3477 |
{\g@addto@macro\@verbatim{\microtypesetup{activate=false}}}{} |
| 3478 |
} |
| 3479 |
% \end{macrocode} |
| 3480 |
% |
| 3481 |
% \subsection{Bibliography} |
| 3482 |
% \label{sec:citations} |
| 3483 |
% This is more or less copied verbatim from Glenn Paulley's |
| 3484 |
% \emph{chicago.sty} (\texttt{gnpaulle@\penalty0 bluebox.\penalty0 |
| 3485 |
% uwaterloo.\penalty0 ca}). |
| 3486 |
% It produces an author-year citation style bibliography, using |
| 3487 |
% output from the \BibTeX\ style file based on that by |
| 3488 |
% Patrick Daly. It needs extra macros beyond those in standard |
| 3489 |
% \LaTeX\ to function properly. |
| 3490 |
% The form of the bibitem entries is: |
| 3491 |
% \begin{verbatim} |
| 3492 |
% \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith} |
| 3493 |
% {Jones et al.}{1990}{key}... |
| 3494 |
% \end{verbatim} |
| 3495 |
% The available citation commands are: |
| 3496 |
% |
| 3497 |
% \begin{tabular}{ll} |
| 3498 |
% \verb|\cite{key}| & $\rightarrow$ (Jones, Baker, and Smith 1990)\\ |
| 3499 |
% \verb|\citeA{key}| & $\rightarrow$ (Jones, Baker, and Smith)\\ |
| 3500 |
% \verb|\citeNP{key}| & $\rightarrow$ Jones, Baker, and Smith 1990\\ |
| 3501 |
% \verb|\citeANP{key}| & $\rightarrow$ Jones, Baker, and Smith\\ |
| 3502 |
% \verb|\citeN{key}| & $\rightarrow$ Jones, Baker, and Smith (1990)\\ |
| 3503 |
% \verb|\shortcite| & $\rightarrow$ (Jones et al.~1990)\\ |
| 3504 |
% \verb|\citeyear| & $\rightarrow$ (1990)\\ |
| 3505 |
% \verb|\citeyearNP| & $\rightarrow$ 1990\\ |
| 3506 |
% \end{tabular} |
| 3507 |
% |
| 3508 |
% First of all (after checking that we're to use Harvard citation at |
| 3509 |
% all), make a copy of \LaTeX's default citation mechanism. |
| 3510 |
% |
| 3511 |
% \begin{macrocode} |
| 3512 |
\if@Harvardcite |
| 3513 |
\let\@internalcite\cite |
| 3514 |
% \end{macrocode} |
| 3515 |
% Normal forms. |
| 3516 |
% \begin{macrocode} |
| 3517 |
\def\cite{\def\@citeseppen{-1000}% |
| 3518 |
\def\@cite##1##2{(##1\if@tempswa , ##2\fi)}% |
| 3519 |
\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite} |
| 3520 |
\def\citeNP{\def\@citeseppen{-1000}% |
| 3521 |
\def\@cite##1##2{##1\if@tempswa , ##2\fi}% |
| 3522 |
\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite} |
| 3523 |
\def\citeN{\def\@citeseppen{-1000}% |
| 3524 |
\def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}% |
| 3525 |
\def\citeauthoryear##1##2##3{##1 (##3}\@citedata} |
| 3526 |
\def\citeA{\def\@citeseppen{-1000}% |
| 3527 |
\def\@cite##1##2{(##1\if@tempswa , ##2\fi)}% |
| 3528 |
\def\citeauthoryear##1##2##3{##1}\@internalcite} |
| 3529 |
\def\citeANP{\def\@citeseppen{-1000}% |
| 3530 |
\def\@cite##1##2{##1\if@tempswa , ##2\fi}% |
| 3531 |
\def\citeauthoryear##1##2##3{##1}\@internalcite} |
| 3532 |
% \end{macrocode} |
| 3533 |
% Abbreviated forms (using \emph{et al.}) |
| 3534 |
% \begin{macrocode} |
| 3535 |
\def\shortcite{\def\@citeseppen{-1000}% |
| 3536 |
\def\@cite##1##2{(##1\if@tempswa , ##2\fi)}% |
| 3537 |
\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite} |
| 3538 |
\def\shortciteNP{\def\@citeseppen{-1000}% |
| 3539 |
\def\@cite##1##2{##1\if@tempswa , ##2\fi}% |
| 3540 |
\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite} |
| 3541 |
\def\shortciteN{\def\@citeseppen{-1000}% |
| 3542 |
\def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}% |
| 3543 |
\def\citeauthoryear##1##2##3{##2 (##3}\@citedata} |
| 3544 |
\def\shortciteA{\def\@citeseppen{-1000}% |
| 3545 |
\def\@cite##1##2{(##1\if@tempswa , ##2\fi)}% |
| 3546 |
\def\citeauthoryear##1##2##3{##2}\@internalcite} |
| 3547 |
\def\shortciteANP{\def\@citeseppen{-1000}% |
| 3548 |
\def\@cite##1##2{##1\if@tempswa , ##2\fi}% |
| 3549 |
\def\citeauthoryear##1##2##3{##2}\@internalcite} |
| 3550 |
% \end{macrocode} |
| 3551 |
% When just the year is needed: |
| 3552 |
% \begin{macrocode} |
| 3553 |
\def\citeyear{\def\@citeseppen{-1000}% |
| 3554 |
\def\@cite##1##2{(##1\if@tempswa , ##2\fi)}% |
| 3555 |
\def\citeauthoryear##1##2##3{##3}\@citedata} |
| 3556 |
\def\citeyearNP{\def\@citeseppen{-1000}% |
| 3557 |
\def\@cite##1##2{##1\if@tempswa , ##2\fi}% |
| 3558 |
\def\citeauthoryear##1##2##3{##3}\@citedata} |
| 3559 |
% \end{macrocode} |
| 3560 |
% Place commas in-between citations in the same |\citeyear|, |\citeyearNP|, |
| 3561 |
% |\citeN|, or |\shortciteN| command. |
| 3562 |
% Use something like |\citeN{ref1,ref2,ref3}| and |\citeN{ref4}| for a list. |
| 3563 |
% |
| 3564 |
% \begin{macrocode} |
| 3565 |
\def\@citedata{% |
| 3566 |
\@ifnextchar [{\@tempswatrue\@citedatax}% |
| 3567 |
{\@tempswafalse\@citedatax[]}% |
| 3568 |
} |
| 3569 |
|
| 3570 |
\def\@citedatax[#1]#2{% |
| 3571 |
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi% |
| 3572 |
\def\@citea{}\@cite{\@for\@citeb:=#2\do% |
| 3573 |
{\@citea\def\@citea{, }\@ifundefined% by Young |
| 3574 |
{b@\@citeb}{{\bf ?}% |
| 3575 |
\@warning{Citation `\@citeb' on page \thepage \space undefined}}% |
| 3576 |
{\csname b@\@citeb\endcsname}}}{#1}}% |
| 3577 |
% \end{macrocode} |
| 3578 |
% Don't box citations, separate with ; and a space; |
| 3579 |
% Make the penalty between citations negative: a good place to break. |
| 3580 |
% \begin{macrocode} |
| 3581 |
\def\@citex[#1]#2{% |
| 3582 |
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi% |
| 3583 |
\def\@citea{}\@cite{\@for\@citeb:=#2\do% |
| 3584 |
{\@citea\def\@citea{; }\@ifundefined% by Young |
| 3585 |
{b@\@citeb}{{\bf ?}% |
| 3586 |
\@warning{Citation `\@citeb' on page \thepage \space undefined}}% |
| 3587 |
{\csname b@\@citeb\endcsname}}}{#1}}% |
| 3588 |
% \end{macrocode} |
| 3589 |
% No labels in the bibliography. |
| 3590 |
% \begin{macrocode} |
| 3591 |
\def\@biblabel#1{} |
| 3592 |
% \end{macrocode} |
| 3593 |
% Set length of hanging indentation for bibliography entries. |
| 3594 |
% \begin{macrocode} |
| 3595 |
\newlength{\bibhang} |
| 3596 |
\setlength{\bibhang}{2em} |
| 3597 |
% \end{macrocode} |
| 3598 |
% Indent second and subsequent lines of bibliographic entries. Stolen |
| 3599 |
% from openbib.sty: |\newblock| is set to |{}|. |
| 3600 |
% \begin{macrocode} |
| 3601 |
\newdimen\bibindent |
| 3602 |
\bibindent=1.5em |
| 3603 |
\@ifundefined{refname}% |
| 3604 |
{\newcommand{\refname}{References}}% |
| 3605 |
{}% |
| 3606 |
% \end{macrocode} |
| 3607 |
% |
| 3608 |
% For safety's sake, suppress the \cs{TB@startsection} warnings |
| 3609 |
% here\dots |
| 3610 |
% |
| 3611 |
% \begin{macrocode} |
| 3612 |
\def\thebibliography#1{% for harvardcite |
| 3613 |
\let\TB@startsection\TB@safe@startsection |
| 3614 |
\section*{\refname |
| 3615 |
\@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}% |
| 3616 |
\list{[\arabic{enumi}]}{% |
| 3617 |
\labelwidth\z@ \labelsep\z@ |
| 3618 |
\leftmargin\bibindent |
| 3619 |
\itemindent -\bibindent |
| 3620 |
\listparindent \itemindent |
| 3621 |
\parsep \z@ |
| 3622 |
\usecounter{enumi}}% |
| 3623 |
\def\newblock{}% |
| 3624 |
\BibJustification |
| 3625 |
\frenchspacing % more than just period, see comments below |
| 3626 |
} |
| 3627 |
% \end{macrocode} |
| 3628 |
% |
| 3629 |
% \begin{macro}{etal} |
| 3630 |
% \begin{macro}{\bibentry} |
| 3631 |
% Other bibliography odds and ends. |
| 3632 |
% \begin{macrocode} |
| 3633 |
\def\etal{et\,al.\@} |
| 3634 |
\def\bibentry{% |
| 3635 |
\smallskip |
| 3636 |
\hangindent=\parindent |
| 3637 |
\hangafter=1 |
| 3638 |
\noindent |
| 3639 |
\sloppy |
| 3640 |
\clubpenalty500 \widowpenalty500 |
| 3641 |
\frenchspacing |
| 3642 |
} |
| 3643 |
% \end{macrocode} |
| 3644 |
% \end{macro} |
| 3645 |
% \end{macro} |
| 3646 |
% |
| 3647 |
% \begin{macro}{\bibliography} |
| 3648 |
% \begin{macro}{\bibliographystyle} |
| 3649 |
% Changes made to accommodate TUB file naming conventions |
| 3650 |
% \begin{macrocode} |
| 3651 |
\def\bibliography#1{% |
| 3652 |
\if@filesw |
| 3653 |
\immediate\write\@auxout{\string\bibdata{\@tubfilename{#1}}}% |
| 3654 |
\fi |
| 3655 |
\@input{\jobname.bbl}% |
| 3656 |
} |
| 3657 |
\def\bibliographystyle#1{% |
| 3658 |
\if@filesw |
| 3659 |
\immediate\write\@auxout{\string\bibstyle{\@tubfilename{#1}}}% |
| 3660 |
\fi |
| 3661 |
} |
| 3662 |
% \end{macrocode} |
| 3663 |
% \end{macro} |
| 3664 |
% \end{macro} |
| 3665 |
% |
| 3666 |
% \begin{macro}{\thebibliography} |
| 3667 |
% \begin{macro}{\TB@@thebibliography} |
| 3668 |
% If the user has asked to use \LaTeX's default citation mechanism |
| 3669 |
% (using the |rawcite| option), we still need to |
| 3670 |
% patch \cs{sloppy} to support justification of the body of the |
| 3671 |
% bibliography. We kludge in a call to \cs{frenchspacing} too, |
| 3672 |
% since there is no reason to change only period's \cs{sfcode}, as |
| 3673 |
% \LaTeX's original |thebibliography| (in |classes.dtx|) does. |
| 3674 |
% |
| 3675 |
% By the way, |amsgen.sty| changes \cs{frenchspacing} to set the |
| 3676 |
% \cs{sfcode} of punctuation character to successively decreasing |
| 3677 |
% integers ending at 1001 for comma. Thus its 1006 for period is |
| 3678 |
% overwritten to 1000 for |thebibliography|, making |amsgen|'s |
| 3679 |
% \cs{@addpunct} ineffective. Don't know what that means in practice, |
| 3680 |
% if anything. |
| 3681 |
% |
| 3682 |
% Back here, we also play with \TB@startsection since we always have, |
| 3683 |
% though that is no longer needed. |
| 3684 |
% \begin{macrocode} |
| 3685 |
\else % not harvardcite |
| 3686 |
\let\TB@origthebibliography\thebibliography |
| 3687 |
\def\thebibliography{% |
| 3688 |
\let\TB@startsection\TB@safe@startsection |
| 3689 |
\def\sloppy{\frenchspacing\BibJustification}% |
| 3690 |
\TB@origthebibliography} % latex's thebibliography now reads args. |
| 3691 |
\fi % not harvardcite |
| 3692 |
% \end{macrocode} |
| 3693 |
% \end{macro} |
| 3694 |
% \end{macro} |
| 3695 |
% |
| 3696 |
% \begin{macro}{\BibJustification} |
| 3697 |
% \begin{macro}{\SetBibJustification} |
| 3698 |
% \begin{macro}{\TB@@sloppy} |
| 3699 |
% \cs{BibJustification} defines how the bibliography is to be |
| 3700 |
% justified. The Lamport default is ``\cs{sloppy}'', but we |
| 3701 |
% find some sort of ragged right setting is almost always preferred, |
| 3702 |
% so (as of 2025) make that the default. |
| 3703 |
% (\cs{BibJustification} is nevertheless reset to its default value at |
| 3704 |
% the start of a paper.) |
| 3705 |
% \begin{macrocode} |
| 3706 |
\let\TB@@sloppy\sloppy |
| 3707 |
\let\BibJustification\raggedright |
| 3708 |
\newcommand{\SetBibJustification}[1]{% |
| 3709 |
\renewcommand{\BibJustification}{#1}% |
| 3710 |
} |
| 3711 |
\ResetCommands\expandafter{\the\ResetCommands |
| 3712 |
\let\BibJustification\TB@@sloppy |
| 3713 |
} |
| 3714 |
% \end{macrocode} |
| 3715 |
% \end{macro} |
| 3716 |
% \end{macro} |
| 3717 |
% \end{macro} |
| 3718 |
% |
| 3719 |
% \subsection{Registration marks} |
| 3720 |
% |
| 3721 |
% We no longer use these since Cadmus does not want them. |
| 3722 |
% \begin{macrocode} |
| 3723 |
\def\HorzR@gisterRule{\vrule \@height 0.2\p@ \@depth\z@ \@width 0.5in } |
| 3724 |
\def\DownShortR@gisterRule{\vrule \@height 0.2\p@ \@depth 1pc \@width 0.2\p@ } |
| 3725 |
\def\UpShortR@gisterRule{\vrule \@height 1pc \@depth\z@ \@width 0.2\p@ } |
| 3726 |
% \end{macrocode} |
| 3727 |
% |
| 3728 |
% ``T'' marks centered on top and bottom edges of paper |
| 3729 |
% |
| 3730 |
% \begin{macrocode} |
| 3731 |
\def\ttopregister{\dlap{% |
| 3732 |
\hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule |
| 3733 |
\HorzR@gisterRule \hfil \HorzR@gisterRule}% |
| 3734 |
\hb@xt@\trimwd{\hfil \DownShortR@gisterRule \hfil}}} |
| 3735 |
\def\tbotregister{\ulap{% |
| 3736 |
\hb@xt@\trimwd{\hfil \UpShortR@gisterRule \hfil}% |
| 3737 |
\hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule |
| 3738 |
\HorzR@gisterRule \hfil \HorzR@gisterRule}}} |
| 3739 |
\def\topregister{\ttopregister} |
| 3740 |
\def\botregister{\tbotregister} |
| 3741 |
% \end{macrocode} |
| 3742 |
% |
| 3743 |
% \subsection{Running headers and footers} |
| 3744 |
% |
| 3745 |
% \begin{macrocode} |
| 3746 |
\def\rtitlex{\def\texttub##1{{\normalsize\textrm{##1}}}\TUB, \volx} |
| 3747 |
% \end{macrocode} |
| 3748 |
% registration marks; these are temporarily inserted in the running head |
| 3749 |
% \begin{macrocode} |
| 3750 |
\def\MakeRegistrationMarks{} |
| 3751 |
\def\UseTrimMarks{% |
| 3752 |
\def\MakeRegistrationMarks{% |
| 3753 |
\ulap{\rlap{% |
| 3754 |
\vbox{\dlap{\vbox to\trimlgt{\vfil\botregister}}% |
| 3755 |
\topregister\vskip \headmargin \vskip 10\p@}}}}% |
| 3756 |
} |
| 3757 |
% put issue identification and page number in header. |
| 3758 |
\def\@oddhead{\MakeRegistrationMarks |
| 3759 |
\frenchspacing |
| 3760 |
\normalsize\csname normalshape\endcsname\rm \tubheadhook |
| 3761 |
\rtitlex\qquad \midrtitle\hfil |
| 3762 |
\rtitlenexttopage\quad\tubtypesetpageno{\thepage}} |
| 3763 |
\def\@evenhead{\MakeRegistrationMarks |
| 3764 |
\frenchspacing |
| 3765 |
\normalsize\csname normalshape\endcsname\rm \tubheadhook |
| 3766 |
\tubtypesetpageno{\thepage}\quad\rtitlenexttopage |
| 3767 |
\hfil\midrtitle \qquad\rtitlex} |
| 3768 |
|
| 3769 |
% Put a ? into the page number in the headers in all but a final run, so |
| 3770 |
% people aren't tempted to cite it. |
| 3771 |
% |
| 3772 |
\newcommand{\tubtypesetpageno}[1]{% |
| 3773 |
\ifnum #1>900 |
| 3774 |
% in CM, numerals are exactly .5em. |
| 3775 |
% |
| 3776 |
% The \texorpdfstring avoids the usual hyperref warning: |
| 3777 |
% Token not allowed in a PDF string ... removing `\@ifnextchar' |
| 3778 |
\texorpdfstring{\makebox[.5em][l]{\small ?}}{?}% |
| 3779 |
% |
| 3780 |
\textsl{\@arabic{\numexpr#1-900\relax}}% assuming e-tex |
| 3781 |
\else |
| 3782 |
\@arabic{#1}% |
| 3783 |
\fi |
| 3784 |
} |
| 3785 |
% |
| 3786 |
% The above changes the page number in the headers and tocs. It does not |
| 3787 |
% change the page number in cross-references, which will still show up |
| 3788 |
% as `901' instead of `?1'. In order to do that, we'd have to redefine |
| 3789 |
% |\thepage| (https://tex.stackexchange.com/questions/687258). |
| 3790 |
% |
| 3791 |
% The problem is that |\thepage| is not expected to contain typesetting |
| 3792 |
% commands like |\makebox| and |\textsl|, but to expand to the simple |
| 3793 |
% page number (in whatever form). For example, when redefining |
| 3794 |
% |\thepage| to the above, terminal warnings then look like: |
| 3795 |
% |LaTeX Warning: Citation `foo' on page \makebox [.5em][l]{...| |
| 3796 |
% losing the actual page number. |
| 3797 |
% |
| 3798 |
% So apparently there is no way to add the ? correctly in all contexts. |
| 3799 |
% |
| 3800 |
% BTW, such a custom page number format would also break makeindex, |
| 3801 |
% etc., but for that we could provide the information. Per Ulrike: |
| 3802 |
%\usepackage{index} |
| 3803 |
%\newcommand\specialthepage{\inteval{\value{page}-900}} |
| 3804 |
%\newindex[specialthepage]*{default}{idx}{ind}{Index} |
| 3805 |
|
| 3806 |
% can be used to reset the font, e.g., tb98kuester. |
| 3807 |
\def\tubheadhook{} |
| 3808 |
|
| 3809 |
% in case the official \author is too verbose for the footline. |
| 3810 |
% (the \shortauthor / \rhAuthor stuff is only enabled for proceedings, fix!) |
| 3811 |
\def\tubrunningauthor{\@author} |
| 3812 |
|
| 3813 |
% put title and author in footer. |
| 3814 |
\def\@tubrunningfull{% |
| 3815 |
\def\@oddfoot{% make line break commands produce a normal space |
| 3816 |
\def\\{\unskip\ \ignorespaces}% |
| 3817 |
\let\newline=\\% |
| 3818 |
\tubtypesetdoi |
| 3819 |
\frenchspacing\hfil\rhTitle} |
| 3820 |
\def\@evenfoot{% |
| 3821 |
\let\thanks\@gobble |
| 3822 |
\tubtypesetdoi |
| 3823 |
\frenchspacing\tubrunningauthor\hfil} |
| 3824 |
} |
| 3825 |
|
| 3826 |
% empty footer. |
| 3827 |
\def\@tubrunningminimal{% |
| 3828 |
\def\@oddfoot{\tubtypesetdoi\hfil}% |
| 3829 |
\def\@evenfoot{\tubtypesetdoi\hfil}% |
| 3830 |
} |
| 3831 |
|
| 3832 |
% empty footer and header. |
| 3833 |
\def\@tubrunningoff{% |
| 3834 |
\@tubrunningminimal |
| 3835 |
\def\@oddhead{\hfil}% |
| 3836 |
\def\@evenhead{\hfil}% |
| 3837 |
} |
| 3838 |
|
| 3839 |
\def\ps@headings{} |
| 3840 |
\pagestyle{headings} |
| 3841 |
% \end{macrocode} |
| 3842 |
% |
| 3843 |
% Typeset the doi. The format we decided on looks like: |
| 3844 |
% \texttt{https://doi.org/10.47397/tb/41-3/tb129mansour-nonlatin} |
| 3845 |
% where the last element is the |\jobname|. |
| 3846 |
% |
| 3847 |
% We put this below the footline. The footer definitions above specify |
| 3848 |
% that it is always called, even if the regular footer is empty. |
| 3849 |
% |
| 3850 |
% If the article started in the second column (option [secondcolstart]), |
| 3851 |
% we manually move the doi over. |
| 3852 |
% |
| 3853 |
% We do not check for validity of |\volno|, |\issno|, |\jobname|. For |
| 3854 |
% testing, etc., seems simpler to just typeset what we've got. Other |
| 3855 |
% scripts will verify consistency. |
| 3856 |
% |
| 3857 |
% \begin{macrocode} |
| 3858 |
% |
| 3859 |
\def\tubdoiprefix{10.47397/tb} % the number crossref assigned us |
| 3860 |
\def\tubabovedoi{} % fudge spacing or whatever. |
| 3861 |
% |
| 3862 |
\def\tubtypesetdoi{% |
| 3863 |
\iftubomitdoioption\else % do if not explicit omission ... |
| 3864 |
\ifnum\volno>0 % and if being run for production ... |
| 3865 |
\iftubfinaloption % and if [final], even if pageno>900 |
| 3866 |
\vbox to 0pt{% don't impact normal layout |
| 3867 |
\edef\thedoi{% but make url invalid if >900 |
| 3868 |
\ifnum\count0>900 example.org% |
| 3869 |
\else doi.org\fi |
| 3870 |
/\tubdoiprefix/\volno-\issno/\jobname}% |
| 3871 |
\scriptsize |
| 3872 |
\vskip\baselineskip |
| 3873 |
\tubabovedoi |
| 3874 |
\iftubsecondcolstart \moveright \tubcolwidthandgutter \fi |
| 3875 |
\rlap{\expandafter\tbsurl\expandafter{\thedoi}}% |
| 3876 |
\vss |
| 3877 |
}% |
| 3878 |
\fi % tubfinaloption |
| 3879 |
\fi % volno>0 |
| 3880 |
\fi % !tubomitdoioption |
| 3881 |
\global\let\tubtypesetdoi\@empty % only do it once, no matter what. |
| 3882 |
} |
| 3883 |
% |
| 3884 |
% |
| 3885 |
% \end{macrocode} |
| 3886 |
% |
| 3887 |
% |
| 3888 |
% \subsection{Output routine} |
| 3889 |
% Modified to alter |\brokenpenalty| across columns |
| 3890 |
% |
| 3891 |
% \begin{description} |
| 3892 |
% \item[\emph{Comment}] We're playing with fire here: for example, |
| 3893 |
% \cs{@outputdblcol} has changed in \LaTeXe{} for 1995/06/01 (with the |
| 3894 |
% use of \cs{hb@xt@}). \emph{This} time there's no semantic change, |
| 3895 |
% but\dots |
| 3896 |
% \end{description} |
| 3897 |
% \begin{macrocode} |
| 3898 |
\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse |
| 3899 |
\global\setbox\@leftcolumn\box\@outputbox |
| 3900 |
\global\brokenpenalty10000 |
| 3901 |
\else \global\@firstcolumntrue |
| 3902 |
\global\brokenpenalty100 |
| 3903 |
\setbox\@outputbox\vbox{\hb@xt@\textwidth{\hb@xt@\columnwidth |
| 3904 |
{\box\@leftcolumn \hfil}\hfil \vrule \@width\columnseprule\hfil |
| 3905 |
\hb@xt@\columnwidth{\box\@outputbox \hfil}}}\@combinedblfloats |
| 3906 |
\@outputpage \begingroup \@dblfloatplacement \@startdblcolumn |
| 3907 |
\@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup |
| 3908 |
\fi} |
| 3909 |
% \end{macrocode} |
| 3910 |
% |
| 3911 |
% \subsection{Font-related definitions and machinery} |
| 3912 |
% These are mostly for compatibility with plain |tugboat.sty| |
| 3913 |
% \begin{macrocode} |
| 3914 |
\newif\ifFirstPar \FirstParfalse |
| 3915 |
\def\smc{\sc} |
| 3916 |
\def\ninepoint{\small} |
| 3917 |
%</classtail> |
| 3918 |
% \end{macrocode} |
| 3919 |
% |
| 3920 |
% \cs{SMC} \emph{isn't} small caps---Barbara Beeton says she thinks |
| 3921 |
% of it as ``big small caps''. She says (modulo capitalisation of |
| 3922 |
% things\dots): |
| 3923 |
% \begin{quote} |
| 3924 |
% For the things it's used for, regular small caps are not |
| 3925 |
% appropriate---they're too small. Real small caps are |
| 3926 |
% appropriate for author names (and are so used in continental |
| 3927 |
% bibliographies), section headings, running heads, and, on |
| 3928 |
% occasion, words to which some emphasis is to be given. \cs{SMC} |
| 3929 |
% was designed to be used for acronyms and all-caps abbreviations, |
| 3930 |
% which look terrible in small caps, but nearly as bad in all caps |
| 3931 |
% in the regular text size. The principle of using ``one size |
| 3932 |
% smaller'' than the text size is similar to the design of caps in |
| 3933 |
% German---where they are smaller relative to lowercase than are |
| 3934 |
% caps in fonts intended for English, to improve the appearance of |
| 3935 |
% regular text in which caps are used at the heads of all nouns, not |
| 3936 |
% just at the beginnings of sentences. |
| 3937 |
% \end{quote} |
| 3938 |
% |
| 3939 |
% We define this in terms of the memory of the size currently selected |
| 3940 |
% that's maintained in \cs{@currsize}: if the user does something |
| 3941 |
% silly re.~selecting fonts, we'll get the wrong results. The |
| 3942 |
% following code is adapted from an old version of |relsize.sty| by |
| 3943 |
% Donald Arseneau and Matt Swift. The order of examination of |
| 3944 |
% \cs{@currsize} is to do the most common cases first. |
| 3945 |
% |
| 3946 |
% This is (I think) not a robust command since it's a conditional. |
| 3947 |
% https://tex.stackexchange.com/questions/4736 |
| 3948 |
% \begin{macrocode} |
| 3949 |
%<*common> |
| 3950 |
\newcommand{\SMC}{% |
| 3951 |
\ifx\@currsize\normalsize\small\else |
| 3952 |
\ifx\@currsize\small\footnotesize\else |
| 3953 |
\ifx\@currsize\footnotesize\scriptsize\else |
| 3954 |
\ifx\@currsize\large\normalsize\else |
| 3955 |
\ifx\@currsize\Large\large\else |
| 3956 |
\ifx\@currsize\LARGE\Large\else |
| 3957 |
\ifx\@currsize\scriptsize\tiny\else |
| 3958 |
\ifx\@currsize\tiny\tiny\else |
| 3959 |
\ifx\@currsize\huge\LARGE\else |
| 3960 |
\ifx\@currsize\Huge\huge\else |
| 3961 |
\small\SMC@unknown@warning |
| 3962 |
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi |
| 3963 |
} |
| 3964 |
\newcommand{\SMC@unknown@warning}{\TBWarning{\string\SMC: nonstandard |
| 3965 |
text font size command -- using \string\small}} |
| 3966 |
\newcommand{\textSMC}[1]{{\SMC #1}} |
| 3967 |
% \end{macrocode} |
| 3968 |
% |
| 3969 |
% The \cs{acro} command uses \cs{SMC} as it was originally intended. |
| 3970 |
% Since the argument never contains lowercase letters (except in error), |
| 3971 |
% it resets the spacefactor to 1000 after inserting the text. |
| 3972 |
% |
| 3973 |
% \begin{macrocode} |
| 3974 |
\newcommand{\acro}[1]{\textSMC{#1}\@} |
| 3975 |
%</common> |
| 3976 |
% \end{macrocode} |
| 3977 |
% |
| 3978 |
% \subsection{Editor's notes and other footnotes} |
| 3979 |
% |
| 3980 |
% \cs{EdNote} allows the editor to enter notes in the text of a paper. |
| 3981 |
% If the command is given something that appears like an optional |
| 3982 |
% argument, the entire text of the note is placed in square brackets. |
| 3983 |
% (Yes, it really is!) |
| 3984 |
% |
| 3985 |
% \begin{macrocode} |
| 3986 |
%<*classtail> |
| 3987 |
\def\xEdNote{{\EdNoteFont Editor's note:\enspace }} |
| 3988 |
\def\EdNote{\@ifnextchar[%] |
| 3989 |
{% |
| 3990 |
\ifvmode |
| 3991 |
\smallskip\noindent\let\@EdNote@\@EdNote@v |
| 3992 |
\else |
| 3993 |
\unskip\quad\def\@EdNote@{\unskip\quad}% |
| 3994 |
\fi |
| 3995 |
\@EdNote |
| 3996 |
}% |
| 3997 |
\xEdNote |
| 3998 |
} |
| 3999 |
\long\def\@EdNote[#1]{% |
| 4000 |
[\thinspace\xEdNote\ignorespaces |
| 4001 |
#1% |
| 4002 |
\unskip\thinspace]% |
| 4003 |
\@EdNote@ |
| 4004 |
} |
| 4005 |
\def\@EdNote@v{\par\smallskip} |
| 4006 |
% \end{macrocode} |
| 4007 |
% Macros for Mittelbach's self-documenting style |
| 4008 |
% \begin{macrocode} |
| 4009 |
\def\SelfDocumenting{% |
| 4010 |
\setlength\textwidth{31pc} |
| 4011 |
\onecolumn |
| 4012 |
\parindent \z@ |
| 4013 |
\parskip 2\p@\@plus\p@\@minus\p@ |
| 4014 |
\oddsidemargin 8pc |
| 4015 |
\evensidemargin 8pc |
| 4016 |
\marginparwidth 8pc |
| 4017 |
\toks@\expandafter{\@oddhead}% |
| 4018 |
\xdef\@oddhead{\hss\hb@xt@\pagewd{\the\toks@}}% |
| 4019 |
\toks@\expandafter{\@evenhead}% |
| 4020 |
\xdef\@evenhead{\hss\hb@xt@\pagewd{\the\toks@}}% |
| 4021 |
\def\ps@titlepage{}% |
| 4022 |
} |
| 4023 |
\def\ps@titlepage{} |
| 4024 |
|
| 4025 |
% let's have a little space after the footnote marker. |
| 4026 |
% also a little more space for the marker itself. |
| 4027 |
\long\def\@makefntext#1{% |
| 4028 |
\parindent 1em |
| 4029 |
\noindent |
| 4030 |
\hb@xt@2em{}% |
| 4031 |
\llap{\@makefnmark}\null |
| 4032 |
$\mskip5mu$% space after marker |
| 4033 |
#1% footnote text |
| 4034 |
} |
| 4035 |
% |
| 4036 |
% For comparison, here is the original definition from classes.dtx: |
| 4037 |
% \long\def\@makefntext#1{% |
| 4038 |
% \parindent 1em |
| 4039 |
% \noindent |
| 4040 |
% \hb@xt@2em{\hss\@makefnmark}#1} |
| 4041 |
|
| 4042 |
% \end{macrocode} |
| 4043 |
% |
| 4044 |
% \begin{macro}{\tubraggedfoot} |
| 4045 |
% To get a ragged-right footnote. |
| 4046 |
% \begin{macrocode} |
| 4047 |
\newcommand{\tubraggedfoot}{\rightskip=\raggedskip plus\raggedstretch\relax} |
| 4048 |
% \end{macrocode} |
| 4049 |
% \end{macro} |
| 4050 |
% |
| 4051 |
% \begin{macro}{\creditfootnote} |
| 4052 |
% \begin{macro}{\supportfootnote} |
| 4053 |
% Sometimes we want the label ``Editor's Note:'', sometimes not. |
| 4054 |
% |
| 4055 |
% \begin{macrocode} |
| 4056 |
\def\creditfootnote{\nomarkfootnote\xEdNote} |
| 4057 |
\def\supportfootnote{\nomarkfootnote\relax} |
| 4058 |
% \end{macrocode} |
| 4059 |
% |
| 4060 |
% General macro \cs{nomarkfootnote} to make a footnote without a |
| 4061 |
% reference mark, etc. |#1| is an extra command to insert, |#2| the |
| 4062 |
% user's text. |
| 4063 |
% \begin{macrocode} |
| 4064 |
\gdef\nomarkfootnote#1#2{\begingroup |
| 4065 |
\def\thefootnote{}% |
| 4066 |
% no period, please, also no fnmark. Also no hyperref warning. |
| 4067 |
\def\@makefntext##1{##1}% |
| 4068 |
\def\Hy@Warning##1{}% |
| 4069 |
\footnotetext{\noindent #1#2}% |
| 4070 |
\endgroup} |
| 4071 |
% \end{macrocode} |
| 4072 |
% \end{macro} |
| 4073 |
% \end{macro} |
| 4074 |
% |
| 4075 |
% |
| 4076 |
% \subsection{Initialization} |
| 4077 |
% |
| 4078 |
% If we're going to use Harvard-style bibliographies, we set up the |
| 4079 |
% bibliography style: the user doesn't get any choice. (Not recommended.) |
| 4080 |
% |
| 4081 |
% \begin{macrocode} |
| 4082 |
\if@Harvardcite |
| 4083 |
\AtBeginDocument{% |
| 4084 |
\bibliographystyle{ltugbib}% |
| 4085 |
} |
| 4086 |
\fi |
| 4087 |
\authornumber\z@ |
| 4088 |
\let\@signature\@defaultsignature |
| 4089 |
\InputIfFileExists{ltugboat.cfg} |
| 4090 |
{\TBInfo{Loading ltugboat.cfg configuration information}} |
| 4091 |
{} |
| 4092 |
%</classtail> |
| 4093 |
% \end{macrocode} |
| 4094 |
% |
| 4095 |
% \section{\protect\LaTeXe\ proceedings class (no longer used)} |
| 4096 |
% |
| 4097 |
% \begin{macro}{\@tugclass} |
| 4098 |
% Make the code of |ltugboat.cls| (when we load it) say it's really |
| 4099 |
% us: |
| 4100 |
% |
| 4101 |
% \begin{macrocode} |
| 4102 |
%<*ltugproccls> |
| 4103 |
\def\@tugclass{ltugproc} |
| 4104 |
% \end{macrocode} |
| 4105 |
% \end{macro} |
| 4106 |
% |
| 4107 |
% \begin{macro}{\if@proc@sober} |
| 4108 |
% \begin{macro}{\if@proc@numerable} |
| 4109 |
% ^^A\acro |
| 4110 |
% {TUG}'96 proceedings switched to more sober headings still; so |
| 4111 |
% the \textsf{tug95} option establishes the original state. In the |
| 4112 |
% absence of any other guidance, we use the '96 for |
| 4113 |
% ^^A\acro |
| 4114 |
% {TUG}'97 proceedings, but also allow numbering of sections. |
| 4115 |
% |
| 4116 |
% \begin{macrocode} |
| 4117 |
\newif\if@proc@sober |
| 4118 |
\newif\if@proc@numerable |
| 4119 |
\DeclareOption{tug95}{% |
| 4120 |
\@proc@soberfalse |
| 4121 |
\@proc@numerablefalse |
| 4122 |
} |
| 4123 |
\DeclareOption{tug96}{% |
| 4124 |
\@proc@sobertrue |
| 4125 |
\@proc@numerablefalse |
| 4126 |
} |
| 4127 |
\DeclareOption{tug97}{% |
| 4128 |
\@proc@sobertrue |
| 4129 |
\@proc@numerabletrue |
| 4130 |
} |
| 4131 |
\DeclareOption{tug2002}{% |
| 4132 |
\@proc@sobertrue |
| 4133 |
\@proc@numerabletrue |
| 4134 |
\let\if@proc@numbersec\iftrue |
| 4135 |
\PassOptionsToClass{numbersec}{ltugboat}% |
| 4136 |
} |
| 4137 |
% \end{macrocode} |
| 4138 |
% \end{macro} |
| 4139 |
% \end{macro} |
| 4140 |
% |
| 4141 |
% \begin{macro}{\if@proc@numbersec} |
| 4142 |
% If we're in a class that allows section numbering (the actual check |
| 4143 |
% occurs after \cs{ProcessOptions}, we can have the |
| 4144 |
% following: |
| 4145 |
% \begin{macrocode} |
| 4146 |
\DeclareOption{numbersec}{\let\if@proc@numbersec\iftrue |
| 4147 |
\PassOptionsToClass{numbersec}{ltugboat}% |
| 4148 |
} |
| 4149 |
\DeclareOption{nonumber}{\let\if@proc@numbersec\iffalse |
| 4150 |
\PassOptionsToClass{nonumber}{ltugboat}% |
| 4151 |
} |
| 4152 |
% \end{macrocode} |
| 4153 |
% \end{macro} |
| 4154 |
% |
| 4155 |
% \begin{macro}{\ifTB@title} |
| 4156 |
% If we have a paper for which we want to create a detached title, |
| 4157 |
% with an editor's note, and then set the paper separately, we use |
| 4158 |
% option notitle. |
| 4159 |
% \begin{macrocode} |
| 4160 |
\newif\ifTB@title |
| 4161 |
\DeclareOption{title}{\TB@titletrue} |
| 4162 |
\DeclareOption{notitle}{\TB@titlefalse |
| 4163 |
\AtBeginDocument{\stepcounter{page}}} |
| 4164 |
% \end{macrocode} |
| 4165 |
% \end{macro} |
| 4166 |
% |
| 4167 |
% There are these people who seem to think |tugproc| is an option as |
| 4168 |
% well as a class\dots |
| 4169 |
% |
| 4170 |
% \begin{macrocode} |
| 4171 |
\DeclareOption{tugproc}{% |
| 4172 |
\ClassWarning{\@tugclass}{Option \CurrentOption\space ignored}% |
| 4173 |
} |
| 4174 |
% \end{macrocode} |
| 4175 |
% |
| 4176 |
% All other options are simply passed to |ltugboat|\dots |
| 4177 |
% |
| 4178 |
% \begin{macrocode} |
| 4179 |
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ltugboat}} |
| 4180 |
% \end{macrocode} |
| 4181 |
% |
| 4182 |
% If there's a \textsf{tugproc} defaults file, input it now: it may |
| 4183 |
% tell us which year we're to perform for\dots (Note: this code |
| 4184 |
% \emph{is} millenium-proof. It's not terribly classy for years |
| 4185 |
% beyond 2069, but then I'm not going to be around then---this will be |
| 4186 |
% an interesting task for a future \TeX{}ie\dots) |
| 4187 |
% |
| 4188 |
% \begin{macrocode} |
| 4189 |
\InputIfFileExists{\@tugclass.cfg}{\ClassInfo{ltugproc}% |
| 4190 |
{Loading ltugproc.cfg configuration information}}{} |
| 4191 |
\@ifundefined{TUGprocExtraOptions}% |
| 4192 |
{\let\TUGprocExtraOptions\@empty}% |
| 4193 |
{\edef\TUGprocExtraOptions{,\TUGprocExtraOptions}} |
| 4194 |
% \end{macrocode} |
| 4195 |
% |
| 4196 |
% \begin{macro}{\tugProcYear} |
| 4197 |
% Now work out what year it is |
| 4198 |
% \begin{macrocode} |
| 4199 |
\@tempcnta\year |
| 4200 |
\ifnum\@tempcnta<2000 |
| 4201 |
\divide\@tempcnta by100 |
| 4202 |
\multiply\@tempcnta by100 |
| 4203 |
\advance\@tempcnta-\year |
| 4204 |
\@tempcnta-\@tempcnta |
| 4205 |
\fi |
| 4206 |
% \end{macrocode} |
| 4207 |
% |
| 4208 |
% And use that for calculating a year for us to use. |
| 4209 |
% |
| 4210 |
% \begin{macrocode} |
| 4211 |
\edef\@tempa{\noexpand\providecommand\noexpand\tugProcYear |
| 4212 |
{\ifnum10>\@tempcnta0\fi\the\@tempcnta}} |
| 4213 |
\@tempa |
| 4214 |
\ClassInfo{ltugproc}{Class believes year is |
| 4215 |
\expandafter\ifnum\tugProcYear<2000 19\fi\tugProcYear |
| 4216 |
\@gobble} |
| 4217 |
% \end{macrocode} |
| 4218 |
% |
| 4219 |
% Check that this is a ``sensible year'' (one for which we have a |
| 4220 |
% class option defined). If not, make it a `suitable' year, in |
| 4221 |
% particular, one that allows numbering sections. |
| 4222 |
% \begin{macrocode} |
| 4223 |
\expandafter\ifx\csname ds@tug\tugProcYear\endcsname\relax |
| 4224 |
\def\tugProcYear{2002}\fi |
| 4225 |
% \end{macrocode} |
| 4226 |
% \end{macro} |
| 4227 |
% |
| 4228 |
% Now execute the default `year' option and get on with processing. |
| 4229 |
% Note that this command gets ignored if the configuration file |
| 4230 |
% specifies a silly year. |
| 4231 |
% |
| 4232 |
% \begin{macrocode} |
| 4233 |
\ExecuteOptions{tug\tugProcYear,title\TUGprocExtraOptions} |
| 4234 |
\ProcessOptions |
| 4235 |
\if@proc@numbersec |
| 4236 |
\if@proc@numerable |
| 4237 |
\else |
| 4238 |
\ClassWarning{\@tugclass}{This year's proceedings may not have |
| 4239 |
numbered sections}% |
| 4240 |
\fi |
| 4241 |
\fi |
| 4242 |
% \end{macrocode} |
| 4243 |
% |
| 4244 |
% Call \textsf{ltugboat}, adding whichever section numbering option is |
| 4245 |
% appropriate |
| 4246 |
% \begin{macrocode} |
| 4247 |
\LoadClass[\if@proc@numbersec numbersec\else nonumber\fi]{ltugboat} |
| 4248 |
% \end{macrocode} |
| 4249 |
% |
| 4250 |
% \subsection{Proceedings titles} |
| 4251 |
% |
| 4252 |
% \begin{macro}{\maketitle} |
| 4253 |
% \begin{macro}{\ifTB@madetitle} |
| 4254 |
% There's no provision for `section titles' in proceedings issues, as |
| 4255 |
% there are in \TUB{} proper. Note the tedious \LaTeX{} bug-avoidance |
| 4256 |
% in the \cs{@TB@test@document} macro. |
| 4257 |
% |
| 4258 |
% \begin{macrocode} |
| 4259 |
\def\maketitle{% |
| 4260 |
\begingroup |
| 4261 |
% \end{macrocode} |
| 4262 |
% |
| 4263 |
% first, a bit of flim-flam to generate an initial value for |
| 4264 |
% \cs{rhAuthor} (unless the user's already given one with a |
| 4265 |
% \cs{shortAuthor} comand). |
| 4266 |
% \begin{macrocode} |
| 4267 |
\ifshortAuthor\else |
| 4268 |
\global\let\rhAuthor\@empty |
| 4269 |
\def\g@addto@rhAuthor##1{% |
| 4270 |
\begingroup |
| 4271 |
\toks@\expandafter{\rhAuthor}% |
| 4272 |
\let\thanks\@gobble |
| 4273 |
\protected@xdef\rhAuthor{\the\toks@##1}% |
| 4274 |
\endgroup |
| 4275 |
}% |
| 4276 |
\@getauthorlist\g@addto@rhAuthor |
| 4277 |
\fi |
| 4278 |
% \end{macrocode} |
| 4279 |
% |
| 4280 |
% now, the real business of setting the title |
| 4281 |
% \begin{macrocode} |
| 4282 |
\ifTB@title |
| 4283 |
\setcounter{footnote}{0}% |
| 4284 |
\renewcommand{\thefootnote}{\@fnsymbol\c@footnote}% |
| 4285 |
\if@tubtwocolumn |
| 4286 |
\twocolumn[\@maketitle]% |
| 4287 |
\else |
| 4288 |
\onecolumn |
| 4289 |
\global\@topnum\z@ |
| 4290 |
\@maketitle |
| 4291 |
\fi |
| 4292 |
\@thanks |
| 4293 |
\thispagestyle{TBproctitle} |
| 4294 |
\fi |
| 4295 |
\endgroup |
| 4296 |
\TB@madetitletrue |
| 4297 |
} |
| 4298 |
\newif\ifTB@madetitle \TB@madetitlefalse |
| 4299 |
% \end{macrocode} |
| 4300 |
% \end{macro} |
| 4301 |
% \end{macro} |
| 4302 |
% |
| 4303 |
% \begin{macro}{\@TB@test@document} |
| 4304 |
% \cs{@TB@test@document} checks to see, at entry to \cs{maketitle}, if |
| 4305 |
% we've had \verb:\begin{document}:. See \LaTeX{} bug report latex/2212, |
| 4306 |
% submitted by Robin Fairbairns, for details. |
| 4307 |
% \begin{macrocode} |
| 4308 |
\def\@TB@test@document{% |
| 4309 |
\edef\@tempa{\the\everypar} |
| 4310 |
\def \@tempb{\@nodocument} |
| 4311 |
\ifx \@tempa\@tempb |
| 4312 |
\@nodocument |
| 4313 |
\fi |
| 4314 |
} |
| 4315 |
% \end{macrocode} |
| 4316 |
% \end{macro} |
| 4317 |
% |
| 4318 |
% \begin{macro}{\AUTHORfont} |
| 4319 |
% \begin{macro}{\TITLEfont} |
| 4320 |
% \begin{macro}{\addressfont} |
| 4321 |
% \begin{macro}{\netaddrfont} |
| 4322 |
% Define the fonts for titles and things |
| 4323 |
% \begin{macrocode} |
| 4324 |
\def\AUTHORfont {\large\rmfamily\mdseries\upshape} |
| 4325 |
\def\TITLEfont {\Large\rmfamily\mdseries\upshape} |
| 4326 |
\def\addressfont{\small\rmfamily\mdseries\upshape} |
| 4327 |
\def\netaddrfont{\small\ttfamily\mdseries\upshape} |
| 4328 |
% \end{macrocode} |
| 4329 |
% \end{macro} |
| 4330 |
% \end{macro} |
| 4331 |
% \end{macro} |
| 4332 |
% \end{macro} |
| 4333 |
% |
| 4334 |
% \begin{macro}{\aboveauthorskip} |
| 4335 |
% \begin{macro}{\belowauthorskip} |
| 4336 |
% \begin{macro}{\belowabstractskip} |
| 4337 |
% Some changeable skips to permit variability in page layout depending |
| 4338 |
% on the particular paper's page breaks. |
| 4339 |
% \begin{macrocode} |
| 4340 |
\newskip\aboveauthorskip \aboveauthorskip=18\p@ \@plus4\p@ |
| 4341 |
\newskip\belowauthorskip \belowauthorskip=\aboveauthorskip |
| 4342 |
\newskip\belowabstractskip \belowabstractskip=14\p@ \@plus3\p@ \@minus2\p@ |
| 4343 |
% \end{macrocode} |
| 4344 |
% \end{macro} |
| 4345 |
% \end{macro} |
| 4346 |
% \end{macro} |
| 4347 |
% |
| 4348 |
% \begin{macro}{\@maketitle} |
| 4349 |
% The body of \cs{maketitle} |
| 4350 |
% \begin{macrocode} |
| 4351 |
\def\@maketitle{% |
| 4352 |
{\parskip\z@ |
| 4353 |
\frenchspacing |
| 4354 |
\TITLEfont\raggedright\noindent\@title\par |
| 4355 |
\count@=0 |
| 4356 |
\loop |
| 4357 |
\ifnum\count@<\authornumber |
| 4358 |
\vskip\aboveauthorskip |
| 4359 |
\advance\count@\@ne |
| 4360 |
{\AUTHORfont\theauthor{\number\count@}\endgraf}% |
| 4361 |
\addressfont\theaddress{\number\count@}\endgraf |
| 4362 |
{% |
| 4363 |
\allowhyphens |
| 4364 |
\hangindent1.5pc |
| 4365 |
\netaddrfont\thenetaddress{\number\count@}\endgraf |
| 4366 |
\hangindent1.5pc |
| 4367 |
\thePersonalURL{\number\count@}\endgraf |
| 4368 |
}% |
| 4369 |
\repeat |
| 4370 |
\vskip\belowauthorskip}% |
| 4371 |
\if@abstract |
| 4372 |
\centerline{\bfseries Abstract}% |
| 4373 |
\vskip.5\baselineskip\rmfamily |
| 4374 |
\@tubonecolumnabstractstart |
| 4375 |
\the\abstract@toks |
| 4376 |
\@tubonecolumnabstractfinish |
| 4377 |
\global\@ignoretrue |
| 4378 |
\fi |
| 4379 |
\vskip\belowabstractskip |
| 4380 |
\global\@afterindentfalse\aftergroup\@afterheading |
| 4381 |
} |
| 4382 |
% \end{macrocode} |
| 4383 |
% \end{macro} |
| 4384 |
% |
| 4385 |
% \begin{environment}{abstract} |
| 4386 |
% \begin{macro}{\if@abstract} |
| 4387 |
% \begin{macro}{\abstract@toks} |
| 4388 |
% Save the contents of the abstract environment in the token register |
| 4389 |
% \cs{abstract@toks}. We need to do this, as otherwise it may get |
| 4390 |
% `typeset' (previously, it got put in a box) before |
| 4391 |
% |\begin{document}|, and experiments prove that this means our shiny |
| 4392 |
% new \cs{SMC} doesn't work in this situation. |
| 4393 |
% |
| 4394 |
% If you need to understand the ins and outs of this code, look at the |
| 4395 |
% place I lifted it from: |tabularx.dtx| (in the tools |
| 4396 |
% bundle). The whole thing pivots on having stored the name of the |
| 4397 |
% `abstract' environment in \cs{@abstract@} |
| 4398 |
% |
| 4399 |
% \begin{macrocode} |
| 4400 |
\newtoks\abstract@toks \abstract@toks{} |
| 4401 |
\let\if@abstract\iffalse |
| 4402 |
\def\abstract{% |
| 4403 |
% \end{macrocode} |
| 4404 |
% |
| 4405 |
% we now warn unsuspecting users who provide an \texttt{abstract} |
| 4406 |
% environment \emph{after} the \cs{maketitle} that would typeset it\dots |
| 4407 |
% \begin{macrocode} |
| 4408 |
\ifTB@madetitle |
| 4409 |
\TBWarning{abstract environment after \string\maketitle} |
| 4410 |
\fi |
| 4411 |
\def\@abstract@{abstract}% |
| 4412 |
\ifx\@currenvir\@abstract@ |
| 4413 |
\else |
| 4414 |
\TBError{\string\abstract\space is illegal:% |
| 4415 |
\MessageBreak |
| 4416 |
use \string\begin{\@abstract@} instead}% |
| 4417 |
{\@abstract@\space may only be used as an environment} |
| 4418 |
\fi |
| 4419 |
\global\let\if@abstract\iftrue |
| 4420 |
{\ifnum0=`}\fi |
| 4421 |
\@abstract@getbody} |
| 4422 |
\let\endabstract\relax |
| 4423 |
% \end{macrocode} |
| 4424 |
% |
| 4425 |
% \cs{@abstract@getbody} gets chunks of the body (up to the next |
| 4426 |
% occurrence of \cs{end}) and appends them to \cs{abstract@toks}. It |
| 4427 |
% then uses \cs{@abstract@findend} to detect whether this \cs{end} is |
| 4428 |
% followed by \verb|{abstract}| |
| 4429 |
% |
| 4430 |
% \begin{macrocode} |
| 4431 |
\long\def\@abstract@getbody#1\end{% |
| 4432 |
\global\abstract@toks\expandafter{\the\abstract@toks#1}% |
| 4433 |
\@abstract@findend} |
| 4434 |
% \end{macrocode} |
| 4435 |
% |
| 4436 |
% Here we've got to \cs{end} in the body of the abstract. |
| 4437 |
% \cs{@abstract@findend} takes the `argument' of the \cs{end} do its |
| 4438 |
% argument. |
| 4439 |
% |
| 4440 |
% \begin{macrocode} |
| 4441 |
\def\@abstract@findend#1{% |
| 4442 |
\def\@tempa{#1}% |
| 4443 |
% \end{macrocode} |
| 4444 |
% |
| 4445 |
% If we've found an `end' to match the `begin' that we started with, |
| 4446 |
% we're done with gathering the abstract up; otherwise we stuff the |
| 4447 |
% end itself into the token register and carry on. |
| 4448 |
% |
| 4449 |
% \begin{macrocode} |
| 4450 |
\ifx\@tempa\@abstract@ |
| 4451 |
\expandafter\@abstract@end |
| 4452 |
\else |
| 4453 |
% \end{macrocode} |
| 4454 |
% |
| 4455 |
% It's not \cs{end}|{abstract}|---check that it's not |
| 4456 |
% \cs{end}|{document}| either (which signifies that the author's |
| 4457 |
% forgotten about ending the abstract) |
| 4458 |
% \begin{macrocode} |
| 4459 |
\def\@tempb{document}% |
| 4460 |
\ifx\@tempa\@tempb |
| 4461 |
\TBError{\string\begin{\@abstract@} |
| 4462 |
ended by \string\end{\@tempb}}% |
| 4463 |
{You've forgotten \string\end{\@abstract@}} |
| 4464 |
\else |
| 4465 |
\global\abstract@toks\expandafter{\the\abstract@toks\end{#1}}% |
| 4466 |
\expandafter\expandafter\expandafter\@abstract@getbody |
| 4467 |
\fi |
| 4468 |
\fi} |
| 4469 |
% \end{macrocode} |
| 4470 |
% |
| 4471 |
% In our case, the action at the `proper' \cs{end} is a lot simpler |
| 4472 |
% than what appears in |tabularx.dtx| \dots{} don't be surprised! |
| 4473 |
% |
| 4474 |
% \begin{macrocode} |
| 4475 |
\def\@abstract@end{\ifnum0=`{\fi}% |
| 4476 |
\expandafter\end\expandafter{\@abstract@}} |
| 4477 |
% \end{macrocode} |
| 4478 |
% \end{macro} |
| 4479 |
% \end{macro} |
| 4480 |
% \end{environment} |
| 4481 |
% |
| 4482 |
% \begin{macro}{\makesignature} |
| 4483 |
% \cs{makesignature} is improper in proceedings, so we replace it with a |
| 4484 |
% warning (and a no-op otherwise) |
| 4485 |
% \begin{macrocode} |
| 4486 |
\renewcommand{\makesignature}{\TBWarning |
| 4487 |
{\string\makesignature\space is invalid in proceedings issues}} |
| 4488 |
% \end{macrocode} |
| 4489 |
% \end{macro} |
| 4490 |
% |
| 4491 |
% \begin{macro}{\ps@TBproctitle} |
| 4492 |
% \begin{macro}{\ps@TBproc} |
| 4493 |
% \begin{macro}{\dopagecommands} |
| 4494 |
% \begin{macro}{\setpagecommands} |
| 4495 |
% \begin{macro}{\TB@definefeet} |
| 4496 |
% \begin{macro}{\pfoottext} |
| 4497 |
% \begin{macro}{\rfoottext} |
| 4498 |
% Now we define the running heads in terms of the \cs{rh*} commands. |
| 4499 |
% \begin{macrocode} |
| 4500 |
\def\ps@TBproctitle{\let\@oddhead\MakeRegistrationMarks |
| 4501 |
\let\@evenhead\MakeRegistrationMarks |
| 4502 |
\TB@definefeet |
| 4503 |
} |
| 4504 |
\def\ps@TBproc{% |
| 4505 |
\def\@oddhead{\MakeRegistrationMarks |
| 4506 |
{% |
| 4507 |
\hfil |
| 4508 |
\def\\{\unskip\ \ignorespaces}% |
| 4509 |
\rmfamily\rhTitle |
| 4510 |
}% |
| 4511 |
}% |
| 4512 |
\def\@evenhead{\MakeRegistrationMarks |
| 4513 |
{% |
| 4514 |
\def\\{\unskip\ \ignorespaces}% |
| 4515 |
\rmfamily\rhAuthor |
| 4516 |
\hfil |
| 4517 |
}% |
| 4518 |
}% |
| 4519 |
\TB@definefeet |
| 4520 |
} |
| 4521 |
|
| 4522 |
\advance\footskip8\p@ % for deeper running feet |
| 4523 |
|
| 4524 |
\def\dopagecommands{\csname @@pagecommands\number\c@page\endcsname} |
| 4525 |
\def\setpagecommands#1#2{\expandafter\def\csname @@pagecommands#1\endcsname |
| 4526 |
{#2}} |
| 4527 |
\def\TB@definefeet{% |
| 4528 |
\def\@oddfoot{\ifpreprint\pfoottext\hfil\Now\hfil\thepage |
| 4529 |
\else\rfoottext\hfil\thepage\fi\dopagecommands}% |
| 4530 |
\def\@evenfoot{\ifpreprint\thepage\hfil\Now\hfil\pfoottext |
| 4531 |
\else\thepage\hfil\rfoottext\fi\dopagecommands}% |
| 4532 |
} |
| 4533 |
|
| 4534 |
\def\pfoottext{{\smc Preprint}: |
| 4535 |
Proceedings of the \volyr{} Annual Meeting} |
| 4536 |
\def\rfoottext{\normalfont\TUB, \volx\Dash |
| 4537 |
{Proceedings of the \volyr{} Annual Meeting}} |
| 4538 |
|
| 4539 |
\pagestyle{TBproc} |
| 4540 |
% \end{macrocode} |
| 4541 |
% \end{macro} |
| 4542 |
% \end{macro} |
| 4543 |
% \end{macro} |
| 4544 |
% \end{macro} |
| 4545 |
% \end{macro} |
| 4546 |
% \end{macro} |
| 4547 |
% \end{macro} |
| 4548 |
% |
| 4549 |
% \subsection{Section divisions} |
| 4550 |
% |
| 4551 |
% Neither sections nor subsections are numbered by default in the |
| 4552 |
% proceedings style: note that this puts a degree of stress on authors' |
| 4553 |
% natural tendency to reference sections, which is a matter that needs |
| 4554 |
% attention. The class option \textsc{numbersec} once again numbers the |
| 4555 |
% sections (and noticeably changes the layout). |
| 4556 |
% |
| 4557 |
% \begin{macrocode} |
| 4558 |
\if@proc@numbersec |
| 4559 |
\else |
| 4560 |
\setcounter{secnumdepth}{0} |
| 4561 |
\fi |
| 4562 |
% \end{macrocode} |
| 4563 |
% |
| 4564 |
% Otherwise, the \cs{section} command is pretty straightforward. |
| 4565 |
% However, the \cs{subsection} and \cs{subsubsection} are run-in, and |
| 4566 |
% we have to remember to have negative stretch (and shrink if we |
| 4567 |
% should in future choose to have one) on the \meta{afterskip} |
| 4568 |
% parameter of \cs{@startsection}, since the whole skip is going to |
| 4569 |
% end up getting negated. We use \cs{TB@startsection} to detect |
| 4570 |
% inappropriate forms. |
| 4571 |
% |
| 4572 |
% \begin{macrocode} |
| 4573 |
\if@proc@numbersec |
| 4574 |
\else |
| 4575 |
\if@proc@sober |
| 4576 |
\def\section |
| 4577 |
{\TB@nolimelabel |
| 4578 |
\TB@startsection{{section}% |
| 4579 |
1% |
| 4580 |
\z@% |
| 4581 |
{-8\p@\@plus-2\p@\@minus-2\p@}% |
| 4582 |
{6\p@}% |
| 4583 |
{\normalsize\bfseries\raggedright}}} |
| 4584 |
\else |
| 4585 |
\def\section |
| 4586 |
{\TB@nolimelabel |
| 4587 |
\TB@startsection{{section}% |
| 4588 |
1% |
| 4589 |
\z@% |
| 4590 |
{-8\p@\@plus-2\p@\@minus-2\p@}% |
| 4591 |
{6\p@}% |
| 4592 |
{\large\bfseries\raggedright}}} |
| 4593 |
\fi |
| 4594 |
\def\subsection |
| 4595 |
{\TB@nolimelabel |
| 4596 |
\TB@startsection{{subsection}% |
| 4597 |
2% |
| 4598 |
\z@% |
| 4599 |
{6\p@\@plus 2\p@\@minus2\p@}% |
| 4600 |
{-5\p@\@plus -\fontdimen3\the\font}% |
| 4601 |
{\normalsize\bfseries}}} |
| 4602 |
\def\subsubsection |
| 4603 |
{\TB@nolimelabel |
| 4604 |
\TB@startsection{{subsubsection}% |
| 4605 |
3% |
| 4606 |
\parindent% |
| 4607 |
\z@% |
| 4608 |
{-5\p@\@plus -\fontdimen3\the\font}% |
| 4609 |
{\normalsize\bfseries}}} |
| 4610 |
\fi |
| 4611 |
%</ltugproccls> |
| 4612 |
% \end{macrocode} |
| 4613 |
% |
| 4614 |
% \section{Plain \TeX\ styles} |
| 4615 |
% \begin{macrocode} |
| 4616 |
%<*tugboatsty> |
| 4617 |
% err... |
| 4618 |
%</tugboatsty> |
| 4619 |
%<*tugprocsty> |
| 4620 |
% err... |
| 4621 |
%</tugprocsty> |
| 4622 |
% \end{macrocode} |
| 4623 |
% \section{The \LaTeXe\ compatibility-mode style files} |
| 4624 |
% \begin{macrocode} |
| 4625 |
%<*ltugboatsty> |
| 4626 |
\@obsoletefile{ltugboat.cls}{ltugboat.sty} |
| 4627 |
\LoadClass{ltugboat} |
| 4628 |
%</ltugboatsty> |
| 4629 |
%<*ltugprocsty> |
| 4630 |
\@obsoletefile{ltugproc.cls}{ltugproc.sty} |
| 4631 |
\LoadClass{ltugproc} |
| 4632 |
%</ltugprocsty> |
| 4633 |
% \end{macrocode} |
| 4634 |
% |
| 4635 |
% ^^A \addtolength{\premulticols}{5\baselineskip} |
| 4636 |
% \clearpage |
| 4637 |
% |
| 4638 |
% \Finale |
| 4639 |
% |
| 4640 |
\endinput |
| 4641 |
% |
| 4642 |
%% \CharacterTable |
| 4643 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 4644 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 4645 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 4646 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 4647 |
%% Dollar \$ Percent \% Ampersand \& |
| 4648 |
%% Acute accent \' Left paren \( Right paren \) |
| 4649 |
%% Asterisk \* Plus \+ Comma \, |
| 4650 |
%% Minus \- Point \. Solidus \/ |
| 4651 |
%% Colon \: Semicolon \; Less than \< |
| 4652 |
%% Equals \= Greater than \> Question mark \? |
| 4653 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 4654 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 4655 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 4656 |
%% Right brace \} Tilde \~} |