diff options
Diffstat (limited to 'macros/latex/contrib/tugboat/tugboat.dtx')
-rw-r--r-- | macros/latex/contrib/tugboat/tugboat.dtx | 202 |
1 files changed, 145 insertions, 57 deletions
diff --git a/macros/latex/contrib/tugboat/tugboat.dtx b/macros/latex/contrib/tugboat/tugboat.dtx index ffb09d15f3..d205ab011d 100644 --- a/macros/latex/contrib/tugboat/tugboat.dtx +++ b/macros/latex/contrib/tugboat/tugboat.dtx @@ -1,8 +1,8 @@ % \iffalse (this is a meta-comment (so they say)) -% $Id: tugboat.dtx 424 2022-05-19 22:45:08Z karl $ +% $Id: tugboat.dtx 459 2023-01-16 21:05:37Z karl $ % tugboat.dtx - main source for LaTeX TUGboat classes. % -% Copyright 1994-2022 TeX Users Group. +% Copyright 1994-2023 TeX Users Group. % % This file is part of the tugboat package. % @@ -28,7 +28,7 @@ %<ltugboatsty>\ProvidesPackage{ltugboat} %<ltugprocsty>\ProvidesPackage{ltugproc} %<ltugcomn> \ProvidesPackage{ltugcomn} - [2022-05-19 v2.27 + [2023-01-16 v2.28 %<ltugboatcls> TUGboat journal class% %<ltugproccls> TUG conference proceedings class% %<ltugboatsty|ltugprocsty> TUG compatibility package% @@ -240,7 +240,8 @@ % |\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 as straight text\\ +% |\titleref|& with one argument, format title as straight text +% (slanted, frenchspacing) \\ % |\Input|& |\input| with some other bookkeeping for % case where multiple articles are put together\\ % |\TBremark|& reminder to \TUB{} editorial staff\\ @@ -268,6 +269,22 @@ % % \subsection{Setup and options} % +% Occasionally we need to do different things when running under +% traditional (pdf)latex or a native Unicode engine. Since we don't need +% any fancier distinctions, instead of reading the |iftex| or another +% package, do the test directly. +% +% \begin{macrocode} +%<*common> +\newif\ifTBunicodeengine +\ifx\Umathchardef\@thisisundefined % not (xetex|luatex) + \TBunicodeenginefalse +\else + \TBunicodeenginetrue +\fi +%</common> +% \end{macrocode} +% % 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 @@ -298,7 +315,7 @@ \def\TBWarningNL{\ClassWarningNoLine{\@tugclass}} % \end{macrocode} % -% |draft| vs.\ |preprint| vs.\ |final|. +% Class options: |draft| vs.\ |preprint| vs.\ |final|. % % \begin{macrocode} \DeclareOption{draft}{% @@ -508,12 +525,16 @@ % later\dots % % \begin{macrocode} -\def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}% - \selectfont} +\ifTBunicodeengine + % there is no "LM unslanted" in OpenType, so use the standard cmu + % scaled for the current text size. Not worth more effort. + \def\EdNoteFont{\font\ednotefont = cmu10 at 1em } +\else % traditional engine: + \def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}\selectfont} +\fi %</ltugboatcls> % \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 @@ -652,6 +673,11 @@ % probably doesn't need to be\dots What's more, it doesn't appear in % the mythical 2.09 version of the package.) % +% We end up wanting this fairly often, and \LaTeX\ removed \cs{line}. +% \begin{macrocode} +\def\tubline{\hbox to \hsize} +% \end{macrocode} +% % \subsection{Abbreviations and logos} % \label{abbr-logo} % @@ -825,6 +851,7 @@ \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\PDF{\acro{PDF}} \def\PGF{\acro{PGF}} \def\PHP{\acro{PHP}} @@ -859,10 +886,24 @@ \def\TeXworks{\TeX\kern-.07em works} \def\TeXXeT{\TeX-{}-\XeT} \def\TFM{\acro{TFM}} -\ifx\Umathchardef\@thisisundefined % not (xetex|luatex) -\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 +\ifTBunicodeengine + \AtBeginDocument{% in case a different font is loaded + % \iffontchar is from e-TeX; safe to use under Unicode engines. + \iffontchar\font"1EBF + \def\TBecircacute{\char"1EBF }% + \else + \def\TBecircacute{\^e\llap{\raise 0.5ex\hbox{\'{}}}}% + \fi + \def\Thanh{H\`an~Th\TBecircacute~Th\`anh}% + }% +\else % non-Unicode engine, use our traditional definition. + \def\Thanh{H\`an~Th\^e\llap{\raise 0.5ex\hbox{\'{}}}~Th\`anh} + % We could also go the other direction, and always use the Unicode + % character, after: + % \ifdefined\DeclareUnicodeCharacter + % \DeclareUnicodeCharacter{1EBF}{\^e\llap{\raise 0.5ex\hbox{\'{}}}} + % \fi + % but let's make the smaller change. \fi \def\TikZ{Ti{\em k}Z} \def\ttn{\textsl{TTN}\@} @@ -967,6 +1008,16 @@ % \end{macrocode} % \end{macro} % +% 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 for \cs{let} in individual papers. +\DeclareRobustCommand{\tubdots}{% + .\kern\fontdimen3\font + .\kern\fontdimen3\font + .\kern\fontdimen3\font} +% % \begin{macro}{\allowhyphens} % Hyphen control: first, we save (via \cs{edef}) the hyphenpenalties in % \cs{allowhyphens}. This allows us to permit hyphens temporarily in @@ -1128,21 +1179,26 @@ % skips, etc. % \begin{macrocode} \def\raggedright{% - \nohyphens - \rightskip=\raggedskip\@plus\raggedstretch \raggedspaces + \nohyphens \raggedspaces + \rightskip=\raggedskip\@plus\raggedstretch \parfillskip=\raggedparfill } \def\raggedleft{% - \nohyphens - \leftskip=\raggedskip\@plus\raggedstretch \raggedspaces + \nohyphens \raggedspaces + \leftskip=\raggedskip\@plus\raggedstretch \parfillskip=\z@skip + \let\\ \@centercr % else tabulararray fails, + % https://github.com/lvjr/tabularray/issues/348 } \def\raggedcenter{% - \nohyphens + \nohyphens \raggedspaces \leftskip=\raggedskip\@plus\raggedstretch - \rightskip=\leftskip \raggedspaces - \parindent=\z@ \parfillskip=\z@skip + \rightskip=\leftskip + \parindent=\z@ + \parfillskip=\z@skip } +% +% Undo |\raggedspaces|. \def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip} % \end{macrocode} % \end{macro} @@ -1218,12 +1274,19 @@ % % 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}} +% Would be nice to change catcode of _ for LaTeX3. +\DeclareRobustCommand{\cs}[1]{\texorpdfstring + {{\tt \char`\\#1}}% + {\textbackslash #1}% +} % % This command was defined much later than the others around here, 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`\}}}} +\DeclareRobustCommand{\tubbraced}[1]{\texorpdfstring + {\mbox{\texttt{\char`\{#1\char`\}}}}% + {\textbraceleft #1\textbraceright}% +} % % Well, just the \begin part. Never seen it used. \DeclareRobustCommand{\env}[1]{\cs{begin}\tubbraced{#1}} @@ -1242,6 +1305,7 @@ % \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 \let\url\texttt \fi % er, make sure \url is defined @@ -1249,24 +1313,40 @@ % This hyperref hook-in is due to Ulrike Fischer. % \url{https://github.com/latex3/hyperref/issues/125}. % \tb[sh]url@ are defined next. + \DeclareRobustCommand*{\tburl}{\tbsurl}% \DeclareRobustCommand*{\tbsurl}{\hyper@normalise\tbsurl@}% \DeclareRobustCommand*{\tbhurl}{\hyper@normalise\tbhurl@} \fi } % -% Outside \AtBeginDocument, back at the top level of the dtx, +% Outside \AtBeginDocument, back at the top level of the dtx, we % turn on expl syntax for the main definitions of \tb[sh]url. We want % to auto-remove an explicit protocol in case it -% was given. Only the correct protocol is removed, the incorrect -% protocol (\verb|\tbsurl{http://}|) generates an invalid link. That's ok -% because the link wouldn't work anyway. +% was given. +% +% Only the correct protocol is removed; if \verb|http://| is +% given to \cs{tbsurl}, it is used (and printed) as-is. This is useful +% so we can do \verb|\let\url\tbsurl| when printing bibliographies. +% +% Giving \verb|https://| to \cs{tbhurl}, on the other hand, generates an +% invalid link; in practice there's no use for that so we don't bother +% to check for it. +% \ExplSyntaxOn \def\tbsurl@#1 % https { \str_set:Nn\l_tmpa_str{#1} - \str_remove_once:Nn\l_tmpa_str{https://} - \expandafter\hyper@linkurl\expandafter{\expandafter\Hurl\expandafter - {\l_tmpa_str}}{https://\l_tmpa_str} + \str_if_in:NnTF \l_tmpa_str {http://} + { + \expandafter\hyper@linkurl + \expandafter{\expandafter\Hurl\expandafter{\l_tmpa_str}}{\l_tmpa_str} + } + { + \str_remove_once:Nn\l_tmpa_str{https://} + \expandafter\hyper@linkurl + \expandafter{\expandafter\Hurl\expandafter{\l_tmpa_str}} + {https://\l_tmpa_str} + } } \def\tbhurl@#1 % http { @@ -1279,6 +1359,7 @@ % % Now let's use those macros for putting a url into a simple % ragged-right footnote. +\def\tburlfootnote{\tbsurlfootnote} \def\tbsurlfootnote#1{\footnote{\raggedright\tbsurl{#1}}} \def\tbhurlfootnote#1{\footnote{\raggedright\tbhurl{#1}}} % @@ -1373,10 +1454,11 @@ \therevauth\therevtitle\therevpubinfo\endgraf}% \vskip\medskipamount } -\def\booktitle#1{{\slshape\frenchspacing#1\/}} +\def\titleref#1{{\slshape\frenchspacing#1\/}} +\let\booktitle=\titleref % older name % \end{macrocode} % -% \subsection{Dates, volume and issue numbers, etc.} +% \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 @@ -1584,7 +1666,7 @@ \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 Ja-pa-nese Karls-ruhe + Hara-lam-bous Jac-kow-ski Ja-pa-nese Karls-ruhe Lua-Meta Mac-OS Ma-la-ya-lam Math-Sci-Net Net-BSD Open-BSD Open-Office Pak-i-stan Pfa-Edit Post-Script Rich-ard Skoup South-all @@ -1624,19 +1706,19 @@ % \end{macrocode} % \subsection{Page dimensions, glue, penalties, etc.} % \begin{macrocode} -\textheight 54pc -\textwidth 39pc -\columnsep 1.5pc -\columnwidth 18.75pc +\textheight 54pc % 648pt = 645.58bp = 8.97in +\textwidth 39pc % 468pt = 466.25bp = 6.48in +\columnsep 1.5pc % 18pt = 17.93bp = .249in +\columnwidth 18.75pc % 225pt = 224.16bp = 3.11in \hfuzz 1pt -\parindent \normalparindent +\parindent \normalparindent % 20pt \parskip \z@ % \@plus\p@ \leftmargini 2em \leftmarginv .5em \leftmarginvi .5em \oddsidemargin \z@ \evensidemargin \z@ -\topmargin -2.5pc +\topmargin -2.5pc % 30pt = 29.89bp = .415in \headheight 12\p@ \headsep 20\p@ \marginparwidth 48\p@ @@ -1646,7 +1728,7 @@ \parsep=3\p@\@plus\p@\@minus\p@ \itemsep=\parsep % -% The width of one column plus gutter (=243pt) is useful sometimes. +% The width of one column plus gutter (=243pt =242.09bp) is useful sometimes. \newdimen\tubcolwidthandgutter \tubcolwidthandgutter=\columnwidth \advance\tubcolwidthandgutter by \columnsep @@ -2504,41 +2586,47 @@ % % \subsection{Section headings} % -% Redefine style of section headings to match plain \TUB. -% Negative beforeskip suppresses following parindent. (So -% negate the stretch and shrink too). +% 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. +% 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. +% 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. +% +% The \cs{tubsecfmt} macro defines our standard formatting for section +% titles: ragged right, french spacing, no hyphenation. +% The \cs{tubsechook} macro allows overriding the defaults. % % \begin{macrocode} \def\tubsechook{} +\def\tubsecfmt{\normalsize\bf\raggedright\frenchspacing\nohyphens\tubsechook} +% \if@numbersec \def\section{\TB@startsection{{section}% 1% \z@ {-8\p@ \@plus-2\p@ \@minus-2\p@}% {4\p@}% - {\normalsize\bf\raggedright\hyphenpenalty\@M\tubsechook}}} + {\tubsecfmt}}} \def\subsection{\TB@startsection{{subsection}% 2% \z@ {-8\p@ \@plus-2\p@ \@minus-2\p@}% {4\p@}% - {\normalsize\bf\raggedright\hyphenpenalty\@M\tubsechook}}} + {\tubsecfmt}}} \def\subsubsection{\TB@startsection{{subsubsection}% 3% \z@ {-8\p@ \@plus-2\p@ \@minus-2\p@}% {4\p@}% - {\normalsize\bf\raggedright\hyphenpenalty\@M\tubsechook}}} + {\tubsecfmt}}} \def\paragraph{\TB@startsection{{paragraph}% 4% \z@ @@ -2559,21 +2647,21 @@ \z@ {-8\p@ \@plus-2\p@ \@minus-2\p@}% {4\p@}% - {\normalsize\bf\raggedright\hyphenpenalty\@M\tubsechook}}} + {\tubsecfmt}}} \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\tubsechook}}} + {\tubsecfmt}}} \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\tubsechook}}} + {\tubsecfmt}}} \fi % \end{macrocode} % @@ -2866,7 +2954,7 @@ % \end{macrocode} % % Also use \cs{tubcaptionfonts} for the caption -% labels, and put the label (e.g., ``Figure 1'') in bold. +% labels, and put the label (e.g., ``Figure~1'') in bold. % If the \texttt{listings} package is being used, bold for its % label too; this \cs{def} is too early, but maybe listings will % play nice later. @@ -2925,10 +3013,10 @@ \def\@listii{% \leftmargin\leftmarginii \labelwidth=\leftmarginii \advance\labelwidth-\labelsep - \topsep=2\p@\@plus\p@\@minus\p@ - \parsep=\p@\@plus\p@\@minus\p@ - \itemsep=\parsep - \listparindent=1em + \topsep=2\p@\@plus\p@\@minus\p@ % space between first item and preceding + \parsep=\p@\@plus\p@\@minus\p@ + \itemsep=\parsep % space between successive items + \listparindent=1em % indentation of subsequent paragraphs } \def\@listiii{% |