From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/tugboat/README | 72 + macros/latex/contrib/tugboat/ltubguid.ltx | 868 +++++++ macros/latex/contrib/tugboat/ltubguid.pdf | Bin 0 -> 324851 bytes macros/latex/contrib/tugboat/ltugbib.bst | 1199 +++++++++ macros/latex/contrib/tugboat/manifest.txt | 10 + macros/latex/contrib/tugboat/tugboat.bst | 1518 +++++++++++ macros/latex/contrib/tugboat/tugboat.dtx | 4011 +++++++++++++++++++++++++++++ macros/latex/contrib/tugboat/tugboat.ins | 85 + macros/latex/contrib/tugboat/tugboat.pdf | Bin 0 -> 460956 bytes 9 files changed, 7763 insertions(+) create mode 100644 macros/latex/contrib/tugboat/README create mode 100644 macros/latex/contrib/tugboat/ltubguid.ltx create mode 100644 macros/latex/contrib/tugboat/ltubguid.pdf create mode 100644 macros/latex/contrib/tugboat/ltugbib.bst create mode 100644 macros/latex/contrib/tugboat/manifest.txt create mode 100644 macros/latex/contrib/tugboat/tugboat.bst create mode 100644 macros/latex/contrib/tugboat/tugboat.dtx create mode 100644 macros/latex/contrib/tugboat/tugboat.ins create mode 100644 macros/latex/contrib/tugboat/tugboat.pdf (limited to 'macros/latex/contrib/tugboat') diff --git a/macros/latex/contrib/tugboat/README b/macros/latex/contrib/tugboat/README new file mode 100644 index 0000000000..11e6e50e24 --- /dev/null +++ b/macros/latex/contrib/tugboat/README @@ -0,0 +1,72 @@ +$Id: README 205 2018-09-06 17:28:53Z karl $ +Copyright 2006, 2009-2018 TeX Users Group. +You may freely use, modify and/or distribute this file. + +LaTeX macros for use in TUGboat +=============================== + +See the TUGboat web pages at http://tug.org/TUGboat for upcoming +deadlines, tips on writing articles, access to online issues, etc. +We greatly appreciate new article submissions! + +The files in this directory generate the TUGboat article class +ltugboat.cls, which should be used for all articles nowadays -- both +proceedings and regular issues. + +These macros are supported. Feel free to write to us. + +The TUGboat staff + + +Installation and use: +===================== + +Usually you can get the tugboat packages through your distribution. + +But if you want to install it by hand from CTAN, its directory there +(see http://ctan.org/pkg/tugboat) has three files containing TeX code: + + tugboat.dtx -- the source for the macros + tugboat.ins -- the docstrip instructions + ltubguid.ltx -- documentation for the macros (published in + http://tug.org/TUGboat/tb17-3/tb52guid.pdf, + but much updated since) + +other files are + ltubguid.pdf -- user documentation + tugboat.bst -- recommended BibTeX style for TUGboat + (approximately abbrvurl plus yet more abbreviations) + ltugbib.bst -- BibTeX style for ltugboat.cls's Harvard-cite capabilities + +Processing the .ins file produces: + + ltugboat.cls -- for preparing any TUGboat article + ltugproc.cls -- (obsolete) + ltugboat.sty -- The usual `obsolete file' warning + ltugproc.sty -- The usual `obsolete file' warning + ltugcomn.sty -- Used when processing tugboat.dtx for its + documentation content + +The procedure for using the macros should therefore be: + + process the .ins file + move the .sty and .cls to "somewhere LaTeX will search" + move the .bib to "somewhere BibTeX will search" + move the browsable documentation to "somewhere texdoc will search" + +On a TDS installation, common search locations are: + + $TEXMF/tex/latex/tugboat (for .sty, .cls) + $TEXMF/bibtex/bst/tugboat (for .bst) + $TEXMF/doc/latex/tugboat (for .pdf) + +($TEXMF being a pointer to the root of a TDS tree, preferably a local +one, to avoid tangling with future releases of your TeX distribution.) + +`User-level' documentation is provided in file ltubguid.pdf, which is +a revised version of a TUGboat paper. The documented source of the +macros is also provided in readily readable form, as tugboat.pdf. + +By the way, tugboat.sty, tugproc.sty, and tugboat.cmn are the plain TeX +files for TUGboat and not included here (see the separate tugboat-plain +package). diff --git a/macros/latex/contrib/tugboat/ltubguid.ltx b/macros/latex/contrib/tugboat/ltubguid.ltx new file mode 100644 index 0000000000..dcb817f014 --- /dev/null +++ b/macros/latex/contrib/tugboat/ltubguid.ltx @@ -0,0 +1,868 @@ +% $Id: ltubguid.ltx 216 2018-12-13 21:40:11Z karl $ +% ltubguid.ltx - documentation for ltugboat classes. +% +% Copyright 1994,1995,1996,2001,2005,2006,2010,2013,2014,2017,2018 +% TeX Users Group. +% +% This file is part of the tugboat package. +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work is the TeX Users Group +% (https://tug.org/TUGboat). +% +% The list of all files belonging to the distribution is +% given in the file `manifest.txt'. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% tubguide.bib -- the bibliography for this paper (apart from the +% references to TUGboat itself) +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\begin{filecontents}{tubguide.bib} +% BibTeX bibliography file (generated by aux2bib) + +@Misc{pkg:fancyvrb, + author = {Timothy Van Zandt and others}, + title = {The {\textsf{fancyvrb}} package}, + howpublished = {\url{ctan.org/pkg/fancyvrb}}, +} + +@Misc{pkg:listings, + author = {Carsten Heinz and others}, + title = {The {\textsf{listings}} package}, + howpublished = {\url{ctan.org/pkg/listings}}, +} + +@Misc{Arseneau:url:1996, + author = {Donald Arseneau}, + title = {The {\textsf{url}} package}, + howpublished = {\url{ctan.org/pkg/url}}, +} + +@Misc{Rahtz:hyperref:1997, + author = {Sebastian Rahtz and Heiko Oberdiek and others}, + title = {The {\textsf{hyperref}} package}, + howpublished = {\url{ctan.org/pkg/hyperref}}, +} + +@Book{Lamport:1994, + author = {Leslie Lamport}, + title = {{\LaTeX}: A Document Preparation System}, + edition = {\nth{2}}, + year = {1994}, + publisher = {Addison-Wesley}, +} + +@Misc{Schoepf:verbatim:1996, + author = {Rainer Sch{\umlaut{o}}pf}, + title = {The {\textsf{verbatim}} package}, + howpublished = {\url{ctan.org/pkg/verbatim}}, +} + +@Misc{Vieth:mflogo:1995, + author = {Ulrik Vieth}, + title = {The {\textsf{mflogo}} package}, + howpublished = {\url{ctan.org/pkg/mflogo}}, +} + +@Article{Whitney:TB10-3-378, + author = {Ron Whitney and Barbara Beeton}, + title = {{{{\TUB} authors' guide}}}, + journal = {{\TUB}}, + year = {1989}, + month = {November}, + volume = {10}, + number = {3}, + pages = {378--385}, + note = {\url{ctan.org/pkg/tugboat-plain}}, +} + +\end{filecontents} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ctandir.sty -- an experimental style file to go with Donald +% Arseneau's url.sty. Not recommended these days, better to use +% https://ctan.org/pkg/..., but don't feel like rewriting. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\begin{filecontents}{ctandir.sty} +% +% Experimental CTAN location information macros for use with Donald +% Arseneau's |url.sty| +% +% we need url.sty; we can rely on it to demand anything it needs of +% LaTeX. Not +\IfFileExists{url.sty}% + {\RequirePackage{url}}% + {\PackageWarning{ctandir}{You should acquire a copy of url.sty}% + \newcommand\urldef[3]{\def#1{\texttt{#3}}}% + \let\url\texttt + } +% +\newcommand\CTANdirectory[1]{\expandafter\urldef + \csname CTAN@#1\endcsname\path} +\newcommand\CTANfile[1]{\expandafter\urldef + \csname CTAN@#1\endcsname\path} +% +% Use the standard label-referencing mechanism to get the warning for +% an undefined label +\newcommand\CTANref[1]{\expandafter\@setref\csname CTAN@#1\endcsname + \relax{#1}} +\end{filecontents} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\documentclass[final]{ltugboat} +\usepackage{microtype} +\usepackage{ctandir} +\IfFileExists{booktabs.sty}% + {\usepackage{booktabs}}% + {\let\midrule\hline} +% +\vbadness=10000 % imperfectly broken pages are ok +\overfullrule=4pt % want to see +% +% define CTAN addresses using the commands of the |ctandir| package +\CTANdirectory{packages}{macros/latex/required} +\CTANdirectory{tub-latex}{macros/latex/contrib/tugboat} +% +% ***** Commands provided by this paper ***** +% +% Typeset the name of an environment, class, package, option, program +\providecommand\envname[1]{\textsf{#1}} +\providecommand\clsname[1]{\textsf{#1}} +\providecommand\pkgname[1]{\textsf{#1}} +\providecommand\optname[1]{\textsf{#1}} +\providecommand\progname[1]{\textsf{#1}} +% +% A list of options for a package/class +\newenvironment{optlist}{\begin{description}% + \renewcommand\makelabel[1]{% + \descriptionlabel{\mdseries\optname{##1}}}% + \itemsep0.25\itemsep}% + {\end{description}} +% +% A list of command names (using \mdwcmd, which as its name implies +% comes from the work of Mark Wooding) +\newenvironment{cmdlist}{\begin{description}% + \renewcommand\makelabel[1]{% + \descriptionlabel{\mdseries\mdwcmd##1}}% + \itemsep0.25\itemsep}% + {\end{description}} +% +\makeatletter +\providecommand{\mdwcmd}[1]{% + \expandafter\texttt\expandafter{\string#1}% + \mdwcmd@i} +\def\mdwcmd@i{\futurelet\@let@token\mdwcmd@ii} +\def\mdwcmd@ii{% + \let\@tempa\relax% + \ifx\@let@token\bgroup% + \def\@tempa##1{\texttt{\char`\{}\textit{##1}\texttt{\char`\}}\mdwcmd@i}% + \fi% + \ifx\@let@token[% + \def\@tempa[##1]{\texttt{[}\textit{##1}\texttt{]}\mdwcmd@i}% + \fi% + \@tempa% +} +\makeatother +% +% To use umlauts in a bibliography entry in BibTeX 0.99, we have to +% use a certain amount of subterfuge... +\let\umlaut\" +% +%%%%%%%%%%%%%%%% +\begin{document} +%%%%%%%%%%%%%%%% +% +\title{The \LaTeXe\ \TUB{} macros} +\author{Robin Fairbairns \& TUGboat editors} +\EDITORnoaddress +\netaddress{tugboat@tug.org} +\personalURL{tug.org/TUGboat} +\maketitle + +\section{Introduction} + +This is the documentation for the \LaTeXe\ macros to be used by \TUB{} +authors. The macros represent a development of the earlier +\clsname{ltugboat} and \clsname{ltugproc} styles that were written for +use with \LaTeX~2.09; major contributors have been Robin Fairbairns, +Sebastian Rahtz, Michel Goossens, Nico Poppelier and Johannes Braams. +Many others have been involved, including Barbara Beeton, Karl Berry, +Mimi Burbank, and the \LaTeX3 team. + +\section{Availability} + +The \TUB\ web pages are at:\\\centerline{\url{https://tug.org/TUGboat}} +They provide \textbf{an article template}, information for authors and +reviewers, and the complete run of all published \TUB\ issues, among +other things. + +The macros are released for general use, and are distributed via \CTAN{} +(directory \CTANref{tub-latex}) in the usual \LaTeX{} way as files +\path|tugboat.dtx| and \path|tugboat.ins|. When the\,\verb|.ins| file +is processed by \LaTeX{}, the files \path|ltugboat.cls| and +\path|ltugbib.bst| (for use with articles) and \path|ltugcomn.sty| (a +cooking pot of perhaps-useful macros, for documentation, etc.)\ are +produced. (\path|ltugproc.cls| is also produced for compatibility, but +is no longer used for proceedings or anything else.) + +The\,\verb|.dtx| file may itself be processed by \LaTeX{} to +produce a formatted (somewhat `literate') source listing for those who +would like more detailed descriptions of the \TUB\ macros. + +\section{The general structure of a paper} + +The basic idea is to start your \LaTeX\ document with +\path|\documentclass{ltugboat}|, which defines the appearance of \TUB\ +articles. This uses the file \path|ltugboat.cls| as usual. + +Each paper, therefore, is written as a document that may stand on its +own. It starts with a \cs{documentclass} command, and its body is +enclosed in a \envname{document} environment. There are some options to +the document class, described in the next section, but ordinarily the +author needn't bother with them. The defaults are +designed for creating proof copies of papers. + +The proof output differs from the final production output with respect +to page numbers and other material. The changes required for final +production are the responsibility of the \TUB{} editors, and the author +need not be concerned with them. + +\section{Class options: The \clsname{ltugboat} class} +\label{sec:boat-opts} + +The \clsname{ltugboat} class accepts many of the options of the +\clsname{article} class (it suppresses the font-size selection +and one/two-side options). +\begin{optlist} +\item[draft] Set up for a draft copy of a paper (this is the default + setting\Dash the author need not explicitly set it): page numbering + starts at a high number, black marks for overfull boxes. +\item[extralabel] Use the extra label-distinguishing mark in the body + of the reference; see section~\ref{sec:biblio}. +\item[final] Set up for the final copy of a paper: page numbering to + come from elsewhere, no cropmarks. +\item[harvardcite] Specify Harvard-style citation (not + recommended in general; see section~\ref{sec:biblio}); see + section~\ref{sec:biblio}. +\item[noextralabel] Don't use the extra label-distinguishing mark in + the body of the reference; see section~\ref{sec:biblio}. +\item[nonumber] Sections are not numbered; section heading + layout is to be as in the `plain' \pkgname{tugboat} styles. +\item[numbersec] Sections, subsections and subsubsections are to be + numbered (this is the default setting\Dash the author need not + explicitly set it). +\item[onecolumn] Typeset article in one column. +\item[preprint] Set up for a preprint. +\item[rawcite] Explicitly specify the standard \LaTeX\ citation method, + which is the default; see section~\ref{sec:biblio}. +\item[runningfull] Information in both header and footer (default). +\item[runningminimal] Information in header only. +\item[runningoff] Information in neither header nor footer. +\end{optlist} + +\noindent Again, normally there is no need to use any document options. +They are listed here for completeness. + +\section{Command syntax} +\label{sec:syntax} + +In general, we have sought simply to keep to the spirit of \LaTeX\ in +the commands provided by the \TUB\ class (\verb|ltugboat|). + +In the few cases that it has proved possible to emulate (what seems to +a staid old \LaTeX{} programmer, such as the original author here) the gay +abandon of the syntax of the `plain' \pkgname{tugboat} styles +\cite{Whitney:TB10-3-378}, we have done so. Nevertheless, on the whole, +the new \clsname{ltugboat} macros define \LaTeX{} commands and +environments, or modify the definitions of \LaTeX{} `standard' +commands. Section~\ref{sec:equiv} lists equivalences between macros +defined by the `plain' package and those defined by the new package. + +\section{Divisions of the paper} +\label{sec:divs-paper} + +Papers in \TUB{} may be subdivided in the normal way of a \LaTeX{} +article (the classes are defined in terms of \LaTeX{}'s +\clsname{article} class). Thus the author may use \cs{section}, +\cs{subsection}, \dots, \cs{paragraph} commands (but \cs{part} and +\cs{subparagraph} from \clsname{article} are suppressed, and +\cs{chapter}, which doesn't even appear in the parent class, receives +the same treatment). + +Authors may note that the style of ordinary issues of \TUB{} makes +no distinction between the titles of the divisions; the visual style +relies on the section numbers to indicate where the divisions lie in +the hierarchy. + +Reference may, however, be made to the `title' of divisions of the +paper, whether they are numbered or not. The \cs{nameref} command +(which uses the technique developed for the \textsf{hyperref} package +\cite{Rahtz:hyperref:1997}) permits such references; for example, the +present section was introduced by: +\begin{verbatim}[\small] + \section{Divisions of the paper} + \label{sec:divs-paper} +\end{verbatim} +and the command \verb|\nameref{sec:divs-paper}| produces +`\nameref{sec:divs-paper}'. + +\subsection{Abstracts} + +The \clsname{ltugboat} class provides two environments for abstracts, +\envname{abstract} and \envname{longabstract}. The \envname{abstract} +environment simply typesets its body as an un-numbered section whose +title is `Abstract'. The \envname{longabstract} environment typesets its +body in small text, and separates the abstract from the rest of the +paper with a decorative line; this is rarely used. + +\subsection{Appendices} + +A paper may have appendices, which can be expressed in exactly the same +way as they would be in the \LaTeX{} article class (confusing as that +may be): + +\begin{verbatim}[\small] +\appendix +\section{This is appendix A} +... +\section{This is appendix B} +\end{verbatim} +Which will produce `section' headings similar to: +\begin{quote} +\textbf{A\quad This is appendix A} +\end{quote} + +\TUB{} articles may have a small extension to this format using an +\texttt{appendix} environment: + +\begin{verbatim}[\small] +\begin{appendix} +\section{This is the first one} +... +\end{appendix} +\end{verbatim} +which will produce `section' headings similar to: +\begin{quote} +\textbf{Appendix A\quad This is the first one} +\end{quote} + +In both cases, the subsections are numbered as normal (i.e., as +`A.\ensuremath{n}' in normal \TUB{} papers): + +\section{Titles, addresses and so on} + +The title and author(s) of a paper are quoted using commands that are +familiar (in syntax, at least) to most \LaTeX{} users; the \cs{title} +command is exactly that used in the standard \LaTeX{} classes. There is +also \cs{shortTitle\char`{\meta{your-short-title}\char`}} to define the form +used in running heads or footers; similarly \cs{shortAuthor}. + +The \cs{author} command is used once for each co-author of the paper, +and for each \cs{author} there should be a \cs{address} command that +gives a (postal) correspondence address. In addition (wherever +possible), \TUB{} likes to quote an email address for authors: for this, +the \cs{netaddress} command is used. Each author may also mention a web +page, using a \cs{personalURL} command, and an \acro{ORCID} (from +\url{orcid.org}), using \cs{ORCID}. + +For example, the present paper has (approximately) this at its start: + +\begin{verbatim}[\small] +\title{The \LaTeXe\ \TUB{} Macros} +\author{TUGboat editors} +\address{\TeX\ Users Group} +\netaddress{tugboat@tug.org} +\personalURL{https://tug.org/TUGboat} +\maketitle +\end{verbatim} + +Lines in the title information can get quite long. +If the information being given is +to be typeset as ordinary text (as in the case of the \cs{address} +line above), it can be `wrapped' perfectly happily, as in normal text. +If one of the verbatim items (\cs{netaddress} or \cs{personalURL} +commands) is going to be too wide for the column, what is the author +to do? (Abbreviating the text, as in the \cs{personalURL} above, is +\emph{not} usually an acceptable option!) Unfortunately, the \verb|%| +sign is an entirely acceptable element of both email addresses and +\acro{URL}s, so that the normal `fall-back' isn't available. +Therefore, the classes typeset these electronic addresses in an +environment where some of the characters (notably `\verb|.|' and +`\verb|/|') are treated as word-divisions for the purposes of laying +out the line. + +If the paper is the result of more than one author's labours, a sequence of +\cs{author}, \cs{address}, \cs{netaddress} and \cs{personalURL} +commands may be given, as in the following, which comes from a paper +given at \tug'95 (abbreviated): + +\begin{verbatim}[\small] +\author{Michel Goossens} +\address{CN Division, CERN\\ + ...} +\netaddress{...} + +\author{Sebastian Rahtz} +\address{Elsevier Science Ltd\\ + ...} +\netaddress{...} +... +\end{verbatim} + +The class files will take care of arranging author names and addresses +between the \cs{maketitle} and (possibly) \cs{makesignature} commands. + +\subsection{Compilation articles} + +Compilation articles are written as a set of contributed parts under the +general editorship of the author(s) of the article. The author of the +article is presented (using \cs{author}, etc.)\ in the +usual way, and writes the introductory text. Each contributors' part +then follows. The contributor's name is quoted in the \cs{contributor} +command, which is an analogue of the \cs{author} command; contributors' +\cs{address}, \cs{netaddress} or \cs{personalURL}. The \cs{contributor} +command opens a group in which the contribution appears, and the +contributor's signature (produced with a \cs{makesignature} command) +closes the group. The general scheme looks like: +\begin{verbatim}[\small\makeescape\|\makebgroup\[\makeegroup\]] +\title{Example compilation article} +\author{Robin Fairbairns} +\address{University of Cambridge ...} +\netaddress{...} + ... |textsl[introductory text] ... +\makesignature + +\contributor{Betsy the Dog} +\address{Romsey Town, Cambridge} + ... |textsl[Betsy's contribution] ... +... +\makesignature ... +\end{verbatim} + +\section{Verbatim text} +\label{sec:verbatim} + +For inline verbatim text, authors should ordinarily employ the +facilities of \LaTeX{} itself, that is, the \cs{verb} macro. This macro, of +course, is highly restricted as to its usage\Dash primarily, it may +not appear in the argument of \emph{any} other macro, even +\cs{footnote}. + +For displayed verbatim text, the classes add a small increment to +the functionality of \LaTeX{}'s \envname{verbatim} environment, by +introducing an optional argument. The optional argument may contain +commands to be executed before starting the verbatim text; the set of +commands which have useful effect is strictly limited, but the +following are common: +\begin{itemize} +\item Font size selection commands: for example, all the display + verbatim in the present paper starts with + \verb|\begin{verbatim}[\small]|. + +\item The command \cs{ruled}, which is available \emph{only} in + \envname{verbatim}'s optional argument, and specifies that a + column-wide rule should be drawn before and after the verbatim + text. (This is not the recommended style in general, but it's + available for when it helps.) + +\item The command \cs{makevmeta}, also available only in + \envname{verbatim}'s optional argument, and makes the construct + \verb|!<...>| inside verbatim execute \verb|\meta{...}|. For example, +\begin{verbatim}[\small] +\begin{verbatim}[\small\makevmeta] +The ! is long ... +\end{verbatim} +produces: +\begin{verbatim}[\small\makevmeta] +The ! is long ... +\end{verbatim} + The \verb|!| character is made a general escape character by + \cs{makevmeta}, but \verb|<>| are not made grouping characters. + +\item More generally, one of the \cs{make*} commands,\footnote{\cs{makeescape}, + \cs{makebgroup}, \dots, \cs{makecomment}; used, for example, as + \cs{makeescape}\cs{|}.} which change the category code of + characters within the verbatim text. This is (of course) a facility + that should only be used with the utmost caution. + +\end{itemize} +Two caveats about these optional arguments: +\begin{itemize} +\item The search for the optional argument can be confused by the + appearance of a \verb|[| character as the first character of the displayed + verbatim. An author who wishes to start verbatim text with a + \verb|[| character should provide an empty optional argument (i.e., + `\verb|[]|') to the \envname{verbatim} environment. +\item The \TUB\ facility is lost when any package is loaded that also + defines the \verb|verbatim| environment, as discussed next. +\end{itemize} + +Authors may wish to use a more featureful verbatim package, such as such +as \pkgname{verbatim}~\cite{Schoepf:verbatim:1996}, +\pkgname{listings}~\cite{pkg:listings}, or +\pkgname{fancyvrb}~\cite{pkg:fancyvrb}. This is ok; it just means the +\TUB\ optional-argument feature is not available. + +If you use the \pkgname{listings} package, please specify: +\begin{verbatim} +\lstset{columns=flexible} +\end{verbatim} +The other values for the \verb|columns| option don't work well in +\TUB. Also, if you use \cs{small} for displayed verbatim, please reset +inline verbatim to the normal text size: +\begin{verbatim}[\small] +\lstset{columns=flexible, + basicstyle=\ttfamily\small} +\lstdefinestyle{inline} + {basicstyle=\ttfamily\normalsize} +\end{verbatim} + +\section{Floating inserts} + +The classes do not make any change to \LaTeX{}'s built-in provision +for floating inserts, so that authors may generate figures and tables +just as they would in any `normal' \LaTeX{} document. Figure and +table captions, and labels referring to them, are also substantially +untouched. + +However, since both classes typeset in two columns, authors must +distinguish between the \envname{figure} and \envname{table} environments +(which produce floats that are the same width as the column) and the +\envname{figure*} and \envname{table*} (which produce floats that are the same +width as the page). + +%\begin{itemize} +%\item figures and tables as normal +%\item captions and labels work whatever (i.e., no restriction on +% numbering) +%\item twocolumn setting implies distinction between \envname{figure} and +% \envname{figure*} +%\end{itemize} + +\section{Special-purpose typesetting} + +The classes define a rather large set of commands for special-purpose +typesetting. Some of them are available for historical reasons only, +and many are only useful in somewhat restricted circumstances. For +this reason, the present paper only outlines a representative, small +set of the macros. + +\subsection{Acronyms and logos} + +The classes provide macros that produce `correct' representations of a +large number of acronyms and logos; a small representative selection is +shown in figure~\ref{fig:acro-logo}. The sample documents at +\url{tug.org/TUGboat/location.html} have a more complete list, +and of course the class sources are the ultimate reference. +\begin{figure}[htbp!] + \begin{center} + \begin{tabular}{@{}ll@{}} + \small\textsl{\textsf{Macro}}&\small\textsl{\textsf{Output}}\\ + \midrule + \verb|\ConTeXt| & \ConTeXt \\ + \verb|\Cplusplus| & \Cplusplus \\ + \verb|\CTAN| & \CTAN \\ + \verb|\eTex| & \eTeX \\ + \verb|\FAQ| & \FAQ \\ + \verb|\HTML| & \HTML \\ + \verb|\ISBN| & \ISBN \\ + \verb|\KOMAScript| & \KOMAScript \\ + \verb|\LaTeXe| & \LaTeXe \\ + \verb|\MacOSX| & \MacOSX \\ + \verb|\MathML| & \MathML \\ + \verb|\MF| & \MF \\ + \verb|\MP| & \MP \\ + \verb|\OMEGA| & \OMEGA \\ + \verb|\PDF| & \PDF \\ + \verb|\SGML| & \SGML \\ + \verb|\TUB| & \TUB \\ + \verb|\TUG| & \TUG \\ + \verb|\tug| & \tug \\ + \verb|\XML| & \XML \\ + \end{tabular} + \end{center} + \caption{A few of the provided acronyms and logos} + \label{fig:acro-logo} +\end{figure} + +Authors are especially urged to note the \cs{acro} command, which is +defined in the classes. The visual appearance of all-caps sequences +among normal text is rather unpleasing in Computer Modern, +unfortunately. Therefore, the \cs{acro} command typesets its argument +one point size smaller than the surrounding text: compare `\acro{DANTE}' +(\verb|\acro{DANTE}|) with `DANTE'\@. Many of the provided macros merely +generate calls to \cs{acro}; two examples, \cs{CTAN} and \cs{tug} of the +list in figure~\ref{fig:acro-logo} have already been used in the present +paper. + +\subsection{Other special typesetting} + +A small list of special typesetting commands follows: a large set of +such commands is defined in the classes, but the list covers most of +the `everyday' ones. +\begin{cmdlist}\raggedright +\item[\Dash] Typeset an em-dash, ignoring preceding and following space, + surrounded by thin spaces, only breakable \emph{after} the dash; this + is the preferred method of specifying a dash in running text. +\item[\cs{cmd}] Typeset a control sequence name:\\ + \verb|\cs{fred}| produces \cs{fred}. +\item[\env{environ}] Typeset the command to begin an environment: + \verb|\env{fred}| produces \env{fred}. +\item[\meta{var}] Typeset meta-syntactic text:\\ + \verb|\meta{fred}| produces \meta{fred}. +\item[\tubbraced{text}] Typeset typewriter text in typewriter + braces: \verb|\tubbraced{fred}| produces \tubbraced{fred}. +\item[\nth{n}] Typeset an ordinal number; \verb|\nth{1}| is + set as \nth{1}, \verb|\nth{27}| is set as \nth{27}, and so on. +%\item[\sfrac{num}{denom}] Typeset a fraction to match running text; +% for example \verb|\sfrac{3}{4}| is set as \sfrac{3}{4}\,. +\end{cmdlist} + +\section{Use of packages} + +In general, authors can use non-standard packages in their papers. +However, the paper does need to be processable on the \TUB{} production +computers (running current \TeX\ Live). A sensible mechanism for +submitting out-of-the-ordinary packages (as for paper-specific +bibliographies) is by use of the \envname{filecontents} environment. + +In general, packages currently on \CTAN, and known to work with +\emph{current} \LaTeX{} are unlikely to give problems. In particular, +the team is happy to accept papers using packages that are supported by +members of the \LaTeX3 team,\footnote{% + Those in the \LaTeX{} base distribution, or one of those in the + \CTANref{packages} sub-tree on \CTAN.} subject to the warning already +mentioned (section~\ref{sec:verbatim}): that use of the standard +\pkgname{verbatim} package eliminates the special \envname{verbatim} +facilities provided by the \TUB\ classes. + +\tug{} has a policy that macro packages described in \TUB{} should be +available for readers to use. Since typing macros from printed +sources is such an error-prone undertaking, authors of publicly +available packages are urged to submit their macros to the \CTAN{} +archives. If a package is only available under restricted terms, +authors are urged to make this fact clear when first submitting an +article to the editor. + +At present, the list of canonically recommended packages consists of +only two, \path|mflogo.sty| \cite{Vieth:mflogo:1995} and \path|url.sty| +\cite{Arseneau:url:1996}. + +Both classes will load the \pkgname{mflogo} package if it is present on the +author's system; if the package is not present, the classes will +emulate its more important features; the package defines \MF{} and +\MP{} logos using recent versions of Knuth's \verb|logo10| font family. + +The \pkgname{url} package is useful when one is typesetting significant +numbers of file names, network addresses or \acro{URL}s; it is being +used in the present paper (not least in the bibliography). Speaking of +urls, nowadays we generally omit a leading \texttt{http://} or +\texttt{https://}. + +Although not necessarily recommended in all cases, many additional +packages are commonly used. To mention a few: \texttt{microtype} can +help reduce overfull boxes; sometimes it may be preferable to use the +Latin Modern fonts via \texttt{lmodern}; and \texttt{hyperref} allows +for many internal links and other features. + +\section{Bibliography} +\label{sec:biblio} + +In short: our basic recommendation for handling bibliographies is to use +\BibTeX\ and the \pkgname{tugboat} bibliography style. No document +options are needed or recommended. All that is required in the article +source (as shown in the template available from +\url{tug.org/TUGboat}) is the following: + +\begin{verbatim}[\small] +\bibliographystyle{tugboat} +\bibliography{yourbibfile} +\end{verbatim} + +If you don't have \verb|tugboat.bst|, which was released in 2018, it's +fine to use \pkgname{plain} or \pkgname{abbrv}. If you do have it, +though, you may enjoy the following small but useful features: + +\begin{itemize} +\item It is based on \pkgname{abbrvurl.bst} (see \url{ctan.org/pkg/urlbst}), + +\item thus supports \textsf{url} and \textsf{doi} fields, among others. + +\item The \textsf{url} field is ignored if either the \textsf{doi} or +\textsf{howpublished} field is present, since in practice we observe +that people put the same information in all those fields, and we don't +want to use up space typesetting redundant information. + +\item Has even more abbreviations than \textsf{abbrv}, including +printing only two author names (plus ``et~al\@.'') if there are more +than four authors (thanks to Mico Loretan). + +\item Defines an \textsf{@online} entry type as an alias for \textsf{@misc}. + +\item For completeness only: \verb|tugboat.bst| provides ``secret'' +fields \textsf{newpage} to force a page break after the current item, +and \textsf{urlnewline} to force a line break before the \textsf{url} +value. We've found that these presentation tweaks are often necessary +for the final typeset output. Authors need not worry about them. + +\end{itemize} + +If you use \BibTeX, feel free to take advantage of the accumulated +bibliography of \TUB{} itself (\url{info/tugboat.bib} on \CTAN), and the +various compilations by Nelson Beebe in that same directory. + +Bibliographies provide further problems because they're notoriously +difficult to typeset at the best of times. \LaTeX{} sets \cs{sloppy} +when typesetting the bibliography, but this often leads to unpleasant +output in the narrow columns typical of \TUB{}. The author can control +the typesetting using the command \cs{SetBibJustification}. The classes +set \cs{sloppy}, by default (just like \LaTeX{}), but the author may +(for example) say: +\begin{verbatim} + \SetBibJustification{\raggedright} +\end{verbatim} +as the present article does, to achieve somewhat better results. + +A last note for bibliographies: for references to other issues of \TUB, +please use the format \textsl{volno:issno}, e.g., ``\TUB\ 32:1'' for +volume~32, number~1. + +\section{Non-recommended bibliography facilities} + +The preceding gives the bibliography recommendations for current \TUB\ +article. If, for whatever reason, you cannot follow the recommendation, +this section is about some of the myriad historical and other +possibilities. + +Notwithstanding the general recommendation for the \pkgname{tugboat} +(falling back to \pkgname{plain}) \BibTeX\ style, \TUB's Harvard +citation support may be selected by specifying \optname{harvardcite} as +an option of the \cs{documentclass} command.\footnote{% + The macros used derive rather directly from the `harvard' styles + written by Glenn Paulley and now maintained by Peter Williams; the + \BibTeX{} style derives from one developed by Patrick Daly.} +If your article demands Harvard-style citations, you may prefer to load +\pkgname{natbib} or similar instead of using \TUB's facilities; that's +ok. + +The basic citation format is `author(s), year', but the macros are +capable of many variations: this in turn places somewhat of a load on +the author to use the correct citation macro. The macros available are +shown in figure~\ref{fig:citation-macros}; the figure assumes an entry +in the bibliography with authors Tom, Dick, and~Harry, and with a 1990 +date. + +\begin{figure}[htbp!] + \begin{center} + \leavevmode + \begin{tabular}{@{}ll@{}}% @{ $\rightarrow$ } between columns removed + \small\textsf{\textsl{Macro}} &\small\textsf{\textsl{Output}}\\ + \midrule + \verb|\cite{key}| & (Tom, Dick, and Harry, 1990)\\ + \verb|\citeA{key}| & (Tom, Dick, and Harry)\\ + \verb|\citeNP{key}| & Tom, Dick, and Harry, 1990\\ + \verb|\citeANP{key}| & Tom, Dick, and Harry\\ + \verb|\citeN{key}| & Tom, Dick, and Harry (1990)\\ + \verb|\shortcite{key}| & (Tom et al., 1990)\\ + & [also has \texttt{A} and \texttt{NP} + variants]\\ + \verb|\citeyear{key}| & (1990)\\ + & [also has an \texttt{NP} variant] + \end{tabular} + \end{center} + \caption{The range of citations in \optname{harvard} style} + \label{fig:citation-macros} +\end{figure} + +Note that, if Tom, Dick, and Harry are a prolific team, there can +easily be more than one reference to their work in one year. In such +a case, the citations will be (Tom, Dick, and Harry, 1990a), (Tom, +Dick, and Harry, 1990b), and so on. These extra `a', `b', etc., tags +may also appear in the references section of the paper, attached to +the year recorded for the reference: whether this indeed happens is +controlled by the \optname{extralabel} and \optname{noextralabel} class +options. The default state (option \optname{extralabel}) attaches the +extra characters. + +As for \BibLaTeX, we don't recommend it for \TUB. If you feel you must +use it, that is ok, but we may still change it to using the default +\LaTeX\ and \BibTeX\ facilities in processing for publication if the +output from \BibLaTeX\ is problematic, as we have often seen it to be. + + + +\section{Equivalences between the `plain' and \LaTeX{} \TUB\ packages} +\label{sec:equiv} + +A good proportion of the commands in the `plain' packages also appear +(with the same meaning) in the \LaTeX{} classes. +Figure~\ref{fig:plain-equiv} gives a brief summary of where the macros +differ significantly. + +\begin{figure}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{@{}ll@{}} + \small\textsf{Plain macro} & \small\textsf{\LaTeX{} macro} \\ + \midrule + \cs{head} & \cs{section} \\ + \cs{subhead} & \cs{subsection} \\ + \cs{subsubhead} & \cs{subsubsection} \\ + \cs{list} & \envname{itemize}, \envname{enumerate}, etc., \\ + & environments \\ + \cs{verbatim} & \envname{verbatim} or \cs{verb} \\ + \cs{figure} & \envname{figure} or \envname{figure*} environments \\ + \end{tabular} + \end{center} + \caption{Equivalences between \pkgname{plain} and \LaTeX{} \TUB\ macros} + \label{fig:plain-equiv} +\end{figure} + +\LaTeX{} itself makes comprehensive provision for lists; the \TUB{} +classes make no attempt to emulate the list facilities of the `plain' +macros. + +The `plain' styles' provision for verbatim text is also somewhat +different from the \LaTeX{} approach; the \TUB{} classes offer a small +subset of the extra facilities that the `plain' styles provide; for more +elaborate facilities, the user is referred to the \pkgname{verbatim}, +\pkgname{listings}, and \pkgname{fancyvrb} packages (see +section~\ref{sec:verbatim}). + +Of course, the syntax of commands given to the \LaTeX{} classes is +different (as discussed in section~\ref{sec:syntax}); arguments are +(almost always) enclosed in braces, and neither of the forms of +argument provision promulgated by the `plain' macros +(\cs{macro}\meta{argument}\linebreak[0]\cs{endmacro} and +\cs{macro * }\meta{argument}\verb| *|) are provided by the \LaTeX{} +classes. + +\SetBibJustification{\raggedright} +\bibliographystyle{tugboat} +\bibliography{tubguide} + +\advance\signaturewidth by 8pt +\makesignature + +\end{document} diff --git a/macros/latex/contrib/tugboat/ltubguid.pdf b/macros/latex/contrib/tugboat/ltubguid.pdf new file mode 100644 index 0000000000..48f978eb90 Binary files /dev/null and b/macros/latex/contrib/tugboat/ltubguid.pdf differ diff --git a/macros/latex/contrib/tugboat/ltugbib.bst b/macros/latex/contrib/tugboat/ltugbib.bst new file mode 100644 index 0000000000..cb9ac17b09 --- /dev/null +++ b/macros/latex/contrib/tugboat/ltugbib.bst @@ -0,0 +1,1199 @@ +% $Id: ltugbib.bst 66 2010-11-23 16:33:37Z karl $ +% This is the file `ltugbib.bst', used by the harvardcite option +% to the ltug* LaTeX classes. +% +% \iffalse (this is a meta-comment (so they say)) +% Copyright 1995,1996,1997,1998,2000,2004,2006,2007,2009 TeX Users Group. +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work is the TeX Users Group +% (http://tug.org/TUGboat). +% +% The list of all files belonging to this package is given in the file +% `manifest.txt'. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% \fi +% +% 7-Jun-04: (all related code marked OP) handle a title ending in, e.g., a +% question-mark; otherwise the same as the (CTAN-time) 9-Apr-02 version: +% +% This file used to be generated from tugboat.dtx, but is now distributed +% as a stand-alone file. +% +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + } + {} + { label extra.label sort.label long.label short.label } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block + suppress.period } % OP: after quoted title (trivalued) + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #0 'suppress.period := % OP: initialize to FALSE +} + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { suppress.period #2 = % OP: check for suppression this time + { #0 'suppress.period := } % suppress, reset to FALSE + 'add.period$ + if$ + write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[" write$ + "\protect\citeauthoryear{" long.label * "}{" * write$ + short.label write$ + "}{" year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * extra.label * "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ + suppress.period #1 = % OP: check to suppress period + { #2 'suppress.period := } % for current (1st) output + 'skip$ + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "{\bf " swap$ * "}" * } + if$ +} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + nameptr #1 = + { "{vv~}{ll}{, jj}{, ff}" format.name$ } + { "{f.~}{vv~}{ll}{, jj}" format.name$ } + if$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + numnames #1 > + { "," * } + 'skip$ + if$ + t "others" = + { " \etal{}" * } + { " and " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.names.ed} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f.~}{vv~}{ll}{, jj}" + format.name$ 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " \etal{}" * } + { " and " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { ", editors" * } + { ", editor" * } + if$ + } + if$ +} + +FUNCTION {format.in.editors} +{ editor empty$ + { "" } + { editor format.names.ed + } + if$ +} + +FUNCTION {quote.period.spacing} % OP: reduce space between quotes and +{ "\kern -.05em{}" % period; remove negative kern by +} % replacing this simply with "" + +FUNCTION {format.title} % OP: a period follows the +{ title empty$ % quotation marks in this style + { "" } + { title + "``" swap$ * + duplicate$ "''" * swap$ % OP: create the quoted title + duplicate$ add.period$ = % see if title needs period + { #1 'suppress.period := } % no: suppress next (2nd) output + { quote.period.spacing * } % yes: add desired spacing + if$ + } + if$ +} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ "In " } + +FUNCTION {format.date} +{ year duplicate$ empty$ + { "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" } + 'skip$ + if$ + "\UseExtraLabel{" * extra.label * "}" * +} + +FUNCTION {format.btitle} +{ title emphasize +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "volume" volume tie.or.space.connect + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "number" } + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition "l" change.case$ " edition" * } + { edition "t" change.case$ " edition" * } + if$ + } + if$ +} + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "pages" pages n.dashify tie.or.space.connect } + { "page" pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + bolden + number empty$ + 'skip$ + { "(" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { ", " * pages n.dashify * } + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "chapter" } + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { word.in booktitle emphasize * } + { word.in booktitle emphasize * ", edited by " * + format.in.editors * } + if$ + } + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ + word.in + "\cite{" * crossref * "}" * +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + word.in + } + { "Volume" volume tie.or.space.connect + " of " * + } + if$ + "\cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + "\cite{" * crossref * "}" * +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { journal emphasize "journal" output.check + " " * before.all 'output.state := % OP: sic (preexisting kludge) + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + new.block + format.title "title" output.check + new.block + howpublished output + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + publisher "publisher" output.check + address output + format.edition output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + address output + new.sentence + organization output + publisher output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + new.block + format.btitle "title" output.check + organization address new.block.checkb + organization output + address output + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.btitle "title" output.check + new.block + "Master's thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + new.block + format.title output + new.block + howpublished output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.btitle "title" output.check + new.block + "Ph.D.\ thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address output + new.sentence + organization output + publisher output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +FUNCTION {format.lab.names} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ % 2nd number of names + " \etal{}" * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " \etal{}" * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.long.lab.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " \etal{}" * } + { " and " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.key} +{ author empty$ + { "{" + key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ * + "}" * + } + 'author + if$ +} + +FUNCTION {author.editor.key} +{ author empty$ + { editor empty$ + { "{" + key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ * + "}" * + } + 'editor + if$ + } + 'author + if$ +} + +FUNCTION {editor.key} +{ editor empty$ + { "{" + key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ * + "}" * + } + 'editor + if$ +} + +FUNCTION {maybe.other.name.field} +{ swap$ % [stack: other.field name] + duplicate$ empty$ % is the name empty? + { pop$ % discard it [stack: other.field] + #1 swap$ 'skip$ if$ % try the other one + } + { swap$ pop$ % discard other.field + } + if$ +} + +FUNCTION {calc.label.names} +{ type$ "proceedings" = + 'editor + 'author + if$ + 'editor maybe.other.name.field + 'organization maybe.other.name.field + 'key maybe.other.name.field + { "Cannot create a label name in " cite$ * warning$ + cite$ #1 #3 substring$ } maybe.other.name.field +} + +FUNCTION {calc.short.label} +{ calc.label.names format.lab.names + 'short.label := +} + +FUNCTION {calc.label} +{ calc.short.label + short.label ", " * + year duplicate$ empty$ + { pop$ "????" } + { purify$ #-1 #4 substring$ } + if$ + * + 'label := +} + +FUNCTION {calc.long.label} +{ calc.label.names format.long.lab.names + 'long.label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + s nameptr + "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr numnames = t "others" = and + { "et al" * } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT + +STRINGS { last.label next.extra } + +INTEGERS { last.extra.num } + +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := +} + +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ +} + +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := +} + +EXECUTE {initialize.extra.label.stuff} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := + calc.long.label +} + +ITERATE {bib.sort.order} + +SORT + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{}" write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} +%% +%% +%% End of file `ltugbib.bst'. diff --git a/macros/latex/contrib/tugboat/manifest.txt b/macros/latex/contrib/tugboat/manifest.txt new file mode 100644 index 0000000000..b4613f77c6 --- /dev/null +++ b/macros/latex/contrib/tugboat/manifest.txt @@ -0,0 +1,10 @@ +$Id: manifest.txt 205 2018-09-06 17:28:53Z karl $ +List of files in the tugboat LaTeX package covered by the LPPL: + +ltubguid.ltx +ltubguid.pdf +ltugbib.bst +tugboat.bst +tugboat.dtx +tugboat.pdf +tugboat.ins diff --git a/macros/latex/contrib/tugboat/tugboat.bst b/macros/latex/contrib/tugboat/tugboat.bst new file mode 100644 index 0000000000..ad73920cb9 --- /dev/null +++ b/macros/latex/contrib/tugboat/tugboat.bst @@ -0,0 +1,1518 @@ +%%% $Id: tugboat.bst 210 2018-10-29 18:04:16Z karl $ +%%% TUGboat changes are public domain. +%%% +%%% Modified for TUGboat from abbrvurl.bst: +%%% abbreviate "page(s)" to "p(p).", +%%% "volume" to "vol.", +%%% "editor(s)" to "ed(s)". +%%% urlintro="" +%%% reduce long author lists in format.names per Mico. +%%% new fields for editors: +%%% "newpage" - force page break after entry +%%% "urlnewline" - force line break before url value. +%%% --karl, originally created 24jul18. +%%% +%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/abbrv.bst +%%% ... by urlbst, version 0.7 (marked with "% urlbst") +%%% See +%%% Added webpage entry type, and url and lastchecked fields. +%%% Added eprint support. +%%% Added DOI support. +%%% Added PUBMED support. +%%% Added hyperref support. +%%% Original headers follow... + +% BibTeX standard bibliography style `abbrv' + % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09. + % Copyright (C) 1985, all rights reserved. + % Copying of this file is authorized only if either + % (1) you make absolutely no changes to your copy, including name, or + % (2) if you do make changes, you name it something other than + % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst. + % This restriction helps ensure that all standard styles are identical. + % The file btxbst.doc has the documentation for this style. + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + eprint % urlbst + doi % urlbst + pubmed % urlbst + url % urlbst + lastchecked % urlbst + newpage % tub + urlnewline % tub + } + {} + { label } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +% urlbst... +% urlbst constants and state variables +STRINGS { urlintro + eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl + citedstring onlinestring linktextstring + openinlinelink closeinlinelink } +INTEGERS { hrefform inlinelinks makeinlinelink + addeprints adddoiresolver addpubmedresolver } +FUNCTION {init.urlbst.variables} +{ + % The following constants may be adjusted by hand, if desired + + % The first set allow you to enable or disable certain functionality. + #0 'addeprints := % 0=no eprints; 1=include eprints + #1 'adddoiresolver := % 0=no DOI resolver; 1=include it + #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it + #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + + % String constants, which you _might_ want to tweak. + "" 'urlintro := % prefix before URL; typically "Available from:" or "URL": + "online" 'onlinestring := % indication that resource is online; typically "online" + "cited " 'citedstring := % indicator of citation date; typically "cited " + "[link]" 'linktextstring := % dummy link text; typically "[link]" + "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "arXiv:" 'eprintprefix := % text prefix printed before eprint ref; typically "arXiv:" + "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI + "doi:" 'doiprefix := % text prefix printed before DOI ref; typically "doi:" + "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED + "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref; typically "PMID:" + + % The following are internal state variables, not configuration constants, + % so they shouldn't be fiddled with. + #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink + "" 'openinlinelink := % ditto + "" 'closeinlinelink := % ditto +} +INTEGERS { + bracket.state + outside.brackets + open.brackets + within.brackets + close.brackets +} +% ...urlbst to here + +% tub: move up to use earlier. +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {init.state.consts} +{ #0 'outside.brackets := % urlbst... + #1 'open.brackets := + #2 'within.brackets := + #3 'close.brackets := % ...urlbst to here + + #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t last.output.check } + +% urlbst +% arg on stack is what needs to be written. +% If a journal, we want to omit the following comma, as in +% "TUGboat 39(1)" instead of the default "TUGboat, 39(1)". +% +FUNCTION {output.nonnull.original} +{ 's := + output.state mid.sentence = + { last.output.check "journal" = not + { ", " * } + { " " *} + if$ + write$ + } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +% urlbst... +% The following three functions are for handling inlinelink. They wrap +% a block of text which is potentially output with write$ by multiple +% other functions, so we don't know the content a priori. +% They communicate between each other using the variables makeinlinelink +% (which is true if a link should be made), and closeinlinelink (which holds +% the string which should close any current link. They can be called +% at any time, but start.inlinelink will be a no-op unless something has +% previously set makeinlinelink true, and the two ...end.inlinelink functions +% will only do their stuff if start.inlinelink has previously set +% closeinlinelink to be non-empty. +% (thanks to 'ijvm' for suggested code here) +FUNCTION {uand} +{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file) +FUNCTION {possibly.setup.inlinelink} +{ makeinlinelink hrefform #0 > uand + { doi empty$ adddoiresolver uand + { pubmed empty$ addpubmedresolver uand + { eprint empty$ addeprints uand + { url empty$ + { "" } + { url } + if$ } + { eprinturl eprint * } + if$ } + { pubmedurl pubmed * } + if$ } + { doiurl doi * } + if$ + % an appropriately-formatted URL is now on the stack + hrefform #1 = % hypertex + { "\special {html: }{" * 'openinlinelink := + "\special {html:}" 'closeinlinelink := } + { "\newline\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref + % the space between "} {" matters: a URL of just the right length can cause "\% newline em" + "}" 'closeinlinelink := } + if$ + #0 'makeinlinelink := + } + 'skip$ + if$ % makeinlinelink +} +FUNCTION {add.inlinelink} +{ openinlinelink empty$ + 'skip$ + { openinlinelink swap$ * closeinlinelink * + "" 'openinlinelink := + } + if$ +} +FUNCTION {output.nonnull} +{ % Save the thing we've been asked to output + 's := + % If the bracket-state is close.brackets, then add a close-bracket to + % what is currently at the top of the stack, and set bracket.state + % to outside.brackets + bracket.state close.brackets = + { "]" * + outside.brackets 'bracket.state := + } + 'skip$ + if$ + bracket.state outside.brackets = + { % We're outside all brackets -- this is the normal situation. + % Write out what's currently at the top of the stack, using the + % original output.nonnull function. + s + add.inlinelink + output.nonnull.original % invoke the original output.nonnull + } + { % Still in brackets. Add open-bracket or (continuation) comma, add the + % new text (in s) to the top of the stack, and move to the close-brackets + % state, ready for next time (unless inbrackets resets it). If we come + % into this branch, then output.state is carefully undisturbed. + bracket.state open.brackets = + { " [" * } + { ", " * } % bracket.state will be within.brackets + if$ + s * + close.brackets 'bracket.state := + } + if$ +} + +% Call this function just before adding something which should be presented in +% brackets. bracket.state is handled specially within output.nonnull. +FUNCTION {inbrackets} +{ bracket.state close.brackets = + { within.brackets 'bracket.state := } % reset the state: not open nor closed + { open.brackets 'bracket.state := } + if$ +} + +FUNCTION {format.lastchecked} +{ lastchecked empty$ + { "" } + { inbrackets citedstring lastchecked * } + if$ +} +% ...urlbst to here + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +% tub: save name of field (what's on stack, e.g., "journal") in +% variable last.output.check for use in output.nonnull.original. +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + { t 'last.output.check := + output.nonnull } + if$ +} + +FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below) +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below) +{ doi empty$ url empty$ and + { add.period$ } + { skip$ } + if$ + write$ + newline$ +} + + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := + nameptr #1 > + % following lines implement printing only 2 author names (+ "et al.") + % whenever there are more than 4 authors. Thanks Mico. + % https://tex.stackexchange.com/questions/26575 + { nameptr #2 + #1 + = + numnames #3 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { ", eds." * } + { ", ed." * } + if$ + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title "t" change.case$ } + if$ +} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month + } + if$ + } + { month empty$ + 'year + { month " " * year * } + if$ + } + if$ +} + +FUNCTION {format.btitle} +{ title emphasize +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "vol." volume tie.or.space.connect + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "number" } + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition "l" change.case$ " edition" * } + { edition "t" change.case$ " edition" * } + if$ + } + if$ +} + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "pp." pages n.dashify tie.or.space.connect } + { "p." pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + number empty$ + 'skip$ + { "(" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { ":" * pages n.dashify * } + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "chapter" } + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "In~" booktitle emphasize * } + { "In " format.editors * ", " * booktitle emphasize * } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + key empty$ not and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "In {\em " journal * "\/}" * } + if$ + } + { "In " key * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * editor #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "In {\em " booktitle * "\/}" * } + if$ + } + { "In " key * } + if$ + } + { "In " format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +% urlbst... +% Functions for making hypertext links. +% In all cases, the stack has (link-text href-url) +% +% make 'null' specials +FUNCTION {make.href.null} +{ + pop$ +} +% make hypertex specials +FUNCTION {make.href.hypertex} +{ + "\special {html: }" * swap$ * + "\special {html:}" * +} +% make hyperref specials +FUNCTION {make.href.hyperref} +{ + "\newline\href {" swap$ * "} {\path{" * swap$ * "}}" * +} +FUNCTION {make.href} +{ hrefform #2 = + 'make.href.hyperref % hrefform = 2 + { hrefform #1 = + 'make.href.hypertex % hrefform = 1 + 'make.href.null % hrefform = 0 (or anything else) + if$ + } + if$ +} + +% If inlinelinks is true, then format.url should be a no-op, since it's +% (a) redundant, and (b) could end up as a link-within-a-link. +% Likewise if the url is empty. +% Likewise if doi is present, on the assumption that +% url most likely redundantly specifies the same info as those fields; this +% seems to be what people do in practice. +FUNCTION {format.url} +{ inlinelinks #1 = url empty$ or + doi empty$ not or + howpublished empty$ not or + { "" } + { hrefform #1 = + { % special case -- add HyperTeX specials + urlintro "\url{" url * "}" * url make.href.hypertex * } + { urlintro "\url{" * url * "}" * } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { "" } + { eprintprefix eprint * eprinturl eprint * make.href } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { doiprefix doi * doiurl doi * make.href } + if$ +} + +FUNCTION {format.pubmed} +{ pubmed empty$ + { "" } + { pubmedprefix pubmed * pubmedurl pubmed * make.href } + if$ +} + +% Output a URL. We can't use the more normal idiom (something like +% `format.url output'), because the `inbrackets' within +% format.lastchecked applies to everything between calls to `output', +% so that `format.url format.lastchecked * output' ends up with both +% the URL and the lastchecked in brackets. +% +% If the `urlnewline' field is present, output \newline before the +% url value. +FUNCTION {output.url} +{ url empty$ + 'skip$ + { new.block + format.url output + urlnewline empty$ not + { "\newline " write$ } + 'skip$ + if$ + format.lastchecked output + } + if$ +} + +FUNCTION {output.web.refs} +{ + new.block + inlinelinks + 'skip$ % links were inline -- don't repeat them + { + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ + addpubmedresolver pubmed empty$ not and + { format.pubmed output.nonnull } + 'skip$ + if$ + } + if$ +} + +% Wrapper for output.bibitem.original. +% If the URL field is not empty, set makeinlinelink to be true, +% so that an inline link will be started at the next opportunity +FUNCTION {output.bibitem} +{ outside.brackets 'bracket.state := + output.bibitem.original + inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and + { #1 'makeinlinelink := } + { #0 'makeinlinelink := } + if$ +} + +% Wrapper for fin.entry.original +FUNCTION {fin.entry} +{ output.web.refs % urlbst + makeinlinelink % ooops, it appears we didn't have a title for inlinelink + { possibly.setup.inlinelink % add some artificial link text here, as a fallback + linktextstring output.nonnull } + 'skip$ + if$ + bracket.state close.brackets = % urlbst + { "]" * } + 'skip$ + if$ + fin.entry.original + newpage empty$ not + { "\newpage " write$ } + 'skip$ + if$ +} + +% Webpage entry type. +% Title and url fields required; +% author, note, year, month, and lastchecked fields optional +% See references +% ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm +% http://www.classroom.net/classroom/CitingNetResources.html +% http://neal.ctstateu.edu/history/cite.html +% http://www.cas.usf.edu/english/walker/mla.html +% for citation formats for web pages. +FUNCTION {webpage} +{ output.bibitem + author empty$ + { editor empty$ + 'skip$ % author and editor both optional + { format.editors output.nonnull } + if$ + } + { editor empty$ + { format.authors output.nonnull } + { "can't use both author and editor fields in " cite$ * warning$ } + if$ + } + if$ + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ + format.title "title" output.check + inbrackets onlinestring output + new.block + year empty$ + 'skip$ + { format.date "year" output.check } + if$ + % We don't need to output the URL details ('lastchecked' and 'url'), + % because fin.entry does that for us, using output.web.refs. The only + % reason we would want to put them here is if we were to decide that + % they should go in front of the rather miscellaneous information in 'note'. + new.block + note output + fin.entry +} +% ...urlbst to here + + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + new.block + crossref missing$ + { journal emphasize "journal" output.check + possibly.setup.inlinelink format.vol.num.pages output% urlbst + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + howpublished address new.block.checkb + howpublished output + address output + format.date output + new.block + note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + publisher "publisher" output.check + address output + format.edition output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + address empty$ + { organization publisher new.sentence.checkb + organization output + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + new.sentence + organization output + publisher output + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + address output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.btitle "title" output.check + author empty$ + { organization empty$ + { address new.block.checka + address output + } + 'skip$ + if$ + } + { organization address new.block.checkb + organization output + address output + } + if$ + format.edition output + format.date output + new.block + note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + new.block + "Master's thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title output + howpublished new.block.checka + howpublished output + format.date output + new.block + note output + fin.entry + empty.misc.check +} + +FUNCTION {online} +{ misc } + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.btitle "title" output.check + new.block + "PhD thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.btitle "title" output.check + format.bvolume output + format.number.series output + address empty$ + { editor empty$ + { publisher new.sentence.checka } + { organization publisher new.sentence.checkb + organization output + } + if$ + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + new.sentence + editor empty$ + 'skip$ + { organization output } + if$ + publisher output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst + format.title "title" output.check + new.block + note "note" output.check + format.date output + fin.entry +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sept."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Softw. Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput.-Aided Design Integrated Circuits"} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Programming"} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Gr."} + +MACRO {toms} {"ACM Trans. Math. Softw."} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."} + +MACRO {tcs} {"Theoretical Comput. Sci."} + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't := + nameptr numnames = t "others" = and + { "et al" * } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.urlbst.variables} % urlbst +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/macros/latex/contrib/tugboat/tugboat.dtx b/macros/latex/contrib/tugboat/tugboat.dtx new file mode 100644 index 0000000000..176107a4d9 --- /dev/null +++ b/macros/latex/contrib/tugboat/tugboat.dtx @@ -0,0 +1,4011 @@ +% \iffalse (this is a meta-comment (so they say)) +% $Id: tugboat.dtx 217 2018-12-14 18:48:06Z karl $ +% tugboat.dtx - main source for LaTeX TUGboat classes. +% +% Copyright 1994-2018 TeX Users Group. +% +% This file is part of the tugboat package. +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% \fi +% +% \section{Document preambles} +% +% \begin{macrocode} +%\NeedsTeXFormat{LaTeX2e}[1994/12/01] +%<*dtx> +\ProvidesFile {tugboat.dtx} +% +%\ProvidesClass {ltugboat} +%\ProvidesClass {ltugproc} +%\ProvidesPackage{ltugboat} +%\ProvidesPackage{ltugproc} +% \ProvidesPackage{ltugcomn} + [2018-12-14 v2.21 +% TUGboat journal class% +% TUG conference proceedings class% +% TUG compatibility package% +% TUGboat `common macros' package% +%<*dtx> + TUG macros source file% +% + ] +% \end{macrocode} +% +% ^^A behold, a horrible hack... +% \begin{macrocode} +%<*dtx> +\newif\ifoldlongtable +% +% \end{macrocode} +% +% \iffalse +% +% Note that the version control Id above relates to the number of times +% the file has been checked-in, which relates to a development process +% taking place on several machines, rather than the incidence of +% significant change; the definitive version number is that in the +% \Provides* things, while the $Id may provide a clue as to the latest +% date the documentation was worked on +% +% Code to compile the thing using \LaTeXe. +% +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +% +\usepackage{ltugcomn} % generated using the .ins file +% +\usepackage{array,longtable} +% +% if longtable.sty is the most recent, then it doesn't need +% \cs{setlongtables}, so we avoid the setlong.tab game +\GetFileInfo{longtable.sty} +\def\extractdate#1/#2/#3\relax{\def\fileyear{#1}% + \def\filemonth{#2}% + \def\fileday{#3}} +\expandafter\extractdate\filedate\relax +\expandafter\ifnum\fileyear>1996\relax + \oldlongtablefalse +\else + \oldlongtabletrue + \expandafter\ifnum\fileyear=1996\relax + \expandafter\ifnum\filemonth>5\relax + \oldlongtablefalse + \else + \expandafter\ifnum\filemonth=5\relax + \expandafter\ifnum\fileday>23\relax + \oldlongtablefalse + \fi + \fi + \fi + \fi +\fi +\ifoldlongtable + \InputIfFileExists{setlong.tab}{}% if this file exists, it should +% % contain (only) \setlongtables + {\typeout{*** create a file `setlong.tab' containing only} + \typeout{***\space\space\space\string\setlongtables} + \typeout{*** to get the tables of commands, etc., lined up}} +\fi +% +\begin{document} + \GetFileInfo{tugboat.dtx} + \title{The \textsf{tugboat} package\thanks{This file + has version number \fileversion, last + revised \filedate}} + \author{The \TUB{} team} + \date{\filedate} + \maketitle + \tableofcontents + \DocInput{tugboat.dtx} +\end{document} +% +% \end{macrocode} +% +% \fi +% +% \section{Introduction} +% +% This file contains all the macros for typesetting \TUB{} with +% both plain \TeX\ and \LaTeXe. +% \subsection{Summary of control sequences} +% +% Abbreviations. Just a listing with indications of expansion where +% that may not be obvious. For full definitions, see real code below +% (Section~\ref{abbr-logo}). +% +% \begin{longtable}{lp{3in}} +% |\AllTeX|& (\La)\TeX\\ +% |\AMS|& American Mathematical Society\\ +% |\AmSTeX|&\\ +% |\aw|& \aw\ (abbreviation for Addison-Wesley)\\ +% |\API|&\\ +% |\AW|& Addison-Wesley\\ +% |\BibTeX|&\\ +% |\CandT|& Computers \& Typesetting\\ +% |\ConTeXt|& \ConTeXt\\ +% |\Cplusplus|& C++\\ +% |\DTD|&\\ +% |\DVD|&\\ +% |\DVI|&\\ +% |\DVIPDFMx|& \DVIPDFMx\\ +% |\DVItoVDU|& DVItoVDU\\ +% |\ECMA|&\\ +% |\EPS|&\\ +% |\eTeX|& \eTeX\\ +% |\ExTeX|& \ExTeX\\ +% |\Ghostscript|&\\ +% |\Hawaii|& \Hawaii\\ +% |\HTML|&\\ +% |\ISBN|& ISBN\\ +% |\ISO|&\\ +% |\ISSN|& ISSN\\ +% |\JTeX|&\\ +% |\JoT|& The Joy of \TeX\\ +% |\LaTeX|&\\ +% |\LyX|&\\ +% |\MacOSX|& Mac OS X\\ +% |\MathML|&\\ +% |\Mc|& M with raised c\\ +% |\MF|& \MF\\ +% |\mf|& \textsc{Metafont}\\ +% |\MFB|& The Metafontbook\\ +% |\MP|& \MP\\ +% |\mp|& MetaPost (in text only: still `\ensuremath{\mp}' in math)\\ +% |\OMEGA|& Omega `logo' (\ensuremath{\Omega})\\ +% |\OCP|& Omega compiled process\\ +% |\OOXML|&\\ +% |\OTP|& Omega translation process\\ +% |\mtex|& multilingual \TeX\\ +% |\NTS|& New Typesetting System\\ +% |\pcMF|& pcMF\\ +% |\PCTeX|&\\ +% |\pcTeX|&\\ +% |\Pas|& Pascal\\ +% |\PiCTeX|&\\ +% |\plain|& plain (in typewriter font)\\ +% |\POBox|& P. O. Box\\ +% |\PS|& PostScript (with hyphenation)\\ +% |\SC|& Steering Committee\\ +% |\SGML|& SGML\\ +% |\SliTeX|&\\ +% |\slMF|& Metafont, slanted: deprecated: use +% \cs{textsl} instead \\ +% |\stTeX|& \TeX{} for the Atari ST\\ +% |\SVG|&\\ +% |\TANGLE|&\\ +% |\TB|& The \TeX book\\ +% |\TeX|& (Although nearly every package defines this, +% most, including plain, are missing the +% spacefactor adjustment)\\ +% |\TeXhax|&\\ +% |\TeXMaG|& (defunct)\\ +% |\TeXtures|&\\ +% |\TeXXeT|&\\ +% |\Thanh|&\\ +% |\TFM|& \TFM\\ +% |\TUB|& \TUB\\ +% |\TUG|& \TeX{} Users Group\\ +% |\UNIX|&\\ +% |\VAX|&\\ +% |\VnTeX|&\\ +% |\VorTeX|&\\ +% |\XeT|&\\ +% |\XeTeX|& reflected and lowered first `E'\\ +% |\XeLaTeX|& with extra space before `L'\\ +% |\XML|&\\ +% |\WEB|&\\ +% |\WEAVE|&\\ +% |\WYSIWYG|&\\ +% \end{longtable} +% +% Macros for things that are slightly more significant. +% +% \begin{longtable}{lp{.6\textwidth}} +% |\NoBlackBoxes|& turns off marginal rules marking overfull boxes\\ +% |\BlackBoxes|& turns them back on\\ +% |\newline|& horizontal glue plus a break\\ +% |\ifundefined#1|& checks argument with |\csname| against |\relax|\\ +% |\topsmash|& smashes above baseline (from AMSTeX)\\ +% |\botsmash|& smashes below baseline (from AMSTeX)\\ +% |\smash|& smashes both (from plain)\\ +% |\ulap|& lap upwards\\ +% |\dlap|& lap downwards\\ +% |\xlap|& reference point at center horizontally; 0 width\\ +% |\ylap|& reference point at center vertically; 0 height, depth\\ +% |\zlap|& combination |\xlap| and |\ylap|\\ +% |\basezero|& to avoid insertion of baselineskip and lineskip glue\\ +% |\nullhrule|& empty |\hrule|\\ +% |\nullvrule|& empty |\vrule|\\ +% |\makestrut[#1;#2]|& ad hoc struts; |#1|=height, |#2|=depth\\ +% |\today|& today's date\\ +% |\SetTime|& converts |\time| to hours, minutes\\ +% |\now|& displays time in hours and minutes\\ +% |\Now|& shows current date and time\\ +% |\ifPrelimDraft|& flag to indicate status as preliminary draft\\ +% |\rtitlex|& \TUB{} volume and number info for running head\\ +% |\midrtitle|& information for center of running head\\ +% |\rtitlenexttopage|& next to page number in running head\\ +% |\HorzR@gisterRule|& pieces of registration marks (`trimmarks')\\ +% |\DownShortR@gisterRule|&\\ +% |\UpShortR@gisterRule|&\\ +% |\ttopregister|& top registration line with `T' in center\\ +% |\tbotregister|& bottom registration line with inverted `T' in center\\ +% |\topregister|& register actually used\\ +% |\botregister|&\\ +% |\raggedskip|& parameters used for ragged settings\\ +% |\raggedstretch|&\\ +% |\raggedparfill|&\\ +% |\raggedspaces|&\\ +% |\raggedright|&\\ +% |\raggedleft|&\\ +% |\raggedcenter|&\\ +% |\normalspaces|&\\ +% |\raggedbottom|&\\ +% |\bull|& square bullet\\ +% |\cents|& `cents' sign\\ +% |\Dag|& superscripted dagger\\ +% |\careof|& c/o\\ +% |\sfrac|& slashed fraction (arguments optionally\\ +% & separated by a slash)\\ +% |\cs|& control sequence name\\ +% & |\cs{name}|$\rightarrow$\cs{name}\\ +% |\env|& environment name \\ +% & |\env{name}|$\rightarrow$\env{name}\\ +% |\meta|& meta-argument name\\ +% & |\meta{name}|$\rightarrow$\meta{name}\\ +% |\dash|& en-dash surrounded by thinspaces; only breakable AFTER\\ +% |\Dash|& em-dash, as above\\ +% |\hyph|& permit automatic hyphenation after an actual hyphen\\ +% |\slash|& `breakable' slash\\ +% |\nth|& for obtaining `1\textsuperscript{st}', +% `2\textsuperscript{nd}', 3\textsuperscript{rd}, +% etc.\\ +% |\tubissue|& gets |\TUB| followed by volume and issue numbers\\ +% |\xEdNote|& Editor's Note:\\ +% |\Review:|& Review: (for title of book review article)\\ +% |\reviewitem|& begin data for item being reviewed\\ +% |\revauth|& with one argument, author(s) of item being reviewed\\ +% |\revtitle|& with one argument, title of \ldots \\ +% |\revpubinfo|& with one argument, other info pertaining to \ldots \\ +% |\endreviewitem|& end data for item being reviewed\\ +% |\booktitle|& with one argument, format book title in text\\ +% |\Input|& |\input| with some other bookkeeping for +% case where multiple articles are put together\\ +% |\TBremark|& reminder to \TUB{} editorial staff\\ +% |\TBEnableRemarks|& enable \cs{TBremark}s (normally suppressed)\\ +% |\pagexref|& used to write out page numbers to screen and\\ +% |\pagexrefON|& external files\\ +% |\pagexrefOFF|&\\ +% |\xrefto|& used for symbolic cross-reference to other pages\\ +% |\xreftoON|& in \TUB{}\\ +% |\xreftoOFF|&\\ +% |\TBdriver|& marks code which only takes effect when articles +% are run together in a driver file\\ +% \iffalse % these two were defined but never used! -- remove them +% % from the documentation, at least (further research needed) +% |\signatureat|& \\ +% |\signaturepercent|&\\ +% \fi +% |\signaturemark|& items for signatures\\ +% |\signaturewidth|&\\ +% \end{longtable} +% +% \StopEventually{} +% +% \section{\LaTeXe{} \TUB{} class file} +% +% \subsection{Setup and options} +% +% Check for reloading. Hmmm\dots Does this happen with \LaTeXe\ +% classes? Probably, in fact, as well that it doesn't, since the +% \cs{tugstyinit} referenced here doesn't exist; however, it's +% possible that we might need a similar mechanism in the future, so we +% retain its skeleton, without fleshing out the \cs{tugstyinit} bones. +% +% \begin{macrocode} +%<*ltugboatcls> +\csname tugstyloaded@\endcsname +\def\tugstyloaded@{\tugstyinit\endinput} +% \end{macrocode} +% +% Acquire a name for this class if we don't already have one (by +% virtue of having been loaded by |tugproc.cls|). This name will be +% used in error messages and the like. +% +% \begin{macrocode} +\providecommand{\@tugclass}{ltugboat} +% \end{macrocode} +% +% Warnings/error messages/information messages\Dash if we're using +% \LaTeXe{} we can use the \cs{Class*} commands: +% +% \begin{macrocode} +\def\TBInfo{\ClassInfo{\@tugclass}} +\def\TBError{\ClassError{\@tugclass}} +\def\TBWarning{\ClassWarning{\@tugclass}} +\def\TBWarningNL{\ClassWarningNoLine{\@tugclass}} +% \end{macrocode} +% +% |draft| vs.\ |preprint| vs.\ |final|. +% +% \begin{macrocode} +\newif\ifpreprint +\def\preprint{\preprinttrue} +\DeclareOption{draft}{% + \AtEndOfClass{% + \setcounter{page}{901}% + % + % Put a question mark into the page number in draft mode. + \let\tuborigthepage = \thepage + \def\thepage{% + \ifnum\value{page}>900 + \textsl{?\,\@arabic{\numexpr\the\c@page-900\relax}}% + \else + \arabic{page}% + \fi}% + % + \BlackBoxes + \def\MakeRegistrationMarks{}% + \PrelimDrafttrue + }% +} +\DeclareOption{preprint}{% + \preprinttrue +} +\DeclareOption{final}{% + \AtEndOfClass{% + \let\thepage=\tuborigthepage + \NoBlackBoxes + % Insert draft date into the header even with [final], if we are not + % doing a production run. (tugboat.dates sets up page numbers + % above 900 in such pseudo-draft mode.) We use [final] in the first + % place for this case because draft can change page layout, wrt + % registration marks, etc. + \ifnum\value{page}>900 \PrelimDrafttrue \else \PrelimDraftfalse \fi + \@tubrunningfull + }% +} +% \end{macrocode} +% +% The rules dictate that the output should be set using a 10pt base +% font. +% +% \begin{macrocode} +\DeclareOption{11pt}{% + \TBWarning{The \@tugclass\space class only supports 10pt fonts: + \MessageBreak option \CurrentOption\space ignored}% +} +\DeclareOption{12pt}{\csname ds@11pt\endcsname} +% \end{macrocode} +% +% Similarly, ignore one/two-side options. +% +% \begin{macrocode} +\DeclareOption{oneside}{\TBWarning{Option \CurrentOption\space ignored}} +\DeclareOption{twoside}{\ds@oneside} +% \end{macrocode} +% +% There are these people who seem to think |tugproc| is an option rather +% than a class\dots{} (Note that it's already been filtered out if we +% were calling from |ltugproc|.) +% +% \begin{macrocode} +\DeclareOption{tugproc}{% + \TBWarning{Option \CurrentOption\space ignored: use class ltugproc + instead of \@tugclass}% +} +% \end{macrocode} +% +% Option |rawcite| (the default) specifies the default citation +% mechanism (as built-in to \LaTeX); option |harvardcite| specifies +% the author-date citation mechanism defined in +% section~\ref{sec:citations} below. +% +% \begin{macrocode} +\DeclareOption{rawcite}{\let\if@Harvardcite\iffalse} +\DeclareOption{harvardcite}{\let\if@Harvardcite\iftrue} +% \end{macrocode} +% +% Option |extralabel| (the default) specifies that the publication +% years of two successive references with otherwise identical labels +% will be tagged with distinguishing letters; option |noextralabel| +% causes those letters to be suppressed. Note that (a) no two +% references will in any case have the same labels in the default +% (plain) |rawcite| setup, and that (b) the distinguishing letters +% appear in the labels themselves; the reader can work out the +% correspondence one with the other\dots +% +% \begin{macrocode} +\DeclareOption{extralabel}{\let\UseExtraLabel\@firstofone} +\DeclareOption{noextralabel}{\let\UseExtraLabel\@gobble} +% \end{macrocode} +% +% The section-numbering style, so that we can allow the same heading +% layout as in the plain macros. +% \changes{v1.4a}{1996/09/14}{Added nonumber and numbersec (default) +% options} +% +% \begin{macrocode} +\DeclareOption{numbersec}{\let\if@numbersec\iftrue} +\DeclareOption{nonumber}{\let\if@numbersec\iffalse} +% \end{macrocode} +% +% Minimal running headers/footers contain just the TUGboat volume/issue +% identification and page numbers. `runningfull' is the default, and +% includes title and author. `runningoff' makes both headers and +% footers empty. +% +% \begin{macrocode} +\DeclareOption{runningoff}{\AtEndOfClass{\@tubrunningoff}} +\DeclareOption{runningminimal}{\AtEndOfClass{\@tubrunningminimal}} +\DeclareOption{runningfull}{\AtEndOfClass{\@tubrunningfull}} +% \end{macrocode} +% +% \begin{macro}{\if@tubtwocolumn} +% Occasionally (|tb107jackowski|, and past conference preprints), we +% need the option |onecolumn|. For alternative approaches to one-column +% articles, see |tb92hagen-euler| and |tb78milo|. +% +% \begin{macrocode} +\newif\if@tubtwocolumn \@tubtwocolumntrue +\DeclareOption{onecolumn}{\@tubtwocolumnfalse} +% \end{macrocode} +% \end{macro} +% +% Any other options, we pass on to |article.cls| before we load it: +% +% \begin{macrocode} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +% \end{macrocode} +% +% Request default options (draft mode, standard citation, numbered +% sections, etc.), process all options, and then get the base document +% class on top of which we reside, namely |article|. Always call +% |article| with the |twoside| option, since we want the ability to have +% odd/even headers/footers. +% +% \begin{macrocode} +\ExecuteOptions{draft,extralabel,numbersec,rawcite,runningminimal} +\ProcessOptions +\LoadClass[twoside]{article} +% \end{macrocode} +% +% Various fonts used throughout. Some effort has been made to +% suppress these things with explicit sizes in the macro name +% (\cs{tensl} is an example below), but keeping in step with the +% documentation is one thing that restricts such a move. +% +% \begin{macrocode} +\def\sectitlefont{\fontfamily\sfdefault\fontseries{bx}\fontshape{n}% + \fontsize\@xviipt\stbaselineskip\selectfont} +\def\tensl{\fontseries{m}\fontshape{sl}\fontsize\@xpt\@xiipt + \selectfont} +% \end{macrocode} +% +% This font selection command is used \emph{only} for the `Editor's +% Note' introduction to notes; sadly it makes explicit reference to +% \textsc{cmr}, and Barbara Beeton has agreed that the reference may be +% constructed to use the current family such that, if no upright +% italic is defined, ordinary italics are used. A project for +% later\dots +% +% \begin{macrocode} +\def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}% + \selectfont} +% +% \end{macrocode} +% +% +% If Ulrik Vieth's |mflogo.sty| is around, we'll use it. Otherwise +% (pro tem, at least) we'll warn the user and define the absolute +% minimum of machinery that \TUB{} requires (that which was used +% prior to the invention of \LaTeXe). +% \begin{macrocode} +%<*common> +\IfFileExists{mflogo.sty}% + {\RequirePackage{mflogo}}% +% {\TBWarning +% {\PackageWarning{ltugcomn} + {Package mflogo.sty not available --\MessageBreak + Proceeding to emulate mflogo.sty} + \DeclareRobustCommand{\logofamily}{% + \not@math@alphabet\logofamily\relax + \fontencoding{U}\fontfamily{logo}\selectfont} + \DeclareTextFontCommand{\textlogo}{\logofamily} + \def\MF{\textlogo{META}\-\textlogo{FONT}\@} + \def\MP{\textlogo{META}\-\textlogo{POST}\@} + \DeclareFontFamily{U}{logo}{} + \DeclareFontShape{U}{logo}{m}{n}{% + <8><9>gen*logo% + <10><10.95><12><14.4><17.28><20.74><24.88>logo10% + }{} + \DeclareFontShape{U}{logo}{m}{sl}{% + <8><9>gen*logosl% + <10><10.95><12><14.4><17.28><20.74><24.88>logosl10% + }{} + \DeclareFontShape{U}{logo}{m}{it}{% + <->ssub*logo/m/sl% + }{}% + } +% \end{macrocode} +% +% \subsection{Resetting at start of paper} +% +% \begin{macro}{\ResetCommands} +% \begin{macro}{\AddToResetCommands} +% \begin{macro}{\StartNewPaper} +% We store a set of commands that should be executed at the start of +% each paper, before any paper-specific customisation. These commands +% (stored in the token register \cs{ResetCommands}) include things +% suc as resetting section and footnote numbers, re-establishing +% default settings of typesetting parameters, and so on. The user (or +% more typically, editor) may execute the commands by using the +% command \cs{StartNewPaper}. Things I've not yet thought of may be +% added to the list of commands, by +% \begin{macrocode} +\newtoks\ResetCommands +\ResetCommands{% + \setcounter{part}{0}% + \setcounter{section}{0}% + \setcounter{footnote}{0}% + \authornumber\z@ +} +\newcommand{\AddToResetCommands}[1]{% + \AddToResetCommands\expandafter{\AddToResetCommands#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Helpful shorthand (common code with Plain styles)} +% +% \cs{makeescape}, \dots, \cs{makecomment} allow users to change the +% category code of a single character a little more easily. These +% require that the character be addressed as a control sequence: +% e.g., |\makeescape\/| will make `|/|' an escape character. +% +% \begin{macrocode} +%<*!latex> +\def\makeescape#1{\catcode`#1=0 } +\def\makebgroup#1{\catcode`#1=1 } +\def\makeegroup#1{\catcode`#1=2 } +\def\makemath #1{\catcode`#1=3 } +% +%<*latex> +\def\makeescape#1{\catcode`#1=\z@} +\def\makebgroup#1{\catcode`#1=\@ne} +\def\makeegroup#1{\catcode`#1=\tw@} +\def\makemath #1{\catcode`#1=\thr@@} +% +\def\makealign #1{\catcode`#1=4 } +\def\makeeol #1{\catcode`#1=5 } +\def\makeparm #1{\catcode`#1=6 } +\def\makesup #1{\catcode`#1=7 } +\def\makesub #1{\catcode`#1=8 } +\def\makeignore#1{\catcode`#1=9 } +\def\makespace #1{\catcode`#1=10 } +\def\makeletter#1{\catcode`#1=11 } +\chardef\other=12 +\let\makeother\@makeother +\def\makeactive#1{\catcode`#1=13 } +\def\makecomment#1{\catcode`#1=14 } +% \end{macrocode} +% |\savecat#1| and |\restorecat#1| will save and restore the category +% of a given character. These are useful in cases where one doesn't +% wish to localize the settings and therefore be required to globally +% define or set things. +% \begin{macrocode} +\def\savecat#1{% + \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}} +\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname} +%\savecat\@ +%\makeletter\@ +% \end{macrocode} +% +% |\SaveCS#1| and |\RestoreCS#1| save and restore `meanings' of control +% sequences. Again this is useful in cases where one doesn't want to +% localize or where global definitions clobber a control sequence which +% is needed later with its `old' definition. +% +% \begin{macrocode} +\def\SaveCS#1{\expandafter\let\csname saved@@#1\expandafter\endcsname + \csname#1\endcsname} +\def\RestoreCS#1{\expandafter\let\csname#1\expandafter\endcsname + \csname saved@@#1\endcsname} +% \end{macrocode} +% To distinguish between macro files loaded +% \begin{macrocode} +\def\plaintubstyle{plain} +\def\latextubstyle{latex} +% \end{macrocode} +% +% Control sequences that were first defined in \LaTeXe{} of +% 1995/06/01 (or later), but which we merrily use. Only define if +% necessary: +% +% \begin{macrocode} +\providecommand\hb@xt@{\hbox to} +\providecommand\textsuperscript[1]{\ensuremath{\m@th + ^{\mbox{\fontsize\sf@size\z@ + \selectfont #1}}}} +% \end{macrocode} +% (Note that that definition of \cs{textsuperscript} isn't robust, but +% probably doesn't need to be\dots What's more, it doesn't appear in +% the mythical 2.09 version of the package.) +% +% \subsection{Abbreviations and logos} +% \label{abbr-logo} +% +% Font used for the METAFONT logo, etc. +% \begin{macrocode} +\DeclareRobustCommand{\AllTeX}{(\La\kern-.075em)\kern-.075em\TeX} +\def\AMS{American Mathematical Society} +\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox + {$\mathcal{M}$}\kern-.125em$\mathcal{S}$} +\def\AmSLaTeX{\AmS-\LaTeX} +\def\AmSTeX{\AmS-\TeX} +\def\ANSI{\acro{ANSI}} +\def\API{\acro{API}} +\def\ASCII{\acro{ASCII}} +\def\aw{\acro{A\kern.04em\raise.115ex\hbox{-}W}} +\def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley} +% +% make \BibTeX work in slanted contexts too; it's common in titles, and +% especially burdensome to hack in .bib files. +\def\Bib{% + \ifdim \fontdimen1\font>0pt + B{\SMC\SMC IB}% + \else + B\textsc{ib}% + \fi +} +\def\BibLaTeX{\Bib\kern.02em \LaTeX} +\def\BibTeX{\Bib\kern-.08em \TeX} +% +\def\BSD{\acro{BSD}} +\def\CandT{\textsl{Computers \& Typesetting}} +% must not define \CJK, because the CJK package does. +% \end{macrocode} +% We place our \cs{kern} after \cs{-} so that it disappears if the +% hyphenation is taken: +% \begin{macrocode} +\def\ConTeXt{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt} +\def\CMkIV{\ConTeXt\ \MkIV} +\def\Cplusplus{C\plusplus} +\def\plusplus{\raisebox{.7ex}{$_{++}$}} +\def\CPU{\acro{CPU}} +\def\CSczabbr{\ensuremath{\cal C}\kern-.1667em\lower.5ex\hbox{$\cal S$}} +\def\CSS{\acro{CSS}} +\def\CSTUG{\CSczabbr\acro{TUG}} +\def\CSV{\acro{CSV}} +\def\CTAN{\acro{CTAN}} +\def\DTD{\acro{DTD}} +\def\DTK{\acro{DTK}} +\def\DVD{\acro{DVD}} +\def\DVI{\acro{DVI}} +\def\DVIPDFMx{\acro{DVIPDFM}$x$} +\def\DVItoVDU{DVIto\kern-.12em VDU} +\def\ECMA{\acro{ECMA}} +\def\EPS{\acro{EPS}} +\DeclareRobustCommand{\eTeX}{\ensuremath{\varepsilon}-\kern-.125em\TeX} +\DeclareRobustCommand{\ExTeX}{% + \ensuremath{\textstyle\varepsilon_{\kern-0.15em\cal{X}}}\kern-.2em\TeX} +\def\FAQ{\acro{FAQ}} +\def\FTP{\acro{FTP}} +\def\Ghostscript{Ghost\-script} +\def\GNU{\acro{GNU}} +\def\GUI{\acro{GUI}} +\def\Hawaii{Hawai`i} +\def\HTML{\acro{HTML}} +\def\HTTP{\acro{HTTP}} +\def\IDE{\acro{IDE}} +\def\IEEE{\acro{IEEE}} +\def\ISBN{\acro{ISBN}} +\def\ISO{\acro{ISO}} +\def\ISSN{\acro{ISSN}} +\def\JPEG{\acro{JPEG}} +\def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}} +\def\JoT{\textsl{The Joy of \TeX}} +\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em% + M\kern.05em A\kern.1em-\kern.1em Script}} +\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em + $\m@th$\fontsize\sf@size\z@\selectfont + $\m@th\mathcal{A}$}% + \kern-.2em\lower.376ex\hbox{$\m@th\mathcal{M}$}\kern-.125em + {$\m@th\mathcal{S}$}-\TeX} +% This code +% is hacked from its definition of \cs{LaTeX}; it allows slants (for +% example) to propagate into the raised (small) `A': +% \begin{macrocode} +\DeclareRobustCommand{\La}% + {L\kern-.36em + {\setbox0\hbox{T}% + \vbox to\ht0{\hbox{$\m@th$% + \csname S@\f@size\endcsname + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }} +% \end{macrocode} +% +% We started with the intention that we wouldn't redefine \cs{LaTeX} +% when we're running under it, so as not to trample on an existing +% definition. However, this proves less than satisfactory; a single +% logo may be OK for the run of documents, but for \TUB{}, we find +% that something noticeably better is necessary; see section +% \ref{sec:latex-logo}. +% +% \begin{macrocode} +%\def\LaTeX{\La\kern-.15em\TeX} +\def\LyX{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX} +\def\MacOSX{Mac\,\acro{OS\,X}} +\def\MathML{Math\acro{ML}} +\def\Mc{\setbox\TestBox=\hbox{M}M\vbox + to\ht\TestBox{\hbox{c}\vfil}} % for Robert McGaffey +% \end{macrocode} +% +% If we're running under \LaTeXe, we're using (at least pro tem) Ulrik +% Vieth's |mflogo.sty| if it's present. Otherwise, we're using a +% short extract of Vieth's stuff. Either way, we don't need to +% specify \cs{MF} or \cs{MP} +% \begin{macrocode} +\def\mf{\textsc{Metafont}} +\def\MFB{\textsl{The \MF\kern1pt book}} +\def\MkIV{Mk\acro{IV}} +\let\TB@@mp\mp +\DeclareRobustCommand{\mp}{\ifmmode\TB@@mp\else MetaPost\fi} +% +% In order that the \cs{OMEGA} command will switch to using the TS1 +% variant of the capital Omega character if \texttt{textcomp.sty} is +% loaded, we define it in terms of the \cs{textohm} command. Note +% that this requires us to interpose a level of indirection, rather +% than to use \cs{let}\dots +% +% \begin{macrocode} +\DeclareRobustCommand{\NTG}{\acro{NTG}} +\DeclareRobustCommand{\NTS}{\ensuremath{\mathcal{N}\mkern-4mu + \raisebox{-0.5ex}{$\mathcal{T}$}\mkern-2mu \mathcal{S}}} +\DeclareTextSymbol{\textohm}{OT1}{'012} +\DeclareTextSymbolDefault{\textohm}{OT1} +\newcommand{\OMEGA}{\textohm} +\DeclareRobustCommand{\OCP}{\OMEGA\acro{CP}} +\DeclareRobustCommand{\OOXML}{\acro{OOXML}} +\DeclareRobustCommand{\OTF}{\acro{OTF}} +\DeclareRobustCommand{\OTP}{\OMEGA\acro{TP}} +\def\mtex{T\kern-.1667em\lower.424ex\hbox{\^E}\kern-.125emX\@} +% \end{macrocode} +% Revised definition of \cs{NTS} based on that used by Phil Taylor. +% \begin{macrocode} +\def\Pas{Pascal} +\def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}MF\@} +\def\PCTeX{PC\thinspace\TeX} +\def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}\TeX} +\def\PDF{\acro{PDF}} +\def\PGF{\acro{PGF}} +\def\PHP{\acro{PHP}} +\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\@} +\def\PiCTeX{\PiC\kern-.11em\TeX} +\def\plain{\texttt{plain}} +\def\PNG{\acro{PNG}} +\def\POBox{P.\thinspace O.~Box } +\def\PS{{Post\-Script}} +\def\PSTricks{\acro{PST}ricks} +\def\RTF{\acro{RTF}} +\def\SC{Steering Committee} +\def\SGML{\acro{SGML}} +\def\SliTeX{\textrm{S\kern-.06em\textsc{l\kern-.035emi}% + \kern-.06em\TeX}} +\def\slMF{\textsl{\MF}} % should never be used +\def\SQL{\acro{SQL}} +\def\stTeX{\textsc{st}\kern-0.13em\TeX} +\def\STIX{\acro{STIX}} +\def\SVG{\acro{SVG}} +\def\TANGLE{\texttt{TANGLE}\@} +\def\TB{\textsl{The \TeX book}} +\def\TIFF{\acro{TIFF}} +\def\TP{\textsl{\TeX}: \textsl{The Program}} +\DeclareRobustCommand{\TeX}{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@} +\def\TeXhax{\TeX hax} +\def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}% + \kern-.2267emG\@} +\def\TeXtures{\textit{Textures}} +\let\Textures=\TeXtures +\def\TeXworks{\TeX\kern-.07em works} +\def\TeXXeT{\TeX-{}-\XeT} +\def\TFM{\acro{TFM}} +\expandafter\ifx\csname XeTeXrevision\endcsname\relax +\def\Thanh{H\`an~Th\^e\llap{\raise 0.5ex\hbox{\'{}}}~Th\`anh}% non-XeTeX +\else +\def\Thanh{H\`an~Th\textcircumacute{e}~Th\`anh}% else xunicode drops the acute +\fi +\def\TikZ{Ti{\em k}Z} +\def\ttn{\textsl{TTN}\@} +\def\TTN{\textsl{\TeX{} and TUG News}} +\let\texttub\textsl % redefined in other situations +\def\TUB{\texttub{TUGboat}} +\def\TUG{\TeX\ \UG} +\def\tug{\acro{TUG}} +\def\UG{Users Group} +\def\UNIX{\acro{UNIX}} +% omit \UTF, since other packages use it for Unicode character access. +\def\VAX{V\kern-.12em A\kern-.1em X\@} +\def\VnTeX{V\kern-.03em n\kern-.02em \TeX} +\def\VorTeX{V\kern-2.7\p@\lower.5ex\hbox{O\kern-1.4\p@ R}\kern-2.6\p@\TeX} +\def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\@} +\def\XML{\acro{XML}} +\def\WEB{\texttt{WEB}\@} +\def\WEAVE{\texttt{WEAVE}\@} +\def\WYSIWYG{\acro{WYSIWYG}} +% \end{macrocode} +% +% Xe\TeX{} requires reflecting the first E, hence we complain if the +% graphics package is not present. (For plain documents, this can be +% loaded via Eplain.) Also, at Barbara's suggestion, if the current +% font is slanted, we rotate by 180 instead of reflecting so there is at +% least a chance to look ok. (The magic values here seem more or less +% ok for \texttt{cmsl} and \texttt{cmti}.) +% +% \begin{macrocode} +\def\tubreflect#1{% + \@ifundefined{reflectbox}{% + \TBerror{A graphics package must be loaded for \string\XeTeX}% + }{% + \ifdim \fontdimen1\font>0pt + \raise 1.75ex \hbox{\kern.1em\rotatebox{180}{#1}}\kern-.1em + \else + \reflectbox{#1}% + \fi + }% +} +\def\tubhideheight#1{\setbox0=\hbox{#1}\ht0=0pt \dp0=0pt \box0 } +\def\XekernbeforeE{-.125em} +\def\XekernafterE{-.1667em} +\DeclareRobustCommand{\Xe}{\leavevmode + \tubhideheight{\hbox{X% + \setbox0=\hbox{\TeX}\setbox1=\hbox{E}% + \lower\dp0\hbox{\raise\dp1\hbox{\kern\XekernbeforeE\tubreflect{E}}}% + \kern\XekernafterE}}} +\def\XeTeX{\Xe\TeX} +\def\XeLaTeX{\Xe{\kern.11em \LaTeX}} +% +\def\XHTML{\acro{XHTML}} +\def\XSL{\acro{XSL}} +\def\XSLFO{\acro{XSL}\raise.08ex\hbox{-}\acro{FO}} +\def\XSLT{\acro{XSLT}} +% \end{macrocode} +% +% \subsection{General typesetting rules} +% +% \begin{macrocode} +\newlinechar=`\^^J +\normallineskiplimit=\p@ +\clubpenalty=10000 +\widowpenalty=10000 +\def\NoParIndent{\parindent=\z@} +\newdimen\normalparindent +\normalparindent=20\p@ +\def\NormalParIndent{\global\parindent=\normalparindent} +\NormalParIndent +\def\BlackBoxes{\overfullrule=5\p@} +\def\NoBlackBoxes{\overfullrule=\z@} +\def\newline{\hskip\z@\@plus\pagewd\break} +% \end{macrocode} +% +% Hyphen control: first, we save the hyphenpenalties in +% \cs{allowhyphens}. This allows us to permit hyphens temporarily in +% things like \cs{netaddress}es, which typically occur when +% \cs{raggedright} is set, but which need to be allowed to break at +% their artificial discretionaries. +% +% \begin{macrocode} +\edef\allowhyphens{\noexpand\hyphenpenalty\the\hyphenpenalty\relax + \noexpand\exhyphenpenalty\the\exhyphenpenalty\relax} +\def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M} +% \end{macrocode} +% +% \subsection{Utility registers and definitions} +% +% We define a few scratch registers (and the like) for transient use; +% they're all paired: an internal one (\cs{T@st*}) and an external one +% (\cs{Test*}). +% +% \begin{description} +% \item[\emph{Comment:}] Exercise for an idle day: find whether all +% these are necessary, or whether we can use the \LaTeX{} temporaries +% for some (or all) of the \cs{T@st*} ones. +% \item[\emph{Comment:}] (bb) All these registers are used in the +% plain version, |tugboat.sty|. +% \end{description} +% +% \begin{macrocode} +\newbox\T@stBox \newbox\TestBox +\newcount\T@stCount \newcount\TestCount +\newdimen\T@stDimen \newdimen\TestDimen +\newif\ifT@stIf \newif\ifTestIf +% \end{macrocode} +% +% Control sequence existence test, stolen from \TeX book exercise 7.7 +% (note that this provides functionality that in some sense duplicates +% something within \LaTeX). +% +% \begin{macrocode} +\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax } +% \end{macrocode} +% +% \LaTeX\ conventions which are also useful here. +% +% \begin{macrocode} +%<*!latex> + \let\@@input\input + \def\iinput#1{\@@input#1 } + \def\@inputcheck{\if\@nextchar\bgroup + \expandafter\iinput\else\expandafter\@@input\fi} + \def\input{\futurelet\@nextchar\@inputcheck} +% +% \end{macrocode} +% +% Smashes repeated from AMS-\TeX; plain \TeX{} implements only full +% |\smash|. +% +% \begin{macrocode} +\newif\iftop@ \newif\ifbot@ +\def\topsmash{\top@true\bot@false\smash@} +\def\botsmash{\top@false\bot@true\smash@} +\def\smash{\top@true\bot@true\smash@} +\def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}% + \else\let\next\makesm@sh\fi \next } +\def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@} +% \end{macrocode} +% +% Vertical `laps'; cf.\ |\llap| and |\rlap| +% +% \begin{macrocode} +\long\def\ulap#1{\vbox to \z@{\vss#1}} +\long\def\dlap#1{\vbox to \z@{#1\vss}} +% \end{macrocode} +% And centered horizontal and vertical `laps' +% \begin{macrocode} +\def\xlap#1{\hb@xt@\z@{\hss#1\hss}} +\long\def\ylap#1{\vbox to \z@{\vss#1\vss}} +\long\def\zlap#1{\ylap{\xlap{#1}}} +% \end{macrocode} +% Avoid unwanted vertical glue when making up pages. +% \begin{macrocode} +\def\basezero{\baselineskip\z@skip \lineskip\z@skip} +% \end{macrocode} +% Empty rules for special occasions +% \begin{macrocode} +\def\nullhrule{\hrule \@height\z@ \@depth\z@ \@width\z@ } +\def\nullvrule{\vrule \@height\z@ \@depth\z@ \@width\z@ } +% \end{macrocode} +% Support ad-hoc strut construction. +% \begin{macrocode} +\def\makestrut[#1;#2]{\vrule \@height#1 \@depth#2 \@width\z@ } +% \end{macrocode} +% Construct box for figure pasteup, etc.; +% height = \#1, width = \#2, rule thickness = \#3 +% \begin{macrocode} +\def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3 + \vbox to#1{\hrule \@height\T@stDimen \@depth\z@ + \vss\hb@xt@#2{\vrule \@width\T@stDimen + \hfil\makestrut[#1;\z@]% + \vrule \@width\T@stDimen}\vss + \hrule \@height\T@stDimen \@depth\z@}} +% \end{macrocode} +% Today's date, to be printed on drafts. Based on \TeX book, p.406. +% \begin{macrocode} +%<*!latex> +\def\today{\number\day\space \ifcase\month\or + Jan \or Feb \or Mar \or Apr \or May \or Jun \or + Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi + \number\year} +% +% \end{macrocode} +% Current time; this may be system dependent! +% \begin{macrocode} +\newcount\hours +\newcount\minutes +\def\SetTime{\hours=\time + \global\divide\hours by 60 + \minutes=\hours + \multiply\minutes by 60 + \advance\minutes by-\time + \global\multiply\minutes by-1 } +\SetTime +\def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes} +\def\Now{\today\ \now} +\newif\ifPrelimDraft +\def\midrtitle{} % center of running heads +\def\rtitlenexttopage{\ifPrelimDraft \textsl{\small draft: \Now}\fi} +% \end{macrocode} +% +% \subsection{Ragged right and friends} +% +% \begin{macro}{\raggedskip} +% \begin{macro}{\raggedstretch} +% \begin{macro}{\raggedparfill} +% \begin{macro}{\raggedspaces} +% Plain \TeX{}'s definition of |\raggedright| doesn't permit any +% stretch, and results in too many overfull boxes. We also turn off +% hyphenation. This code lies somewhere between that of Plain \TeX{} +% and of \LaTeX{}. +% \begin{macrocode} +\newdimen\raggedskip \raggedskip=\z@ +\newdimen\raggedstretch \raggedstretch=5em % ems of font set now (10pt) +\newskip\raggedparfill \raggedparfill=\z@\@plus 1fil +\def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\raggedright} +% \begin{macro}{\raggedleft} +% \begin{macro}{\raggedcenter} +% \begin{macro}{\normalspaces} +% Some applications may have to add stretch, in order to avoid +% all overfull boxes. We define the following uses of the above +% skips, etc. +% \begin{macrocode} +\def\raggedright{% + \nohyphens + \rightskip=\raggedskip\@plus\raggedstretch \raggedspaces + \parfillskip=\raggedparfill +} +\def\raggedleft{% + \nohyphens + \leftskip=\raggedskip\@plus\raggedstretch \raggedspaces + \parfillskip=\z@skip +} +\def\raggedcenter{% + \nohyphens + \leftskip=\raggedskip\@plus\raggedstretch + \rightskip=\leftskip \raggedspaces + \parindent=\z@ \parfillskip=\z@skip +} +\def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Miscellaneous useful stuff. Note that \LaTeXe{} defines a robust +% \cs{,}, but that we provide a new definition of |~| by redefining +% \cs{\nobreakspace} (\cs{DeclareRobustCommand} doesn't +% mind redefinition, fortunately). This is based on the version in +% AMS-\TeX---the \LaTeXe{} version (|ltspace.dtx|) has \cs{leavevmode} +% and does not do anything with the surrounding space(s). Our version +% messes up with the \cs{pfill} used in |doc|-generated indexes +% (\url{github.com/latex3/latex2e/issues/75}), but later (2018++) +% versions of |doc| should be protected against our redefinition. +% \begin{macrocode} +\let\latexnobreakspace=\nobreakspace +\DeclareRobustCommand{\nobreakspace}{\unskip\nobreak\ \ignorespaces} +% \end{macrocode} +% +% Plain \TeX{} defines \cs{newbox} as \cs{outer}. We solemnly +% preserve the following, which removes the \cs{outer}ness; of course, +% we carefully exclude it from what we generate\dots{} (\cs{outer}ness is a +% spawn of the devil, is it not? Barbara Beeton responded to the +% previous sentence ``\cs{outer}ness has its place: it avoids register +% buildup, hence running out of memory''. In another context, David +% Carlisle remarked that an error control mechanism that causes more +% confusing errors than it prevents is rather a poor one. This is +% perhaps not the place to conduct a serious debate\dots) +% +% \begin{macrocode} +\def\boxcs#1{\box\csname#1\endcsname} +\def\setboxcs#1{\setbox\csname#1\endcsname} +\def\newboxcs#1{\expandafter\newbox\csname#1\endcsname} +\let\gobble\@gobble +\def\vellipsis{% + \leavevmode\kern0.5em + \raise\p@\vbox{\baselineskip6\p@\vskip7\p@\hbox{.}\hbox{.}\hbox{.}} + } +\def\bull{\vrule \@height 1ex \@width .8ex \@depth -.2ex } +\def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}} +\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em + /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces} +\def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}} +% +\DeclareRobustCommand{\sfrac}[1]{\@ifnextchar/{\@sfrac{#1}}% + {\@sfrac{#1}/}} +\def\@sfrac#1/#2{\leavevmode\kern.1em\raise.5ex + \hbox{$\m@th\mbox{\fontsize\sf@size\z@ + \selectfont#1}$}\kern-.1em + /\kern-.15em\lower.25ex + \hbox{$\m@th\mbox{\fontsize\sf@size\z@ + \selectfont#2}$}} +% +% don't stay bold in description items, bold italic is too weird. +\DeclareRobustCommand\meta[1]{% + \ensuremath{\langle}% + \ifmmode \expandafter\mbox \fi % if in math + {\it #1\/}% no typewriter italics, please + \ensuremath{\rangle}% +} +% +% Use \tt rather than \texttt because italic typewriter is just too ugly, +% and upright works well enough in both italic and bold contexts. +\DeclareRobustCommand{\cs}[1]{{\tt \char`\\#1}} +% +% This command was defined much later than the other, so let's not +% conflict with any existing definitions that might be out there. +% Don't allow hyphenations or other line breaks. +\DeclareRobustCommand{\tubbraced}[1]{\mbox{\texttt{\char`\{#1\char`\}}}} +% +% Well, just the \begin part. Never seen it used. +\DeclareRobustCommand{\env}[1]{\cs{begin}\tubbraced{#1}} +% +% Not sure why we ever want this instead of LaTeX's \, (using \kern), +% but fine, just keeping it. +\DeclareRobustCommand{\thinskip}{\hskip 0.16667em\relax} +% +% \end{macrocode} +% +% We play a merry game with dashes, providing all conceivable options +% of breakability before and after. +% +% \begin{macrocode} +\def\endash{--} +\def\emdash{\endash-} +\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces} +\def\dash{\d@sh\nobreak\endash} +\def\Dash{\d@sh\nobreak\emdash} +\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}} +\def\rdash{\d@sh\nobreak\endash} +\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}} +\def\Rdash{\d@sh\nobreak\emdash} +% \end{macrocode} +% +% Hacks to permit automatic hyphenation after an actual hyphen, or +% after a slash. +% +% \begin{macrocode} +\def\hyph{-\penalty\z@\hskip\z@skip } +\def\slash{/\penalty\z@\hskip\z@skip } +% \end{macrocode} +% +% Adapted from |comp.text.tex| posting by Donald Arseneau, 26 May 93. +% \LaTeXe-isation added by Robin Fairbairns. Destroys both the +% |TestCount|s. +% +% \begin{macrocode} +\def\nth#1{% + \def\reserved@a##1##2\@nil{\ifcat##1n% + 0% + \let\reserved@b\ensuremath + \else##1##2% + \let\reserved@b\relax + \fi}% + \TestCount=\reserved@a#1\@nil\relax + \ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives + \T@stCount=\TestCount + \divide\T@stCount by 100 \multiply\T@stCount by 100 + \advance\TestCount by-\T@stCount % n mod 100 + \ifnum\TestCount >20 \T@stCount=\TestCount + \divide\T@stCount by 10 \multiply\T@stCount by 10 + \advance\TestCount by-\T@stCount % n mod 10 + \fi + \reserved@b{#1}% + \textsuperscript{\ifcase\TestCount th% 0th + \or st% 1st + \or nd% 2nd + \or rd% 3rd + \else th% nth + \fi}% +} +% \end{macrocode} +% +% \subsection{Reviews} +% +% Format information on reviewed items for book review articles. +% For the \LaTeXe{} version, we follow Fairbairns' maxim, and define +% something that can even look like a \LaTeX{} macro\dots +% +% \begin{macrocode} +\def\Review{\@ifnextchar:{\@Review}{\@Review:}} +\def\@Review:{\@ifnextchar[%] + {\@Rev}% + {\@Rev[Book review]}} +\def\@Rev[#1]#2{{\ignorespaces#1\unskip:\enspace\ignorespaces + \slshape\mdseries#2}} +\def\reviewitem{\addvspace{\BelowTitleSkip}% + \def\revauth##1{\def\therevauth{##1, }\ignorespaces}% + \def\revtitle##1{\def\therevtitle{{\slshape##1}. }\ignorespaces}% + \def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}% +} +\def\endreviewitem{{\noindent\interlinepenalty=10000 + \therevauth\therevtitle\therevpubinfo\endgraf}% + \vskip\medskipamount +} +\def\booktitle#1{{\slshape#1\/}} +% \end{macrocode} +% +% \subsection{Dates, volume and issue numbers, etc.} +% +% Dates and other items which identify the volume and issue. +% \cs{issueseqno} is a sequential issue number starting from the +% first issue published; volume 15,4 has \cs{issueseqno=45}. +% +% To use: \begin{tabular}{l} +% |\vol 19, 1.|\\ +% |\issdate March 1998.|\\ +% |\issueseqno=58|\\ +% \end{tabular} +% +% Starting with volume 23 (nominal 2002), we have \cs{issyear} instead +% of \cs{issdate}, because issues don't have months any more. +% +% For production, these are set in a separate file, +% |tugboat.dates|, which is issue-specific. +% +% \begin{description} +% \item[\emph{Comment:}] I would like to make the code read a file +% |tugboat.dates| in the current directory or its parent. +% This is easy except under `odd' operating systems ({\small VMS} is +% an example that springs to mind, {\small RISC}os may be even +% worse) whose syntax is out of the ordinary. +% \end{description} +% +% \begin{macrocode} +\newcount\issueseqno \issueseqno=-1 +\def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}} +\def\volyr{} +\def\volno{} +\def\vol #1,#2.{\gdef\volno{#1\unskip}% + \gdef\issno{\ignorespaces#2\unskip}% + \setbox\TestBox=\hbox{\volyr}% + \ifdim \wd\TestBox > .2em \v@lx \fi } +\def\issyear #1.{\gdef\issdt{#1}\gdef\volyr{#1}% + \gdef\bigissdt{#1}% + \setbox\TestBox=\hbox{\volno}% + \ifdim \wd\TestBox > .2em \v@lx \fi } +\def\issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}% + \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}% + \setbox\TestBox=\hbox{\volno}% + \ifdim \wd\TestBox > .2em \v@lx \fi } +\vol 0, 0. +\issdate Thermidor, 9999. +% \end{macrocode} +% +% (The curious should know that \emph{Thermidor} was one of the French +% revolutionary month names\dots) +% +% For \LaTeX{} use, define a version of the issue declaration that can +% take or leave the old plain syntax +% +% \begin{macrocode} +%\def\tubissue#1(#2)% +%<*latex> +\def\tubissue#1{\@ifnextchar(%) + {\@tubissue@b{#1}} + {\@tubissue@a{#1}}} +\def\@tubissue@b#1(#2){\@tubissue@a{#1}{#2}} +\def\@tubissue@a#1#2% +% + {\TUB~#1, no.~#2} +% \end{macrocode} +% +% \TUB{} conventions include the sequential issue number in the file name. +% Permit this to be incorporated into file names automatically. +% If \(\mbox{issue number} = 11\), \cs{Input filnam} will read +% |tb11filnam.tex| +% +% \begin{macrocode} +\def\infil@{\jobname} +\def\Input #1 {\ifnum\issueseqno<0 + \def\infil@{#1}% + \else + \def\infil@{tb\number\issueseqno#1} + \fi + \edef\jobname{\infil@}\@readFLN + \@@input \infil@\relax + \if@RMKopen + \immediate\closeout\@TBremarkfile\@RMKopenfalse + \fi +} +% \end{macrocode} +% +% \cs{TBremark}s are things that need to be drawn to the attention of +% the editors; the conscientious author will include such things in +% the article file. By default, remarks are suppressed, but their +% appearance may be enabled by the \cs{TBEnableRemarks} command, which +% can be included in the configuration file |ltugboat.cfg| (or +% |ltugproc.cfg|, if that's what we're at). +% +% \begin{macrocode} +\newif\if@RMKopen \@RMKopenfalse +\newwrite\@TBremarkfile +\def\@TBremark#1{% + \if@RMKopen + \else + \@RMKopentrue\immediate\openout\@TBremarkfile=\infil@.rmk + \fi + \toks@={#1}% + \immediate\write\@TBremarkfile{^^J\the\toks@}% + \immediate\write16{^^JTBremark:: \the\toks@^^J}% +} +% \end{macrocode} +% +% We initialise \cs{TBremark} to ignore its argument (this used to +% involve a \cs{TBremarkOFF} which was cunningly defined exactly the +% same as \cs{gobble}) +% +% \begin{macrocode} +\let\TBremark=\gobble +% \end{macrocode} +% +% \cs{TBEnableRemarks} simply involves setting \cs{TBremark} to use +% the functional \cs{@TBremark} defined above. +% +% \begin{macrocode} +\def\TBEnableRemarks{\let\TBremark\@TBremark} +% \end{macrocode} +% +% For marking locations in articles that pertain to remarks +% in another file of editorial comments +% +% \begin{macrocode} +\def\TUBedit#1{} +% \end{macrocode} +% +% For using different filenames in the production process than those +% supplied by authors +% +% \begin{macrocode} +\def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}} +\newread\@altfilenames +\def\@readFLN{\immediate\openin\@altfilenames=\jobname.fln + \ifeof\@altfilenames\let\@result\relax\else + \def\@result{\@@input\jobname.fln }\fi + \immediate\closein\@altfilenames + \@result} +\@readFLN +\everyjob=\expandafter{\the\everyjob\@readFLN} +\InputIfFileExists{\jobname.fln}% + {\TBInfo{Reading alternative file file \jobname.fln}}{} +% \end{macrocode} +% +% The following needs to work entirely in \TeX's mouth +% \begin{macrocode} +\def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax + #1\else\csname file@@#1\endcsname\fi} +\def\fileinput#1{\@@input\@tubfilename{#1} } +% \end{macrocode} +% +% Write out (both to a file and to the log) the starting page number +% of an article, to be used for cross references and in contents. +% |\pagexref| is used for articles fully processed in the \TUB{} +% run. |\PageXref| is used for `extra' pages, where an item is +% submitted as camera copy, and only running heads (at most) are run. +% +% \begin{macrocode} +%<*!latex> +\def\pagexrefON#1{% + \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}% + \write\ppoutfile{% + \def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}% + } +\def\PageXrefON#1{% + \immediate\write-1{\def\expandafter + \noexpand\csname#1\endcsname{\number\pageno}}% + \immediate\write\ppoutfile{\def\expandafter + \noexpand\csname#1\endcsname{\number\pageno}}} +% +%<*latex> +\def\pagexrefON#1{% + \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}% + \write\ppoutfile{% + \def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}% + } +\def\PageXrefON#1{% + \immediate\write-1{\def\expandafter + \noexpand\csname#1\endcsname{\number\c@page}}% + \immediate\write\ppoutfile{\def\expandafter + \noexpand\csname#1\endcsname{\number\c@page}}} +% +\def\pagexrefOFF#1{} +\let\pagexref=\pagexrefOFF +\def\PageXrefOFF#1{} +\let\PageXref=\PageXrefOFF +\def\xreftoON#1{% + \ifundefined{#1}% + ???\TBremark{Need cross reference for #1.}% + \else\csname#1\endcsname\fi} +\def\xreftoOFF#1{???} +\let\xrefto=\xreftoOFF +% \end{macrocode} +% +% \cs{TBdriver} `marks code for use when articles are run together in +% a driver file'. Since we don't yet have a definition of that +% arrangement, we don't have a definition of \cs{TBdriver}. Its +% argument (which one presumes was intended as the code for this +% unusual state) is just gobbled. +% +% \begin{macrocode} +\let\TBdriver\gobble +% \end{macrocode} +% +% Some hyphenation exceptions: +% +% \begin{macrocode} +\ifx\tubomithyphenations\@thisisundefined +\hyphenation{Del-a-ware Dijk-stra Duane Eijk-hout + Flor-i-da Free-BSD Ghost-script Ghost-view + Hara-lam-bous Jac-kow-ski Karls-ruhe + Mac-OS Ma-la-ya-lam Math-Sci-Net + Net-BSD Open-BSD Open-Office + Pfa-Edit Post-Script Rich-ard Skoup South-all + Vieth VM-ware Win-Edt + acro-nym acro-nyms analy-sis ap-pen-di-ces ap-pen-dix asyn-chro-nous + bib-lio-graph-i-cal bit-map bit-mapped bit-maps buf-fer buf-fers bool-ean + col-umns com-put-able com-put-abil-ity cus-tom-iz-able + data-base data-bases + de-allo-cate de-allo-cates de-allo-cated de-allo-ca-tion + de-riv-a-tive de-riv-a-tives de-riv-a-ble der-i-va-tion dis-trib-ut-able + es-sence + fall-ing + half-way + in-fra-struc-ture + key-note + long-est + ma-gyar man-u-script man-u-scripts meta-table meta-tables + mne-mon-ic mne-mon-ics mono-space mono-spaced + name-space name-spaces + off-line over-view + pal-ettes par-a-digm par-a-dig-mat-ic par-a-digms + pipe-line pipe-lines + plug-in plug-ins pres-ent-ly pro-gram-mable + re-allo-cate re-allo-cates re-allo-cated re-printed + set-ups se-vere-ly spell-ing spell-ings stand-alone strong-est + sub-ex-pres-sion sub-tables sur-gery syn-chro-ni-city syn-chro-nous + text-height text-length text-width + time-stamp time-stamped time-stamps + vis-ual vis-ual-ly + which-ever white-space white-spaces wide-spread wrap-around +} +\fi +%\restorecat\@ +% +%<*classtail> +\PrelimDrafttrue +% \end{macrocode} +% \subsection{Page dimensions, glue, penalties etc} +% \begin{macrocode} +\textheight 54pc +\textwidth 39pc +\columnsep 1.5pc +\columnwidth 18.75pc +\hfuzz 1pt +\parindent \normalparindent +\parskip \z@ % \@plus\p@ +\leftmargini 2em +\leftmarginv .5em +\leftmarginvi .5em +\oddsidemargin \z@ +\evensidemargin \z@ +\topmargin -2.5pc +\headheight 12\p@ +\headsep 20\p@ +\marginparwidth 48\p@ +\marginparsep 10\p@ +\partopsep=\z@ +\topsep=3\p@\@plus\p@\@minus\p@ +\parsep=3\p@\@plus\p@\@minus\p@ +\itemsep=\parsep +% +% Ordinarily we typeset in two columns, but the onecolumn option +% goes to one. In which case we want to center the text block on an +% 8.5in width, given the default 72.27pt offset with margins of zero. +% We are always in LaTeX's twoside mode because of how we load article, +% and this is a good thing, since we want different headings. +\if@tubtwocolumn \twocolumn \else + \onecolumn + \textwidth=34pc + \oddsidemargin=30.8775pt + \evensidemargin=\oddsidemargin +\fi +% +\newdimen\pagewd \pagewd=\textwidth +\newdimen\trimwd \trimwd=\pagewd +\newdimen\trimlgt \trimlgt=11in +\newdimen\headmargin \headmargin=3.5pc +% \end{macrocode} +% +% In \LaTeXe, |twoside| option is forced on when +% |article.cls| is loaded. +% +% \subsection{Messing about with the \LaTeX{} logo} +% \label{sec:latex-logo} +% +% Barbara Beeton's pleas for \LaTeX{} logos that look right in any +% font shape provoked me to generate the following stuff that is +% configurable. +% +% Here's the command for the user to define a new version. The +% arguments are font family, series and shape, and then the two kern +% values used in placing the raised `A' of \LaTeX. +% +% \begin{macrocode} +\newcommand{\DeclareLaTeXLogo}[5]{\expandafter\def + \csname @LaTeX@#1/#2/#3\endcsname{{#4}{#5}}} +% \end{macrocode} +% +% The default values are as used in the source of \LaTeX{} itself: +% +% \begin{macrocode} +\def\@LaTeX@default{{.36}{.15}} +% \end{macrocode} +% +% More are defined in the initial version, for bold CM sans (which is +% used as \cs{SecTitleFont}), and CM italic medium and bold, and +% Bitstream Charter (which Nelson Beebe likes to use). Duplicate for +% Latin Modern. +% +% \begin{macrocode} +\DeclareLaTeXLogo{cmss}{bx}{n}{.3}{.15} +\DeclareLaTeXLogo{lmss}{bx}{n}{.3}{.15} +% +\DeclareLaTeXLogo{cmr}{m}{it}{.29}{.2} +\DeclareLaTeXLogo{lmr}{m}{it}{.29}{.2} +% +\DeclareLaTeXLogo{cmr}{m}{sl}{.29}{.15} +\DeclareLaTeXLogo{lmr}{m}{sl}{.29}{.15} +% +\DeclareLaTeXLogo{cmr}{bx}{it}{.29}{.2} +\DeclareLaTeXLogo{lmr}{bx}{it}{.29}{.2} +% +\DeclareLaTeXLogo{cmr}{bx}{sl}{.29}{.2} +\DeclareLaTeXLogo{lmr}{bx}{sl}{.29}{.2} +% +\DeclareLaTeXLogo{bch}{m}{n}{.2}{.08} +\DeclareLaTeXLogo{bch}{m}{it}{.2}{.08} +% \end{macrocode} +% +% Redefine \cs{LaTeX} to choose the parameters for the current font, +% or to use the default value otherwise: +% +% \begin{macrocode} +\DeclareRobustCommand{\LaTeX}{\expandafter\let\expandafter\reserved@a + \csname @LaTeX@\f@family/\f@series/\f@shape\endcsname + \ifx\reserved@a\relax\let\reserved@a\@LaTeX@default\fi + \expandafter\@LaTeX\reserved@a} +% \end{macrocode} +% +% Here's the body of what was originally \cs{LaTeX}, pulled out with its +% roots dripping onto the smoking ruin of original \LaTeX, and then +% bits stuck in on the side. +% +% \cs{@LaTeX@default} provides parameters as one finds in the +% original; other versions are added as needed. +% +% \begin{macrocode} +\newcommand{\@LaTeX}[2]{% + %\wlog{latex logo family=\f@family/\f@series/\f@shape -> #1, #2.}% + L\kern-#1em + {\sbox\z@ T% + \vbox to\ht0{\hbox{$\m@th$% + \csname S@\f@size\endcsname + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-#2em% + \TeX} +% \end{macrocode} +% +% \subsection{Authors, contributors, addresses, signatures} +% +% An article may have several authors (of course), so we permit an +% \cs{author} command for each of them. The names are then stored in +% a set of \cs{csname}s called \cs{author1}, \cs{author2}, \dots +% Similarly, there are several \cs{address} and \cs{netaddress} +% and \cs{PersonalURL} and \cs{ORCID} commands set up for each article. +% +% \begin{description} +% \item[\emph{Comment:}] I would like to make provision for several +% authors at the same address, but (short of preempting the |*| +% marker, which it would be nice to retain so as to preserve +% compatibility with the |plain| style) I'm not sure how one would +% signal it. +% \end{description} +% \begin{macrocode} +\def\theauthor#1{\csname theauthor#1\endcsname} +\def\theaddress#1{\csname theaddress#1\endcsname} +\def\thenetaddress#1{\csname thenetaddress#1\endcsname} +\def\thePersonalURL#1{\csname thePersonalURL#1\endcsname} +\def\theORCID#1{\csname theORCID#1\endcsname} +% \end{macrocode} +% +% The standard way of listing authors is to iterate from 1 to +% \cs{count@} and to pick the author names as we go. +% +% \begin{macrocode} +%\newcount\@tempcnta +\def\@defaultauthorlist{% + \@getauthorlist\@firstofone +} +% \end{macrocode} +% +% \cs{@getauthorlist} processes the author list, passing every bit of +% stuff that needs to be typeset to the macro specified as its argument. +% \begin{macrocode} +\def\@getauthorlist#1{% + \count@\authornumber + \advance\count@ by -2 + \@tempcnta0 +% \end{macrocode} +% +% Loop to output the first \ensuremath{n-2} of the \ensuremath{n} +% authors (the loop does nothing if there are two or fewer authors) +% +% \begin{macrocode} + \loop + \ifnum\count@>0 + \advance\@tempcnta by \@ne + #1{\ignorespaces\theauthor{\number\@tempcnta}\unskip, }% + \advance\count@ by \m@ne + \repeat + \count@\authornumber + \advance\count@ by -\@tempcnta + \ifnum\authornumber>0 +% \end{macrocode} +% +% If there are two or more authors, we output the penultimate author's +% name here, followed by `and' +% +% \begin{macrocode} + \ifnum\count@>1 + \count@\authornumber + \advance\count@ by \m@ne + #1{\ignorespaces\theauthor{\number\count@}\unskip\@tubauthorlastsep}% + \fi +% \end{macrocode} +% +% Finally (if there were any authors at all) output the last author's +% name: +% +% \begin{macrocode} + #1{\ignorespaces\theauthor{\number\authornumber}\unskip} + \fi +} +% +\def\@tubauthorlastsep{, }% until 2018, was: "\ and " +% \end{macrocode} +% +% Signature blocks. The author can (in principle) define a different +% sort of signature block using \cs{signature}, though this could well +% cause the editorial group to have collective kittens (unless it had +% been discussed in advance\dots) +% +% \begin{macrocode} +\def\signature#1{\def\@signature{#1}} +\def\@signature{\@defaultsignature} +% \end{macrocode} +% +% \cs{@defaultsignature} loops through all the authors, outputting the +% details we have about that author, or (if we're in a sub-article) +% outputs the contributor's name and closes the group opened by +% \cs{contributor}. It is (as its name implies) the default body for +% \cs{makesignature} +% +% \begin{macrocode} +\def\@defaultsignature{{% + \let\thanks\@gobble + \frenchspacing + % + \ifnum\authornumber<0 +% \end{macrocode} +% if \cs{authornumber}$<0$, we are in a contributor's section +% \begin{macrocode} + \medskip + \signaturemark + \theauthor{\number\authornumber}\\ + \theaddress{\number\authornumber}\\ + \allowhyphens + \thenetaddress{\number\authornumber}\\ + \thePersonalURL{\number\authornumber}\\ + \theORCID{\number\authornumber}\\ + \else +% \end{macrocode} +% \cs{authornumber}$\ge0$, so we are in the body of an ordinary +% article +% \begin{macrocode} + \count@=0 + \loop + \ifnum\count@<\authornumber + \medskip + \advance\count@ by \@ne + \signaturemark + \theauthor{\number\count@}\\ + \theaddress{\number\count@}\\ + {% + \allowhyphens + \thenetaddress{\number\count@}\\ + \thePersonalURL{\number\count@}\\ + \theORCID{\number\count@}\\ + }% + \repeat + \fi + }% +} +\newdimen\signaturewidth \signaturewidth=12pc +% \end{macrocode} +% The optional argument to \cs{makesignature} is useful in some +% circumstances (e.g., multi-contributor articles) +% \begin{macrocode} +\newcommand{\makesignature}[1][\medskipamount]{% +% \end{macrocode} +% +% check the value the user has put in \cs{signaturewidth}: it may be +% at most \verb|1.5pc| short of \cs{columnwidth} +% \begin{macrocode} + \@tempdima\signaturewidth + \advance\@tempdima 1.5pc + \ifdim \@tempdima>\columnwidth + \signaturewidth \columnwidth + \advance\signaturewidth -1.5pc + \fi + \par + \penalty9000 + \vspace{#1}% + \rightline{% + \vbox{\hsize\signaturewidth \ninepoint \raggedright + \parindent \z@ \everypar={\hangindent 1pc }% + \parskip \z@skip + \def\|{\unskip\hfil\break}% + \def\\{\endgraf}% + \def\phone{\rm Phone: }% + \def\tubmultipleaffilauthor{\\\hspace*{1em}}% + \rm\@signature}% + }% + \ifnum\authornumber<0 \endgroup\fi +} +\def\signaturemark{\leavevmode\llap{$\diamond$\enspace}} +% \end{macrocode} +% +% The idea here is that if multiple authors share affiliation +% information, we need only typeset the affiliation once. We separate by +% commas for the \cs{maketitle}, and put on separate lines in the +% \cs{makesignature}. Similarly, within \cs{netaddress}, +% |!tubmultipleaffilnet| separates with a space before and after the +% comma, while . (All this per bb.) See |tb122childs-trotter.ltx| for an +% example. +% +% \begin{macrocode} +\def\tubmultipleaffilauthor{\unskip, \ignorespaces}% +\def\tubmultipleaffilnet{\unskip\textrm{\,,\ \ignorespaces}} +% \end{macrocode} +% +% Now all the awful machinery of author definitions. +% \cs{authornumber} records the number of authors we have recorded to +% date. +% +% \begin{macrocode} +\newcount\authornumber +\authornumber=0 +% \end{macrocode} +% +% \cs{author} `allocates' another author name (by bumping +% \cs{authornumber}) and also sets up the address and netaddress for +% this author to produce a warning and to prevent oddities if they're +% invoked. This last assumes that invocation will be in the context +% of \cs{signature} (|ltugboat.cls|) or \cs{maketitle} +% (|ltugproc.cls|); in both cases, invocation is followed by a line +% break (tabular line break |\\| in |ltugproc|, \cs{endgraf} in +% \cs{makesignature} in |ltugboat|). +% +% \begin{macrocode} +\def\author{% + \global\advance\authornumber\@ne + \TB@author +} +% \end{macrocode} +% \cs{contributor} is for a small part of a multiple-part article; it +% begins a group that will be ended in \cs{makesignature}. +% \begin{macrocode} +\def\contributor{% + \begingroup + \authornumber\m@ne + \TB@author +} +% \end{macrocode} +% +% Both `types' of author fall through here to set up the author name +% and to initialise author-related things. \cs{EDITORno*} commands +% allow the editor to record that there's good reason for an +% \emph{address} or \emph{netaddress} not to be there (the +% \emph{personalURL} and \emph{ORCID} are optional anyway). +% \begin{macrocode} +\def\TB@author#1{% + \expandafter\def\csname theauthor\number\authornumber\endcsname + {\ignorespaces#1\unskip}% + \expandafter\def\csname theaddress\number\authornumber\endcsname + {\TBWarningNL{Address for #1\space missing}\@gobble}% + \expandafter\def\csname thenetaddress\number\authornumber\endcsname + {\TBWarningNL{Net address for #1\space missing}\@gobble}% + \expandafter\let\csname thePersonalURL\number\authornumber\endcsname + \@gobble + \expandafter\let\csname theORCID\number\authornumber\endcsname + \@gobble + } +\def\EDITORnoaddress{% + \expandafter\let\csname theaddress\number\authornumber\endcsname + \@gobble +} +\def\EDITORnonetaddress{% + \expandafter\let\csname thenetaddress\number\authornumber\endcsname + \@gobble +} +% \end{macrocode} +% +% \cs{address} copies its argument into the \cs{theaddress} +% for this author. +% +% \begin{macrocode} +\def\address#1{% + \expandafter\def\csname theaddress\number\authornumber\endcsname + {\leavevmode\ignorespaces#1\unskip}} +% \end{macrocode} +% +% \cs{network} is for use within the optional argument of +% \cs{netaddress}; it defines the \emph{name} of the network the user +% is on. +% +% \begin{description} +% \item[\emph{Comment:}] I think this is a fantasy, since everyone (in +% practice, nowadays) quotes an internet address. In principle, there +% are people who will quote |X.400| addresses (but they're few and far +% between) and I have (during 1995!)\ seen an address with an |UUCP| +% bang-path component on |comp.text.tex|, but \emph{really}! +% \end{description} +% +% \begin{macrocode} +\def\network#1{\def\@network{#1: }} +% \end{macrocode} +% +% \cs{netaddress} begins a group, executes an optional argument (which +% should not, presumably, contain global commands) and then relays to +% \cs{@relay@netaddress} with both |@| and |%| made active (so that +% they can be discretionary points in the address). If we're using +% \LaTeXe, we use the default-argument form of \cs{newcommand}; +% otherwise we write it out in all its horribleness. +% +% \begin{macrocode} +\newcommand{\netaddress}[1][\relax]{% + \begingroup + \def\@network{}% +% \end{macrocode} +% +% Unfortunately, because of the catcode hackery, we have still to do +% one stage of relaying within our own code, even if we're using +% \LaTeXe. +% +% \begin{macrocode} + #1\@sanitize\makespace\ \makeactive\@% + \makeescape! \makebgroup[ \makeegroup]% seems more useful than literals + \makeactive\.\makeactive\%\@relay@netaddress}% +% \end{macrocode} +% +% \cs{@relay@netaddress} finishes the job. It sets \cs{thenetaddress} +% for this author to contain the network name followed by the address. +% As a result of our kerfuffle above, |@| and |%| are active at the +% point we're entered. We ensure they're active when +% \cs{thenetaddress} gets expanded, too. (\textbf{\emph{WOT}?!}) +% +% \begin{macrocode} +\def\@relay@netaddress#1{% + \ProtectNetChars + \expandafter\protected@xdef + \csname thenetaddress\number\authornumber\endcsname + {\protect\leavevmode\textrm{\@network}% + {\protect\NetAddrChars\net + \ignorespaces#1\unskip}}% + \endgroup + } +% \end{macrocode} +% +% \cs{personalURL} is in essence the same as \cs{netaddress}, apart +% from (1) the lack of the eccentric optional argument, and (2) the +% activation of `|/|'. +% +% For general URLs, \texttt{url.sty} (with or without hyperref) suffices +% and is recommended. +% +% \begin{macrocode} +\def\personalURL{\begingroup + \@sanitize\makespace\ \makeactive\@ + \makeactive\.\makeactive\%\makeactive\/\@personalURL}% +\def\@personalURL#1{% + \ProtectNetChars + \expandafter\protected@xdef + \csname thePersonalURL\number\authornumber\endcsname{% + \protect\leavevmode + {% + \protect\URLchars\net + \ignorespaces#1\unskip + }% + }% + \endgroup + } +% \end{macrocode} +% +% Define the activation mechanism for `|@|', `|%|', `|.|' and `|/|', for use +% in the above. Note that, since the code has `|%|' active, we have +% `|*|' as a comment character, which has a tendency to make things +% look peculiar\dots +% +% \begin{macrocode} +{% + \makecomment\* + \makeactive\@ + \gdef\netaddrat{\makeactive\@* + \def@{\discretionary{\char"40}{}{\char"40}}} + \makeactive\% + \gdef\netaddrpercent{\makeactive\%* + \def%{\discretionary{\char"25}{}{\char"25}}} + \makeactive\. + \gdef\netaddrdot{\makeactive\.* + \def.{\discretionary{\char"2E}{}{\char"2E}}} +% \end{macrocode} +% +% \cs{NetAddrChars} is what \emph{we} use (we're constrained to retain +% the old interface to this stuff, but it \emph{is} clunky\dots). +% Since {\small URL}s are a new idea, we are at liberty not to define +% a separate \cs{netaddrslash} command, and we only have +% \cs{URLchars}. +% +% \begin{macrocode} + \gdef\NetAddrChars{\netaddrat \netaddrpercent \netaddrdot} + \makeactive\/ + \gdef\URLchars{* + \NetAddrChars + \makeactive\/* + \def/{\discretionary{\char"2F}{}{\char"2F}}} +% \end{macrocode} +% +% \cs{ProtectNetChars} includes protecting `|/|', since this does no +% harm in the case of net addresses (where it's not going to be +% active) and we thereby gain by not having yet another csname. +% +% \begin{macrocode} + \gdef\ProtectNetChars{* + \def@{\protect@}* + \def%{\protect%}* + \def.{\protect.}* + \def/{\protect/}* + } +} +% \end{macrocode} +% +% \LaTeXe{} (in its wisdom) suppresses +% \cs{DeclareOldFontCommand} when in compatibility mode, so that in +% that circumstance we need to use a declaration copied from +% |latex209.def| rather than the way we would normally do the thing +% (using the command \LaTeXe{} defines for the job). +% +% \begin{macrocode} +\if@compatibility + \DeclareRobustCommand{\net}{\normalfont\ttfamily\mathgroup\symtypewriter} +\else + \DeclareOldFontCommand{\net}{\ttfamily\upshape\mdseries}{\mathtt} +\fi +\def\authorlist#1{\def\@author{#1}} +\def\@author{\@defaultauthorlist} +% \end{macrocode} +% +% \cs{ORCID} inserts `ORCID' and then argument into the \cs{theORCID} +% for this author. Also, we want \cs{small} for this. +% +% \begin{macrocode} +\def\ORCID#1{% + \expandafter\def\csname theORCID\number\authornumber\endcsname + {\leavevmode \ignorespaces {\SMC ORCID} #1\unskip}} +% \end{macrocode} +% +% For the online re-publication (as of 2009) by Mathematical Sciences +% Publishers |http://mathscipub.org|, lots and lots of metadata is +% needed, much of it redundant with things we already do. They are +% flexible enough to allow us to specify it in any reasonable way, so +% let's make one command \cs{mspmetavar} which takes two arguments. +% Example: |\mspmetavar{volumenumber}{30}|. For our purposes, it is +% just a no-op. And this initiative never came to anything, so it is +% not used at all. +% +% \begin{macro}{\mspmetavar} +% \begin{macrocode} +\def\mspmetavar#1#2{} +% \end{macrocode} +% \end{macro} +% +% \subsection{Article title} +% +% \begin{macro}{\if@articletitle} +% \begin{macro}{\maketitle} +% \begin{macro}{\@r@maketitle} +% \cs{maketitle} takes an optional ``*''; if present, the operation is +% not defining the title of a paper, merely that of a ``business'' +% section (such as the participants at a meeting) that has no credited +% author or other title. In this case, the command flushes out the +% latest \cs{sectitle} (or whatever) but does nothing else. +% +% Provide machinery to skip extra space, even one or more full columns, +% above the top of an article to leave space to paste up a previous +% article that has finished on the same page. This is a fall back to +% accommodate the fact that multiple articles cannot yet be run together +% easily with \LaTeXe. +% \begin{macrocode} +\newif\if@articletitle +\def\maketitle{\@ifstar + {\@articletitlefalse\@r@maketitle}% + {\@articletitletrue\@r@maketitle}% +} +\def\@r@maketitle{\par + \ifdim\PreTitleDrop > \z@ + \loop + \ifdim \PreTitleDrop > \textheight + \vbox{}\vfil\eject + \advance\PreTitleDrop by -\textheight + \repeat + \vbox to \PreTitleDrop{} + \global\PreTitleDrop=\z@ + \fi + \begingroup + \setcounter{footnote}{0} + \global\@topnum\z@ % disallow floats above the title + \def\thefootnote{\fnsymbol{footnote}} + \@maketitle + \@thanks + \endgroup + \setcounter{footnote}{0} + \gdef\@thanks{} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\title} +% \begin{macro}{\TB@title} +% We redefine the \cs{title} command, so as to set the \cs{rhTitle} +% command at the same time. While we're at it, we redefine it to have +% optional arguments for use as `short' versions, thus obviating the +% need for users to use the \cs{shortTitle} command. +% \begin{macrocode} +\def\rhTitle{}% avoid error if no author or title +\renewcommand{\title}{\@dblarg\TB@title} +\def\TB@title[#1]#2{\gdef\@title{#2}% + \bgroup + \let\thanks\@gobble + \def\\{\unskip\space\ignorespaces}% + \protected@xdef\rhTitle{#1}% + \egroup +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\shortTitle} +% \begin{macro}{\ifshortAuthor} +% \begin{macro}{\shortAuthor} +% The \cs{rh*} commands are versions to be used in the running head of +% the article. Normally, they are the same things as the author and +% title of the article, but in the case that there are confusions +% therein, the text should provide substitutes, using the \cs{short*} +% commands. +% \begin{macrocode} +\def\shortTitle #1{\def\rhTitle{#1}} +\newif\ifshortAuthor +\def\shortAuthor #1{\def\rhAuthor{#1}\shortAuthortrue} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Section titles} +% +% The following macros are used to set the large \TUB{} section heads +% (e.g.\ ``General Delivery'', ``Fonts'', etc.) +% +% Define the distance between articles which are run together: +% +% \begin{macrocode} +\def\secsep{\vskip 5\baselineskip} +% \end{macrocode} +% +% Note that \cs{stbaselineskip} is used in the definition of +% \cs{sectitlefont}, in \LaTeXe, so that it has (at least) to be +% defined before \cs{sectitlefont} is used (we do the whole job). +% +% \begin{macrocode} +\newdimen\stbaselineskip \stbaselineskip=18\p@ +\newdimen\stfontheight +\settoheight{\stfontheight}{\sectitlefont O} +% \end{macrocode} +% +% Declaring section titles; the conditional \cs{ifSecTitle} records +% the occurence of a \cs{sectitle} command. If (when) a subsequent +% \cs{maketitle} occurs, the section title box will get flushed out; +% as a result of this, one could in principle have a set of +% \cs{sectitle} commands in a semi-fixed steering file, and inclusions +% of files inserted only as and when papers have appeared. Only the +% last \cs{sectitle} will actually be executed. +% +% \begin{macrocode} +\newif\ifWideSecTitle +\newif\iftubtitlerulefullwidth +\newif\ifSecTitle \SecTitlefalse +\newcommand{\sectitle}{% + \SecTitletrue + \@ifstar + {\WideSecTitletrue\def\s@ctitle}% + {\WideSecTitlefalse\def\s@ctitle}% +} +% \end{macrocode} +% +% \cs{PreTitleDrop} records the amount of column-space we need to +% eject before we start any given paper. It gets zeroed after that +% ejection has happened. +% +% \begin{macrocode} +\newdimen\PreTitleDrop \PreTitleDrop=\z@ +% \end{macrocode} +% +% The other parameters used in \cs{@sectitle}; I don't think there's +% the slightest requirement for them to be registers (since they're +% constant values, AFAIK), but converting them to macros would remove +% the essentially useless functionality of being able to change them +% using assignment, which I'm not about to struggle with just now... +% +% \cs{AboveTitleSkip} and \cs{BelowTitleSkip} are what you'd expect; +% \cs{strulethickness} is the value to use for \cs{fboxrule} when +% setting the title, and for the rule above titles when there is no box. +% +% \begin{macrocode} +\newskip\AboveTitleSkip \AboveTitleSkip=12\p@ +\newskip\BelowTitleSkip \BelowTitleSkip=8\p@ +\newdimen\strulethickness \strulethickness=.6\p@ +% \end{macrocode} +% +% \cs{@sectitle} actually generates the section title (in a rather +% generous box). It gets called from \cs{maketitle} under conditional +% \cs{ifSecTitle}; by the time \cs{@sectitle} takes control, we +% already have \cs{SecTitlefalse}. This implementation uses \LaTeX's +% \cs{framebox} command, on the grounds that one doesn't keep a dog +% and bark for oneself\dots +% +% \begin{macrocode} +\def\@sectitle #1{% + \par + \penalty-1000 +% \end{macrocode} +% +% If we're setting a wide title, the stuff will be at the top of a +% page (let alone a column) but inside a box, so that the separator +% won't be discardable: so don't create the separator in this case. +% +% \begin{macrocode} + \ifWideSecTitle\else\secsep\fi + {% + \fboxrule\strulethickness + \fboxsep\z@ + \noindent\framebox[\hsize]{% + \vbox{% + \raggedcenter + \let\\\@sectitle@newline + \sectitlefont + \makestrut[2\stfontheight;\z@]% + #1% + \makestrut[\z@;\stfontheight]\endgraf + }% + }% + }% + \nobreak + \vskip\baselineskip +} +% \end{macrocode} +% +% \begin{macro}{\@sectitle@newline} +% For use inside \cs{sectitle} as |\\|. Works similarly to |\\| in +% the ``real world''---uses an optional argument +% \begin{macrocode} +\newcommand{\@sectitle@newline}[1][\z@]{% + \ifdim#1>\z@ + \makestrut[\z@;#1]% + \fi + \unskip\break +} +% \end{macrocode} +% \end{macro} +% +% We need to trigger the making of a section title in some cases where +% we don't have a section title proper (for example, in material taken +% over from +%^^A \acro +% {TTN}). +% \begin{macrocode} +\def\@makesectitle{\ifSecTitle + \global\SecTitlefalse + \ifWideSecTitle + \twocolumn[\@sectitle{\s@ctitle}]% + \global\WideSecTitlefalse + \else + \@sectitle{\s@ctitle}% + \fi + \else + \vskip\AboveTitleSkip + \kern\topskip + \hrule \@height\z@ \@depth\z@ \@width 10\p@ + \kern-\topskip + \kern-\strulethickness + \iftubtitlerulefullwidth + \hrule \@height\strulethickness \@depth\z@ width\textwidth + \else + \hrule \@height\strulethickness \@depth\z@ + \fi + \kern\medskipamount + \nobreak + \fi +} +% \end{macrocode} +% +% \begin{macro}{\@maketitle} +% Finally, the body of \cs{maketitle} itself. +% \begin{macrocode} +\def\@maketitle{% + \@makesectitle + \if@articletitle{% + \nohyphens \interlinepenalty\@M + \setbox0=\hbox{% + \let\thanks\@gobble + \let\\=\quad + \let\and=\quad + \ignorespaces\@author}% + {% + \noindent\bf\raggedright\ignorespaces\frenchspacing\@title\endgraf + }% + \ifdim \wd0 < 5\p@ % omit if author is null + \else +% \end{macrocode} +% Since we have \(\mathtt{\cs{BelowTitleSkip}} + \mathtt{4pt} = +% \mathtt{\cs{baselineskip}}\), we say: +% \begin{macrocode} + \nobreak \vskip 4\p@ + {% + \leftskip=\normalparindent + \raggedright + \def\and{\unskip\\}% + \noindent\@author\endgraf + }% + \fi + \nobreak + \vskip\BelowTitleSkip + }\fi% + \global\@afterindentfalse + \aftergroup\@afterheading +} +% \end{macrocode} +% \end{macro} +% +% Dedications are ragged right, in italics. +% +% \begin{macrocode} +\newenvironment{dedication}% + {\raggedright\noindent\itshape\ignorespaces}% + {\endgraf\medskip} +% \end{macrocode} +% +% The |abstract| and |longabstract| environments both use \cs{section*}. +% For one-column articles (or in |ltugproc| class), indent the +% abstract. This is done in the usual bizarre \LaTeX\ way, by treating +% it as a one-item list with an empty item marker. +% +% \begin{macrocode} +\def\@tubonecolumnabstractstart{% + \list{}{\listparindent\normalparindent + \itemindent\z@ \leftmargin\@tubfullpageindent + \rightmargin\leftmargin \parsep \z@}\item[]\ignorespaces +} +\def\@tubonecolumnabstractfinish{% + \endlist +} +\renewenvironment{abstract}% + {\begin{SafeSection}% + \section*{% + \if@tubtwocolumn\else \hspace*{\@tubfullpageindent}\fi + Abstract}% + \if@tubtwocolumn\else \@tubonecolumnabstractstart \fi + }% + {\if@tubtwocolumn\else \@tubonecolumnabstractfinish \fi + \end{SafeSection}} +\newenvironment{longabstract}% + {\begin{SafeSection}% + \section*{Abstract}% + \bgroup\small + }% + {\endgraf\egroup + \end{SafeSection}% + \vspace{.25\baselineskip} + \begin{center} + {$--*--$} + \end{center} + \vspace{.5\baselineskip}} +% \end{macrocode} +% +% \subsection{Section headings} +% +% Redefine style of section headings to match plain \TUB. +% Negative beforeskip suppresses following parindent. (So +% negate the stretch and shrink too). +% +% These macros are called \cs{*head} in the plain styles. +% +% Relaying via \cs{TB@startsection} detects inappropriate use of +% \cs{section*}. Of course, if (when) \emph{we} use it, we need to +% avoid that relaying; this can be done by \cs{let}ting +% \cs{TB@startsection} to \cs{TB@safe@startsection}, within a group. +% +% First the version for use in the default case, when class option +% \textsc{numbersec} is in effect. +% +% \begin{macrocode} +\if@numbersec + \def\section{\TB@startsection{{section}% + 1% + \z@ + {-8\p@ \@plus-2\p@ \@minus-2\p@}% + {4\p@}% + {\normalsize\bf\raggedright\hyphenpenalty=\@M}}} + \def\subsection{\TB@startsection{{subsection}% + 2% + \z@ + {-8\p@ \@plus-2\p@ \@minus-2\p@}% + {4\p@}% + {\normalsize\bf\raggedright\hyphenpenalty=\@M}}} + \def\subsubsection{\TB@startsection{{subsubsection}% + 3% + \z@ + {-8\p@ \@plus-2\p@ \@minus-2\p@}% + {4\p@}% + {\normalsize\bf\raggedright\hyphenpenalty=\@M}}} + \def\paragraph{\TB@startsection{{paragraph}% + 4% + \z@ + {4\p@ \@plus1\p@ \@minus1\p@}% + {-1em}% + {\normalsize\bf}}} +% \end{macrocode} +% +% Now the version if class option \textsc{nonumber} is in effect, +% i.e., if \cs{if@numbersec} is false. +% +% \begin{macrocode} +\else + \setcounter{secnumdepth}{0} + \def\section{\TB@nolimelabel + \TB@startsection{{section}% + 1% + \z@ + {-8\p@ \@plus-2\p@ \@minus-2\p@}% + {4\p@}% + {\normalsize\bf\raggedright\hyphenpenalty=\@M}}} + \def\subsection{\TB@nolimelabel + \TB@startsection{{subsection}% + 2% + \z@ + {-8\p@ \@plus-2\p@ \@minus-2\p@}% + {-0.5em\@plus-\fontdimen3\font}% + {\normalsize\bf\raggedright\hyphenpenalty=\@M}}} + \def\subsubsection{\TB@nolimelabel + \TB@startsection{{subsubsection}% + 3% + \parindent + {-8\p@ \@plus-2\p@ \@minus-2\p@}% + {-0.5em\@plus-\fontdimen3\font}% + {\normalsize\bf\raggedright\hyphenpenalty=\@M}}} +\fi +% \end{macrocode} +% +% \cs{TB@startsection} used to warn about \verb"*" versions of sectioning +% commands when numbering wasn't in effect. But that eventually seemed +% a useless complaint, since it can be usefule to switch back and forth between +% numbered and unnumbered can be useful during article development. +% So now \cs{TB@startsection} is just a synonym for \cs{@startsection}. +% +% \begin{macrocode} +\def\TB@startsection#1{\@startsection#1}% +% \end{macrocode} +% +% \cs{TB@safe@startsection} is to be used where \cs{section*} (etc.)\ +% appear in places where the request is OK (because it's built in to +% some macro we don't fiddle with). +% +% \begin{macrocode} +\def\TB@safe@startsection#1{\@startsection#1} +% \end{macrocode} +% +% The \texttt{SafeSection} environment allows use of \texttt{*}-forms +% of sectioning environments. It's not documented for the general +% public: it's intended as an editor's facility. +% +% \begin{macrocode} +\newenvironment{SafeSection}% + {\let\TB@startsection\TB@safe@startsection}% + {} +% \end{macrocode} +% +% And now for the exciting sectioning commands that \LaTeX{} defines +% but we don't have a definition for (whatever else, we don't want +% Lamport's originals, which come out `like the blare of a bugle in a +% lullaby'\footnote{Thurber, \emph{The Wonderful O}}). +% +% The three inappropriate ones are subparagraph (indistinguishable +% from paragraph), and chapter and part. The last seemed almost to be +% defined in an early version of these macros, since there was a +% definition of \cs{l@part}. I've not got down to where that came +% from (or why). If class option \textsc{nonumber} is in effect, we +% also suppress \cs{paragraph}, since it has no parallel in the plain +% style. +% +% \begin{macrocode} +\if@numbersec + \def\subparagraph{\TB@nosection\subparagraph\paragraph} +\else + \def\paragraph{\TB@nosection\paragraph\subsubsection} + \def\subparagraph{\TB@nosection\subparagraph\subsubsection} +\fi +\def\chapter{\TB@nosection\chapter\section} +\def\part{\TB@nosection\part\section} +\def\TB@nosection#1#2{\TBWarning{class does not support \string#1, + \string#2\space used instead}#2} +% \end{macrocode} +% +% \cs{l@} is for table of contents (of an article). +% We define new macros to allow easily changing the font used for toc +% entries (for \TUB, we usually want roman, not bold), and the space +% between entries. Nelson Beebe and Frank Mittelbach's articles +% often have toc's (and few others). Also turn off microtype +% protrusion after \tableofcontents or leaders get messed up. +% +% \begin{macrocode} +\def\TBtocsectionfont{\normalfont} +\newskip\TBtocsectionspace \TBtocsectionspace=1.0em\@plus\p@ +% \end{macrocode} +% +% \begin{macrocode} +\def\l@section#1#2{\addpenalty{\@secpenalty}% + \addvspace{\TBtocsectionspace}% + \@tempdima 1.5em + \begingroup + \parindent\z@ \rightskip\z@ % article style makes \rightskip > 0 + \parfillskip\z@ + \TBtocsectionfont + \leavevmode\advance\leftskip\@tempdima\hskip-\leftskip#1\nobreak\hfil + \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \endgroup} +% \end{macrocode} +% +% \subsection{Appendices} +% +% Appendices (which are really just another sort of section heading) +% raise a problem: if the sections are unnumbered, we plainly need to +% restore the section numbering, which in turn allows labelling of +% section numbers again (\cs{TBnolimelabel} happens before the +% \cs{refstepcounter}, so its effects get lost \dots~what a clever +% piece of design that was). So here we go: +% +% \begin{macrocode} +\renewcommand{\appendix}{\par + \renewcommand{\thesection}{\@Alph\c@section}% + \setcounter{section}{0}% + \if@numbersec + \else + \setcounter{secnumdepth}{1}% + \fi +% \end{macrocode} +% +% Now: is this the start of an appendix environment? This can be +% detected by looking at \cs{@currenvir}; if we are, we need to relay +% to \cs{@appendix@env} to pick up the optional argument. +% +% \begin{macrocode} + \def\@tempa{appendix} + \ifx\@tempa\@currenvir + \expandafter\@appendix@env + \fi +} +% \end{macrocode} +% +% Here we deal with \cs{begin}|{appendix}|\oarg{app-name} +% +% \begin{macrocode} +\newcommand{\app@prefix@section}{} +\newcommand{\@appendix@env}[1][Appendix]{% + \renewcommand{\@seccntformat}[1]{\csname app@prefix@##1\endcsname + \csname the##1\endcsname\quad}% + \renewcommand{\app@prefix@section}{#1 }% +} +% \end{macrocode} +% +% Ending an appendix environment is pretty trivial\dots +% +% \begin{macrocode} +\let\endappendix\relax +% \end{macrocode} +% +% +% \subsection{References} +% +% If the sections aren't numbered, the natural tendency of the +% author to cross-reference (which, after all, is one of the things +% \LaTeX{} is for ever being advertised as being good at) can cause +% headaches. +% +% The following command is used by each of the sectioning commands to +% make a following \cs{ref} command bloop at the author. Even if the +% author then ignores the complaint, the poor old editor may find the +% offending \cs{label} rather more easily. +% +% (Note that macro name is to be read as ``\emph{noli me} label'' (I +% don't know the medi\ae val Latin for `label'). +% +% \begin{description} +% \item[\emph{Comment}] To come (perhaps): detection of the act of +% labelling, and an analogue of \cs{ifG@refundefined} for this sort of +% label +% \end{description} +% +% \begin{macrocode} +\def\TB@nolimelabel{% + \def\@currentlabel{% + \protect\TBWarning{% + Invalid reference to numbered label on page \thepage + \MessageBreak made% + }% + \textbf{?!?}% + }% +} +% \end{macrocode} +% +% \subsection{Title references} +% +% This is a first cut at a mecahnism for referencing by the title of a +% section; it employs the delightfully simple idea Sebastian Rahtz has +% in the \texttt{nameref} package (which is part of +% \texttt{hyperref}). As it stands, it lacks some of the bells and +% whistles of the original, but they could be added; this is merely +% proof-of-concept. +% +% The name label comes from the moveable bit of the section argument; +% we subvert the \cs{@sect} and \cs{@ssect} commands (the latter +% deals with starred section commands) to grab the relevant argument. +% \begin{macrocode} +\let\TB@@sect\@sect +\let\TB@@ssect\@ssect +\def\@sect#1#2#3#4#5#6[#7]#8{% + \def\@currentlabelname{#7}% + \TB@@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}% +} +\def\@ssect#1#2#3#4#5{% + \def\@currentlabelname{#5}% + \TB@@ssect{#1}{#2}{#3}{#4}{#5}% +} +% \end{macrocode} +% +% We output the name label as a second \cs{newlabel} command +% in the \texttt{.aux} file. That way, packages such as |varioref| +% which also read the \texttt{.aux} information can still work. +% So we redefine \cs{label} to first call the standard \LaTeX\ +% \cs{label} and then write our named label as |nr +% \end{macrocode} +% +% \section{Plain \TeX\ styles} +% \begin{macrocode} +%<*tugboatsty> +% err... +% +%<*tugprocsty> +% err... +% +% \end{macrocode} +% \section{The \LaTeXe\ compatibility-mode style files} +% \begin{macrocode} +%<*ltugboatsty> +\@obsoletefile{ltugboat.cls}{ltugboat.sty} +\LoadClass{ltugboat} +% +%<*ltugprocsty> +\@obsoletefile{ltugproc.cls}{ltugproc.sty} +\LoadClass{ltugproc} +% +% \end{macrocode} +% +% ^^A \addtolength{\premulticols}{5\baselineskip} +% \clearpage +% +% \Finale +% +\endinput +% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} diff --git a/macros/latex/contrib/tugboat/tugboat.ins b/macros/latex/contrib/tugboat/tugboat.ins new file mode 100644 index 0000000000..72b4f4f184 --- /dev/null +++ b/macros/latex/contrib/tugboat/tugboat.ins @@ -0,0 +1,85 @@ +% $Id: tugboat.ins 210 2018-10-29 18:04:16Z karl $ +% tugboat.ins +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1994-2018 TeX Users Group. +%% +%% This file is part of the tugboat package. +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is the TeX Users Group +%% (http://tug.org/TUGboat). +%% +%% The list of all files belonging to the distribution is +%% given in the file `manifest.txt'. +%% +%% The list of derived (unpacked) files belonging to the distribution +%% and covered by LPPL is defined by the unpacking scripts (with +%% extension .ins) which are part of the distribution. + +\def\batchfile{tugboat.ins} +\input docstrip.tex + +\keepsilent +\askforoverwritefalse + +\preamble + +This is a generated file. + +Copyright 1994-2018 TeX Users Group. + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This file has the LPPL maintenance status "maintained". + +The Current Maintainer of this work is the TeX Users Group +(http://tug.org/TUGboat). + +The list of all files belonging to the distribution is given in the file +`manifest.txt'. + +The list of derived (unpacked) files belonging to the distribution +and covered by LPPL is defined by the unpacking scripts (with +extension .ins) which are part of the distribution. + +\endpreamble + +\generate{\file{ltugboat.cls}{% + \from{tugboat.dtx}{latex,classtop,common,classtail,latex2e,ltugboatcls}} + \file{ltugproc.cls}{% + \from{tugboat.dtx}{ltugproccls}} + \file{ltugboat.sty}{% + \from{tugboat.dtx}{ltugboatsty}} + \file{ltugproc.sty}{% + \from{tugboat.dtx}{ltugprocsty}} + \file{ltugcomn.sty}{% + \from{tugboat.dtx}{common,latex,latex2e,ltugcomn}}} + +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{* \space\space All *.sty and all *.cls} +\Msg{*} +\Msg{* And move ltugbib.bst to a directory searched by BibTeX.} +\Msg{***********************************************************} + +\endinput diff --git a/macros/latex/contrib/tugboat/tugboat.pdf b/macros/latex/contrib/tugboat/tugboat.pdf new file mode 100644 index 0000000000..f5e9d3068d Binary files /dev/null and b/macros/latex/contrib/tugboat/tugboat.pdf differ -- cgit v1.2.3