summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tugboat/tugboat.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-10-30 03:02:43 +0000
committerNorbert Preining <norbert@preining.info>2023-10-30 03:02:43 +0000
commit8647e4164dd0349eb19a3068ec19c135647e1b4c (patch)
tree1aa23fe4d369d9779070159a2a6aec4536aeca48 /macros/latex/contrib/tugboat/tugboat.dtx
parent63d7dc4d66eb8f96c0c480abe8e5d0eefc434269 (diff)
CTAN sync 202310300302
Diffstat (limited to 'macros/latex/contrib/tugboat/tugboat.dtx')
-rw-r--r--macros/latex/contrib/tugboat/tugboat.dtx201
1 files changed, 133 insertions, 68 deletions
diff --git a/macros/latex/contrib/tugboat/tugboat.dtx b/macros/latex/contrib/tugboat/tugboat.dtx
index a4b558b158..2a98a67ffc 100644
--- a/macros/latex/contrib/tugboat/tugboat.dtx
+++ b/macros/latex/contrib/tugboat/tugboat.dtx
@@ -1,5 +1,5 @@
% \iffalse (this is a meta-comment (so they say))
-% $Id: tugboat.dtx 490 2023-07-03 22:27:49Z karl $
+% $Id: tugboat.dtx 533 2023-10-28 22:40:31Z karl $
% tugboat.dtx - main source for LaTeX TUGboat classes.
%
% Copyright 1994-2023 TeX Users Group.
@@ -28,7 +28,7 @@
%<ltugboatsty>\ProvidesPackage{ltugboat}
%<ltugprocsty>\ProvidesPackage{ltugproc}
%<ltugcomn> \ProvidesPackage{ltugcomn}
- [2023-07-03 v2.30
+ [2023-10-28 v2.31
%<ltugboatcls> TUGboat journal class%
%<ltugproccls> TUG conference proceedings class%
%<ltugboatsty|ltugprocsty> TUG compatibility package%
@@ -221,8 +221,6 @@
% & 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\\
@@ -240,7 +238,7 @@
% |\revtitle|& with one argument, title of \ldots \\
% |\revpubinfo|& with one argument, other info pertaining to \ldots \\
% |\endreviewitem|& end data for item being reviewed\\
-% |\titleref|& with one argument, format title as straight text
+% |\titleref|& one argument, format title as straight text
% (slanted, frenchspacing) \\
% |\Input|& |\input| with some other bookkeeping for
% case where multiple articles are put together\\
@@ -342,7 +340,7 @@
\tubfinaloptiontrue
\AtEndOfClass{%
% Insert draft date into the header even with [final], if we are not
- % doing a production run. (tugboat.dates sets up page numbers
+ % 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 vs. final can change page
% layout, wrt registration marks, etc. (Not good, but too painful to
@@ -682,7 +680,7 @@
% Font used for the METAFONT logo, etc.
% \begin{macrocode}
\DeclareRobustCommand{\AllTeX}{%
- \texorpdfstring{(\La\kern-.075em)\kern-.075em\TeX}{(La)TeX}}
+ \texorpdfstring{(\La\kern-.075em)\kern-.05em\TeX}{(La)TeX}}
\def\AMS{American Mathematical Society}
\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
{$\mathcal{M}$}\kern-.125em$\mathcal{S}$}
@@ -799,10 +797,12 @@
%
% \begin{macrocode}
%<!latex>\def\LaTeX{\La\kern-.15em\TeX}
+\def\LMTX{\acro{LMTX}}
\def\LuaHBTeX{Lua\acro{HB}\-\TeX}%
\def\LuaHBLaTeX{Lua\acro{HB}\-\LaTeX}%
\def\LuaLaTeX{Lua\-\LaTeX}% dtk-logos defines it and people like to use it
\def\LuaTeX{Lua\-\TeX}% ditto
+\def\luatex{\LuaTeX}% ditto
\def\LyX{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX}
\def\macOS{mac\acro{OS}}
\def\MacOSX{Mac\,\acro{OS\,X}}
@@ -848,9 +848,10 @@
\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\pdflatex{pdf\-\LaTeX}% dtk-logos
-\def\pdftex{pdf\-\TeX}% dtk-logos
-\def\pdfTeX{\pdftex}
+\def\pdfLaTeX{pdf\/\-\LaTeX}% dtk-logos
+\def\pdflatex{\pdfLatex}
+\def\pdfTeX{pdf\/\-\TeX}% dtk-logos
+\def\pdftex{\pdfTeX}
\def\PDF{\acro{PDF}}
\def\PGF{\acro{PGF}}
\def\PHP{\acro{PHP}}
@@ -904,7 +905,7 @@
% \fi
% but let's make the smaller change.
\fi
-\def\TikZ{Ti{\em k}Z}
+\def\TikZ{Ti\/{\em k}Z}
\def\ttn{\textsl{TTN}\@}
\def\TTN{\textsl{\TeX{} and TUG News}}
\def\TUB{\texttub{TUGboat}}\def\texttub{\textsl} % redefined in some situations
@@ -993,7 +994,6 @@
% \end{macrocode}
%
% \begin{macro}{\tubsentencespace}
-%
% Occasionally, notably after citations that need to come after a
% sentence-ending period, we want to tell \TeX\ that it's still at the
% end of a sentence. As in:
@@ -1008,16 +1008,21 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tubdots}
% Latin Modern and many other fonts irritatingly make the Unicode
% ellipsis character (U+2026) a single character's width, typically more
% squashed together than three period characters. This just looks wrong.
% It is too painful to try to redefine in general, but provide the
% normal definition to reset in individual papers with, e.g.:
% |\ifx\tubdots\undefined \else \let\dots\tubdots \let\ldots\tubdots \fi|
+%
+% \begin{macrocode}
\DeclareRobustCommand{\tubdots}{\ifmmode\mathellipsis\else
.\kern\fontdimen3\font
.\kern\fontdimen3\font
.\kern\fontdimen3\font\fi}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\allowhyphens}
% Hyphen control: first, we save (via \cs{edef}) the hyphenpenalties in
@@ -1145,9 +1150,18 @@
\def\now{\ifnum\hours<10 0\fi\number\hours:%
\ifnum\minutes<10 0\fi\number\minutes}
\def\Now{\today\ \now}
-\newif\ifPrelimDraft % [draft] or [preprint] or pageno>900
+\newif\ifPrelimDraft % true if ([draft] or [preprint] or pageno>900)
\def\midrtitle{} % center of running heads
\def\rtitlenexttopage{\ifPrelimDraft \textsl{\small draft: \Now}\fi}
+%\def\rtitlenexttopage{\ifnum\value{page}>900 \textsl{\small draft: \Now}\fi}
+% \end{macrocode}
+%
+% Sometimes we want to refer to the pages of another article in the same
+% issue. |tugboat.dates| makes the real definition; here we define a
+% placeholder so it won't be undefined when we send the source back to
+% the author.
+% \begin{macrocode}
+\let\thisissuepageref\empty
% \end{macrocode}
%
% \subsection{Ragged right and friends}
@@ -1217,14 +1231,13 @@
%
% \subsection{Assorted user-level markup}
%
-% \LaTeXe{} defines a robust \cs{,} 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.
+% 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 protect against our redefinition.
%
% \begin{macrocode}
\let\latexnobreakspace=\nobreakspace
@@ -1289,8 +1302,20 @@
{\textbraceleft #1\textbraceright}%
}
%
-% Well, just the \begin part. Never seen it used.
-\DeclareRobustCommand{\env}[1]{\cs{begin}\tubbraced{#1}}
+% Literal text, such as class names, package names, filenames, etc,
+% Trying to define separate commands for each seems impossible and pointless.
+% Usually we don't want hyphenation or any other kind of break.
+\DeclareRobustCommand{\tbcode}[1]{\mbox{\texttt{#1}}}
+%
+% On the other hand, sometimes we need to break such code fragments.
+% If |hyperref| is loaded, we want |\nolinkurl|, else just |\url|.
+\AtBeginDocument{%
+\ifx\nolinkurl\undefined
+ \DeclareRobustCommand{\tbcodebreak}{\url}
+\else
+ \DeclareRobustCommand{\tbcodebreak}{\nolinkurl}
+\fi
+}
%
% Not sure why we ever want this instead of LaTeX's \, (using \kern),
% but fine, just keeping it.
@@ -1306,9 +1331,6 @@
% \cs{tbhurl}\tubbraced{foo} produces \texttt{http://foo}.
\AtBeginDocument{%
\ifx\hyper@normalise\undefined
- \def\tburl{\url}%
- \def\tbsurl{\url}% no hyperref, so just \url is fine.
- \def\tbhurl{\url}%
\ifx\url\undefined % make sure \url is defined
\def\url{\begingroup % might as well catch common special chars
\catcode`\#=12 \catcode`\$=12 \catcode`\%=12 \catcode`\^=12
@@ -1316,6 +1338,9 @@
\finish@tub@url}
\def\finish@tub@url#1{\tt #1\endgroup}
\fi
+ \let\tburl\url % no hyperref, so just \url is fine;
+ \let\tbsurl\url % \let instead of \def so we can still
+ \let\tbhurl\url % use \def\url{\tbsurl} without infloop.
\else
% This hyperref hook-in is due to Ulrike Fischer.
% \url{https://github.com/latex3/hyperref/issues/125}.
@@ -1370,10 +1395,14 @@
\def\tbsurlfootnote#1{\footnote{\raggedright\tbsurl{#1}}}
\def\tbhurlfootnote#1{\footnote{\raggedright\tbhurl{#1}}}
%
+% Close up space between footnote mark and punctuation ("pre-punctuation").
+\DeclareRobustCommand{\tbppkernfoot}{\tubthinnerspace}
+
% Make \! work in text mode.
\DeclareRobustCommand{\!}{\ifmmode\mskip-\thinmuskip \else\kern-0.16667em \fi}
%
-% Half a thinspace, positive and negative.
+% Half a thinspace, positive and negative. Should have named these
+% \cs{tb} instead of \cs{tub}, but not worth changing now.
\DeclareRobustCommand{\tubthinnerspace}
{\ifmmode\mskip.5\thinmuskip \else\kern0.08333em \fi}
\DeclareRobustCommand{\tubthinnerspaceneg}
@@ -1461,7 +1490,7 @@
\therevauth\therevtitle\therevpubinfo\endgraf}%
\vskip\medskipamount
}
-\def\titleref#1{{\slshape\frenchspacing#1\/}}
+\def\titleref#1{{\slshape\frenchspacing#1\nocorr}}
\let\booktitle=\titleref % older name
% \end{macrocode}
%
@@ -1604,7 +1633,8 @@
\@readFLN
\everyjob=\expandafter{\the\everyjob\@readFLN}
\InputIfFileExists{\jobname.fln}%
- {\TBInfo{Reading alternative file file \jobname.fln}}{}
+ {\TBInfo{Reading alternative file \jobname.fln}}
+ {}
% \end{macrocode}
%
% The following needs to work entirely in \TeX's mouth
@@ -1667,20 +1697,27 @@
\let\TBdriver\gobble
% \end{macrocode}
%
-% Some hyphenation exceptions:
+% Hyphenation exceptions. We read our own full |ushyphex.tex| (generated
+% from |tb0hyf.tex|) if it's available. The additional exceptions are
+% nearly all included in the file, but keep defining them anyway, since
+% we have for many years.
+%
+% But do not define any exceptions if |\tubomithyphenations| is defined.
+% This is needed for the |hyf| articles themselves.
%
% \begin{macrocode}
\ifx\tubomithyphenations\@thisisundefined
+\InputIfFileExists{ushyphex.tex}{}{} % ok if it's missing
\hyphenation{Del-a-ware Dijk-stra Duane Eijk-hout
- Flor-i-da Free-BSD Ghost-script Ghost-view
+ Flor-i-da Free-BSD Ghost-script
Hara-lam-bous Jac-kow-ski Ja-pa-nese Karls-ruhe Lua-Meta
- Mac-OS Ma-la-ya-lam Math-Sci-Net
+ Mac-OS Math-Sci-Net
Net-BSD Open-BSD Open-Office
- Pak-i-stan Pfa-Edit Post-Script Rich-ard Skoup South-all
+ Pak-i-stan 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
+ col-umns com-put-able com-put-abil-ity
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
@@ -1694,7 +1731,7 @@
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
+ pal-ettes par-a-digm par-a-dig-matic 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
@@ -1758,8 +1795,16 @@
\newdimen\headmargin \headmargin=3.5pc
% \end{macrocode}
%
-% In \LaTeXe, |twoside| option is forced on when
-% |article.cls| is loaded.
+% Don't go to a float page so soon. Not all of these are relevant to all
+% articles, but we may as well set them all.
+% \begin{macrocode}
+\renewcommand{\topfraction}{.9} % don't go to a float page so soon
+\renewcommand{\dbltopfraction}{.9}
+\renewcommand{\bottomfraction}{.7}
+\renewcommand{\textfraction}{.1}
+\renewcommand{\floatpagefraction}{.8}
+\renewcommand{\dblfloatpagefraction}{.8} % the most common one used
+% \end{macrocode}
%
% \subsection{Messing about with the \LaTeX{} logo}
% \label{sec:latex-logo}
@@ -2725,12 +2770,12 @@
\string#2\space used instead}#2}
% \end{macrocode}
%
-% \cs{l@<sectioning-name>} is for table of contents (of an article).
+% \cs{l@<sectioninglevel>} 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.
+% protrusion after \tableofcontents, or leaders get messed up.
%
% \begin{macrocode}
\def\TBtocsectionfont{\normalfont}
@@ -2741,14 +2786,16 @@
% |#1| is both the section number and title; |#2| is the page number.
% Per Ulrike, the hook calls are for tagging, introduced with the
% June 2023 \LaTeX.
+% qqq need to also do subsections like tb137carlisle to avoid hyphenation
\def\l@section#1#2{%
\addpenalty{\@secpenalty}%
\addvspace{\TBtocsectionspace}%
\@tempdima 1.5em
\begingroup
\parindent\z@
- \rightskip\z@ % article style makes \rightskip > 0
+ \rightskip=0pt plus2em
\parfillskip\z@
+ \hyphenpenalty=10000
\TBtocsectionfont
\leavevmode
\advance\leftskip\@tempdima
@@ -2772,7 +2819,7 @@
\UseHookWithArguments{contentsline/page/before}{4}
{\toclevel@part}{#1}{#2}{\@contentsline@destination}%
\fi
- #2%
+ \tubtypesetpageno{#2}%
\ifx\UseHookWithArguments\undefined\else
\UseHookWithArguments{contentsline/page/after}{4}
{\toclevel@part}{#1}{#2}{\@contentsline@destination}%
@@ -2905,9 +2952,14 @@
% With more recent LaTeX, define \@currentlabelname via hooks.
% \begin{macrocode}
\@ifl@t@r\fmtversion{2023-06-01}{%
- \AddToHookWithArguments{cmd/@sect/before}{\def\@currentlabelname{#7}}%
- \AddToHookWithArguments{cmd/@ssect/before}{\def\@currentlabelname{#5}}%
-}{%
+ \RequirePackage{gettitlestring}
+ \AddToHookWithArguments{cmd/@sect/before}{%
+ \GetTitleString{#7}%
+ \let\@currentlabelname\GetTitleStringResult}%
+ \AddToHookWithArguments{cmd/@ssect/before}{%
+ \GetTitleString{#5}%
+ \let\@currentlabelname\GetTitleStringResult}%
+}{% else older latex:
\let\@savelatexlabel=\label % so save original LaTeX command
%
\def\label#1{%
@@ -3023,7 +3075,7 @@
% Let's reduce the default space above captions a bit, and give it some
% flexibility. The default is |10pt|, which seems too much.
% \begin{macrocode}
-\setlength\abovecaptionskip{6pt plus1pt minus1pt}
+\setlength\abovecaptionskip{3pt plus2pt minus1pt}
% \end{macrocode}
%
% \subsection{Size changing commands}
@@ -3537,38 +3589,50 @@
\def\@oddhead{\MakeRegistrationMarks
\frenchspacing
\normalsize\csname normalshape\endcsname\rm \tubheadhook
- \rtitlex\qquad \midrtitle\hfil \rtitlenexttopage\quad\thepage}
+ \rtitlex\qquad \midrtitle\hfil
+ \rtitlenexttopage\quad\tubtypesetpageno{\thepage}}
\def\@evenhead{\MakeRegistrationMarks
\frenchspacing
\normalsize\csname normalshape\endcsname\rm \tubheadhook
- \thepage\quad\rtitlenexttopage \hfil\midrtitle \qquad\rtitlex}
+ \tubtypesetpageno{\thepage}\quad\rtitlenexttopage
+ \hfil\midrtitle \qquad\rtitlex}
-% Put a ? into the page number in all but a final run, so people
-% aren't tempted to cite it.
+% Put a ? into the page number in the headers in all but a final run, so
+% people aren't tempted to cite it.
%
-% We redefine |\thepage| so that the ? will also be used in page
-% references (in the text) and the toc. This is what's recommended by
-% the LaTeX developers: https://tex.stackexchange.com/questions/687258.
-% (Ulrike's example does this after loading hyperref, but doesn't seem
-% to matter?)
-\renewcommand\thepage{%
- \ifnum\value{page}>900
+\newcommand{\tubtypesetpageno}[1]{%
+ \ifnum #1>900
% in CM, numerals are exactly .5em.
%
% The \texorpdfstring avoids the usual hyperref warning:
% Token not allowed in a PDF string ... removing `\@ifnextchar'
\texorpdfstring{\makebox[.5em][l]{\small ?}}{?}%
%
- \textsl{\@arabic{\numexpr\value{page}-900\relax}}% e-tex
+ \textsl{\@arabic{\numexpr#1-900\relax}}% assuming e-tex
\else
- \@arabic{\value{page}}%
+ \@arabic{#1}%
\fi
}
-% This custom page number format will break makeindex, etc., so we have
-% to tell about the format. Per Ulrike:
-% \usepackage{index}
-% \newcommand\specialthepage{\inteval{\value{page}-900}}
-% \newindex[specialthepage]*{default}{idx}{ind}{Index}
+%
+% The above changes the page number in the headers and tocs. It does not
+% change the page number in cross-references, which will still show up
+% as `901' instead of `?1'. In order to do that, we'd have to redefine
+% |\thepage| (https://tex.stackexchange.com/questions/687258).
+%
+% The problem is that |\thepage| is not expected to contain typesetting
+% commands like |\makebox| and |\textsl|, but to expand to the simple
+% page number (in whatever form). For example, when redefining
+% |\thepage| to the above, terminal warnings then look like:
+% |LaTeX Warning: Citation `foo' on page \makebox [.5em][l]{...|
+% losing the actual page number.
+%
+% So apparently there is no way to add the ? correctly in all contexts.
+%
+% BTW, such a custom page number format would also break makeindex,
+% etc., but for that we could provide the information. Per Ulrike:
+%\usepackage{index}
+%\newcommand\specialthepage{\inteval{\value{page}-900}}
+%\newindex[specialthepage]*{default}{idx}{ind}{Index}
% can be used to reset the font, e.g., tb98kuester.
\def\tubheadhook{}
@@ -3735,7 +3799,7 @@
% spacefactor after inserting its text.
%
% \begin{macrocode}
-\newcommand{\acro}[1]{\textSMC{#1}\@}
+\DeclareRobustCommand{\acro}[1]{\textSMC{#1}\@}
%</common>
% \end{macrocode}
%
@@ -3843,12 +3907,13 @@
\fi
\authornumber\z@
\let\@signature\@defaultsignature
-\InputIfFileExists{ltugboat.cfg}{\TBInfo{Loading ltugboat
- configuration information}}{}
+\InputIfFileExists{ltugboat.cfg}
+ {\TBInfo{Loading ltugboat.cfg configuration information}}
+ {}
%</classtail>
% \end{macrocode}
%
-% \section{\protect\LaTeXe\ Proceedings class}
+% \section{\protect\LaTeXe\ proceedings class (no longer used)}
%
% \begin{macro}{\@tugclass}
% Make the code of |ltugboat.cls| (when we load it) say it's really
@@ -3943,7 +4008,7 @@
%
% \begin{macrocode}
\InputIfFileExists{\@tugclass.cfg}{\ClassInfo{ltugproc}%
- {Loading ltugproc configuration information}}{}
+ {Loading ltugproc.cfg configuration information}}{}
\@ifundefined{TUGprocExtraOptions}%
{\let\TUGprocExtraOptions\@empty}%
{\edef\TUGprocExtraOptions{,\TUGprocExtraOptions}}