| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2019-2025 |
| 4 |
% The LaTeX Project and any individual authors listed elsewhere |
| 5 |
% in this file. |
| 6 |
% |
| 7 |
% This file is part of the LaTeX base system. |
| 8 |
% -—————————————— |
| 9 |
% |
| 10 |
% It may be distributed and/or modified under the |
| 11 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 12 |
% of this license or (at your option) any later version. |
| 13 |
% The latest version of this license is in |
| 14 |
% https://www.latex-project.org/lppl.txt |
| 15 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 16 |
% version 2008 or later. |
| 17 |
% |
| 18 |
% This file has the LPPL maintenance status "maintained". |
| 19 |
% |
| 20 |
% The list of all files belonging to the LaTeX base distribution is |
| 21 |
% given in the file `manifest.txt'. See also `legal.txt' for additional |
| 22 |
% information. |
| 23 |
% |
| 24 |
% The list of derived (unpacked) files belonging to the distribution |
| 25 |
% and covered by LPPL is defined by the unpacking scripts (with |
| 26 |
% extension .ins) which are part of the distribution. |
| 27 |
% |
| 28 |
% \fi |
| 29 |
% Filename: ltnews34.tex |
| 30 |
% |
| 31 |
% This is issue 34 of LaTeX News. |
| 32 |
|
| 33 |
\NeedsTeXFormat{LaTeX2e}[2020-02-02] |
| 34 |
|
| 35 |
\documentclass{ltnews} |
| 36 |
|
| 37 |
%% Maybe needed only for Chris' inadequate system: |
| 38 |
\providecommand\Dash {\unskip \textemdash} |
| 39 |
|
| 40 |
%% NOTE: Chris' preferred hyphens! |
| 41 |
%%\showhyphens{parameters} |
| 42 |
%% \hyphenation{because parameters parameter} |
| 43 |
|
| 44 |
\usepackage[T1]{fontenc} |
| 45 |
|
| 46 |
\usepackage{lmodern,url,hologo} |
| 47 |
|
| 48 |
\usepackage{csquotes} |
| 49 |
\usepackage{multicol} |
| 50 |
|
| 51 |
\providecommand\hook[1]{\texttt{#1}} |
| 52 |
|
| 53 |
\providecommand\meta[1]{$\langle$\textrm{\itshape#1}$\rangle$} |
| 54 |
\providecommand\option[1]{\texttt{#1}} |
| 55 |
\providecommand\env[1]{\texttt{#1}} |
| 56 |
\providecommand\Arg[1]{\texttt\{\meta{#1}\texttt\}} |
| 57 |
|
| 58 |
|
| 59 |
\providecommand\eTeX{\hologo{eTeX}} |
| 60 |
\providecommand\XeTeX{\hologo{XeTeX}} |
| 61 |
\providecommand\LuaTeX{\hologo{LuaTeX}} |
| 62 |
\providecommand\pdfTeX{\hologo{pdfTeX}} |
| 63 |
\providecommand\MiKTeX{\hologo{MiKTeX}} |
| 64 |
\providecommand\CTAN{\textsc{ctan}} |
| 65 |
\providecommand\TL{\TeX\,Live} |
| 66 |
\providecommand\githubissue[2][]{\ifhmode\unskip\fi |
| 67 |
\quad\penalty500\strut\nobreak\hfill |
| 68 |
\mbox{\small\slshape(% |
| 69 |
\href{https://github.com/latex3/latex2e/issues/\getfirstgithubissue#2 \relax}% |
| 70 |
{github issue#1 #2}% |
| 71 |
)}% |
| 72 |
\par\smallskip} |
| 73 |
%% But Chris has to mostly disable \href for his TEXPAD app: |
| 74 |
%% \def\href #1{} % Only For Chris' deficient TeX engine |
| 75 |
|
| 76 |
% simple solution right now (just link to the first issue if there are more) |
| 77 |
\def\getfirstgithubissue#1 #2\relax{#1} |
| 78 |
|
| 79 |
\providecommand\sxissue[1]{\ifhmode\unskip\fi |
| 80 |
\quad\penalty500\strut\nobreak\hfill |
| 81 |
\mbox{\small\slshape(\url{https://tex.stackexchange.com/#1})}\par} |
| 82 |
|
| 83 |
\providecommand\gnatsissue[2]{\ifhmode\unskip\fi |
| 84 |
\quad\penalty500\strut\nobreak\hfill |
| 85 |
\mbox{\small\slshape(% |
| 86 |
\href{https://www.latex-project.org/cgi-bin/ltxbugs2html?pr=#1\%2F\getfirstgithubissue#2 \relax}% |
| 87 |
{gnats issue #1/#2}% |
| 88 |
)}% |
| 89 |
\par} |
| 90 |
|
| 91 |
\let\cls\pkg |
| 92 |
\providecommand\env[1]{\texttt{#1}} |
| 93 |
\providecommand\acro[1]{\textsc{#1}} |
| 94 |
|
| 95 |
\vbadness=1400 % accept slightly empty columns |
| 96 |
|
| 97 |
|
| 98 |
\makeatletter |
| 99 |
% maybe not the greatest design but normally we wouldn't have subsubsections |
| 100 |
\renewcommand{\subsubsection}{% |
| 101 |
\@startsection {subsubsection}{2}{0pt}{1.5ex \@plus 1ex \@minus .2ex}% |
| 102 |
{-1em}{\@subheadingfont\colonize}% |
| 103 |
} |
| 104 |
\providecommand\colonize[1]{#1:} |
| 105 |
\makeatother |
| 106 |
|
| 107 |
\let\finalvspace\vspace % for document layout fixes |
| 108 |
|
| 109 |
% Undo ltnews's \verbatim@font with active < and > |
| 110 |
\makeatletter |
| 111 |
\def\verbatim@font{% |
| 112 |
\normalsize\ttfamily} |
| 113 |
\makeatletter |
| 114 |
|
| 115 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 116 |
\providecommand\tubcommand[1]{} |
| 117 |
\tubcommand{\input{tubltmac}} |
| 118 |
|
| 119 |
\publicationday{15} |
| 120 |
\publicationmonth{November} |
| 121 |
\publicationyear{2021} |
| 122 |
|
| 123 |
\publicationissue{34} |
| 124 |
|
| 125 |
\begin{document} |
| 126 |
|
| 127 |
\tubcommand{\addtolength\textheight{4.2pc}} % only for TUB |
| 128 |
|
| 129 |
\maketitle |
| 130 |
{\hyphenpenalty=10000 \spaceskip=3.33pt \hbadness=10000 \tableofcontents} |
| 131 |
|
| 132 |
\setlength\rightskip{0pt plus 3em} |
| 133 |
|
| 134 |
|
| 135 |
\medskip |
| 136 |
|
| 137 |
|
| 138 |
\section{Introduction} |
| 139 |
|
| 140 |
|
| 141 |
This release of \LaTeX{} does not contain any major new modules, but |
| 142 |
is focused around consolidation and improvements of the functionality |
| 143 |
introduced in previous releases. In addition, various smaller |
| 144 |
enhancements and bug fixes have been added to the kernel and the core |
| 145 |
packages. |
| 146 |
|
| 147 |
|
| 148 |
\section{Hook business} |
| 149 |
|
| 150 |
Since the introduction of the hook management system in the 2020 |
| 151 |
release of \LaTeX{}~\cite{34:ltnews32} package |
| 152 |
developers have started |
| 153 |
to make more and more use of this new functionality. One result |
| 154 |
of this increased activity has been a |
| 155 |
number of queries which show that some of the documentation was not |
| 156 |
precise enough and that some clarifications were needed; these |
| 157 |
deficiencies have now been addressed in the documentation. |
| 158 |
% |
| 159 |
The increased usage has also revealed |
| 160 |
a small number of errors that we thought |
| 161 |
should be corrected now, while the adoption rate is still relatively |
| 162 |
small; the following problems have therefore been addressed in this release. |
| 163 |
|
| 164 |
|
| 165 |
\subsection{Provide \cs{ActivateGenericHook}} |
| 166 |
|
| 167 |
The hook management system offers a number of generic hooks, i.e., |
| 168 |
hooks whose names contain a variable component such as the name |
| 169 |
of an environment. Predeclaring such hooks is not feasible, |
| 170 |
so these hooks use a different mechanism: they are |
| 171 |
implicitly available, springing into life the moment a package, or |
| 172 |
the document preamble, adds any code to one by using \cs{AddToHook}. |
| 173 |
% |
| 174 |
The kernel offers such hooks for environments |
| 175 |
(\texttt{env/...}) and commands (\texttt{cmd/...}), and also for files, |
| 176 |
packages and classes (\texttt{file/...}, |
| 177 |
\texttt{include/...}, \texttt{package/...}, \texttt{class/...}). |
| 178 |
|
| 179 |
It is also possible to offer such generic hooks in |
| 180 |
packages if, for example, hooks are needed that depend on the |
| 181 |
current language and therefore need the |
| 182 |
language name as part of the hook name (but you probably |
| 183 |
don't know beforehand all the necessary names). |
| 184 |
|
| 185 |
If you want to offer such generic hooks, you can now |
| 186 |
do this by using |
| 187 |
\cs{UseHook} or \cs{UseOneTimeHook} in your (package) code, but |
| 188 |
\emph{without declaring the hook} with \cs{NewHook}. However, without |
| 189 |
further work, a call to \cs{UseHook} with an undeclared hook name |
| 190 |
will do |
| 191 |
nothing; so, as an additional setup step, it is necessary to explicitly |
| 192 |
activate the generic hook by using \cs{ActivateGenericHook}.\footnote{Note |
| 193 |
that in the previous release we offered \cs{ProvideHook} as a means |
| 194 |
to achieve this effect, but the name was badly chosen so we decided |
| 195 |
to deprecate it and now offer \cs{ActivateGenericHook} instead.} |
| 196 |
|
| 197 |
Assuming |
| 198 |
that you don't know all the different hook names up front, it will |
| 199 |
remain the task of the users of your package to activate the hook |
| 200 |
themselves before adding code to it. For example, Babel offers hooks |
| 201 |
such as \hook{babel/\meta{language}/afterextras} |
| 202 |
that enable a user |
| 203 |
to add language specific declarations to these \enquote{extras}. One can then write |
| 204 |
\begin{verbatim} |
| 205 |
\ActivateGenericHook |
| 206 |
{babel/ngerman/afterextras} |
| 207 |
\AddToHook{babel/ngerman/afterextras} |
| 208 |
{\color{blue}} |
| 209 |
\end{verbatim} |
| 210 |
after which all German words would be colored blue in the text. |
| 211 |
|
| 212 |
Note that a generic hook produced in this way is always a normal hook. |
| 213 |
|
| 214 |
\subsection{Standardized names for the generic hooks} |
| 215 |
|
| 216 |
The initial set of generic hooks provided by the kernel had |
| 217 |
two patterns of names: |
| 218 |
ones like |
| 219 |
\verb|env/|\meta{name}\verb|/after|, |
| 220 |
with the variable, \meta{name}, part |
| 221 |
in the middle position; |
| 222 |
and ones like |
| 223 |
\verb|file/after/|\meta{name}, with the |
| 224 |
variable part in the third |
| 225 |
position. |
| 226 |
% |
| 227 |
The coexistence of these two types caused confusion because |
| 228 |
the user had to remember in which position the variable part was |
| 229 |
supposed to go; and it also made the code more complicated and slower. |
| 230 |
|
| 231 |
The file-related hooks have therefore been renamed |
| 232 |
so that the variable part of |
| 233 |
the name is in the middle, as with all other hooks. |
| 234 |
The changes are listed here: |
| 235 |
\smallskip |
| 236 |
\begin{center} |
| 237 |
\small\ttfamily |
| 238 |
\begin{tabular}{l@{$\;\rightarrow\;$}l} |
| 239 |
\hline |
| 240 |
\multicolumn{1}{l}{Old name} & \rmfamily New name \\ |
| 241 |
\hline |
| 242 |
file/before/\meta{name} & file/\meta{name}/before \\ |
| 243 |
file/after/\meta{name} & file/\meta{name}/after \\ |
| 244 |
package/before/\meta{name} & package/\meta{name}/before \\ |
| 245 |
package/after/\meta{name} & package/\meta{name}/after \\ |
| 246 |
class/before/\meta{name} & class/\meta{name}/before \\ |
| 247 |
class/after/\meta{name} & class/\meta{name}/after \\ |
| 248 |
include/before/\meta{name} & include/\meta{name}/before \\ |
| 249 |
include/end/\meta{name} & include/\meta{name}/end \\ |
| 250 |
include/after/\meta{name} & include/\meta{name}/after \\ |
| 251 |
\hline |
| 252 |
\end{tabular} |
| 253 |
\end{center} |
| 254 |
\smallskip |
| 255 |
Since this is a breaking change, the old names will still work for a |
| 256 |
while so that users and package authors have enough time to adjust; |
| 257 |
but a warning will be issued when the old names are used. |
| 258 |
Eventually the deprecated names will be turned into errors and |
| 259 |
then removed completely. |
| 260 |
% |
| 261 |
\githubissue{648} |
| 262 |
|
| 263 |
|
| 264 |
\subsection{Some file hooks made one-time} |
| 265 |
|
| 266 |
Classes, packages and included files can only be loaded once in a |
| 267 |
\LaTeX{} document. For this reason, the hooks that are specific to loading such |
| 268 |
files have been made one-time hooks. Beside being more efficient, this |
| 269 |
supports the following important use case |
| 270 |
{\hfuzz=1pt \begin{verbatim} |
| 271 |
\AddToHook{package/varioref/after} |
| 272 |
{... apply when the package gets loaded, |
| 273 |
or apply now (if it is already loaded) ...} |
| 274 |
\end{verbatim} |
| 275 |
} |
| 276 |
\noindent |
| 277 |
without the need to first test whether the package is already loaded. |
| 278 |
% |
| 279 |
\githubissue{626} |
| 280 |
|
| 281 |
|
| 282 |
\subsection{Clearing extra hook code for the next invocation} |
| 283 |
|
| 284 |
There are a few use cases where it is helpful if one can cancel |
| 285 |
an earlier use of \cs{AddToHookNext}: for example, when a page is |
| 286 |
discarded with \cs{DiscardShipoutBox} because only some pages of the |
| 287 |
document are printed. For such situations the new command |
| 288 |
\cs{ClearHookNext} is now provided. |
| 289 |
% |
| 290 |
\githubissue{565} |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
\subsection{Cleaning up after \cs{UseOneTimeHook}} |
| 295 |
|
| 296 |
Some hooks are meant to be used only once in a document, and any |
| 297 |
further attempt to add code to one of these will |
| 298 |
cause the code to be executed |
| 299 |
immediately instead of being added to the hook. |
| 300 |
% |
| 301 |
The initial implementation of |
| 302 |
this concept was very simple and didn't anticipate that packages may try to |
| 303 |
execute a one-time hook several times, resulting in the hook code |
| 304 |
being executed repeatedly. Thus the implementation was fine for |
| 305 |
simple cases (such as the \hook{begindocument} hook) but it causes |
| 306 |
trouble if the one-time hook was intended, for example, as an |
| 307 |
initialization hook that is used just once (when a command is first |
| 308 |
called) but is then ignored in further calls. |
| 309 |
|
| 310 |
This deficiency has been addressed, and now a one-time |
| 311 |
hook will only be executed once, with |
| 312 |
its code being removed after use to free up some memory. |
| 313 |
% |
| 314 |
\githubissue{565} |
| 315 |
|
| 316 |
|
| 317 |
\subsection{\cs{RemoveFromHook} with a missing code label} |
| 318 |
|
| 319 |
In the first version of \cs{RemoveFromHook}, when the code label |
| 320 |
to be removed didn't exist in the hook a ``removal order'' would be |
| 321 |
queued; and then, the next time something tried to add that label to the hook, |
| 322 |
this \cs{AddToHook} action would be cancelled by the removal order, so that no code |
| 323 |
would be added that one time. This was so that, in principle, package loading |
| 324 |
order wouldn't matter. |
| 325 |
% |
| 326 |
However, this implementation didn't work as |
| 327 |
intended because, while two \cs{AddToHook} actions with a given label would be |
| 328 |
removed by a single \cs{RemoveFromHook}, one \cs{RemoveFromHook} could |
| 329 |
not cancel two \cs{AddToHook} actions for that label; this caused |
| 330 |
confusion and also led to further problems. |
| 331 |
|
| 332 |
The implementation has now been changed, so that |
| 333 |
\cs{RemoveFromHook} removes only code |
| 334 |
labels that already exist in a hook: it will display a |
| 335 |
warning if there is no such code label. |
| 336 |
|
| 337 |
Note that, whereas when working with a single package |
| 338 |
you should use \cs{RemoveFromHook} to remove a code label, |
| 339 |
when working with more than one package, the |
| 340 |
\texttt{voids} relation should preferably be used. |
| 341 |
% |
| 342 |
This is best because this relation is non-destructive |
| 343 |
(meaning that it can be reverted later by using another relation), |
| 344 |
and it is also truly independent of package loading order. |
| 345 |
% |
| 346 |
\githubissue{625} |
| 347 |
|
| 348 |
\subsection{Patching commands with parameter tokens} |
| 349 |
|
| 350 |
In the last release, \LaTeX's hook mechanism was extended to add |
| 351 |
support for hooking into commands using generic \hook{cmd} hooks |
| 352 |
(see~\cite{34:ltnews33}). That version of the extension had a bug: the |
| 353 |
patching of some commands that contained a parameter token |
| 354 |
(normally \verb|#|) in |
| 355 |
their definition would fail with a low-level \TeX{} error. This has now |
| 356 |
been fixed so that patching now works for those commands as well. |
| 357 |
% |
| 358 |
\githubissue{697} |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
\section{New or improved commands} |
| 363 |
|
| 364 |
\subsection{\cs{NewCommandCopy} and \cs{ShowCommand} extended} |
| 365 |
|
| 366 |
Since the 2020-10-01 release (see~\cite{34:ltnews32}), \LaTeX{} |
| 367 |
has provided \cs{NewCommandCopy} to copy robust commands, |
| 368 |
and \cs{ShowCommand} to show their definitions on the terminal. |
| 369 |
% |
| 370 |
In that same release, the \pkg{xparse} package was integrated |
| 371 |
into the kernel (as \pkg{ltcmd}) to offer \cs{NewDocumentCommand}, etc. |
| 372 |
% |
| 373 |
However, the extended support for \cs{NewCommandCopy} and |
| 374 |
\cs{ShowCommand} was not implemented in \pkg{ltcmd}. The present |
| 375 |
\LaTeX{} release implements this support, so now commands |
| 376 |
defined with \cs{NewDocumentCommand} and friends can also be copied, and their definitions |
| 377 |
can be easily shown on the terminal without the need for ``\cs{csname} gymnastics''. |
| 378 |
% |
| 379 |
\githubissue{569} |
| 380 |
|
| 381 |
|
| 382 |
\subsection{Undo math alphabet allocations if necessary} |
| 383 |
|
| 384 |
\TeX{}, or more exactly the 8-bit versions of \TeX, such as \pdfTeX{}, |
| 385 |
have a hard limit of 16 on the number of different math font groups |
| 386 |
(\cs{fam} or \cs{mathgroup}) that can be used in a single formula. For each symbol font |
| 387 |
declared (by a package or in the preamble) an extra math group is allocated, |
| 388 |
and the same happens for each math alphabet, (such as \cs{mathbf}) |
| 389 |
once it |
| 390 |
gets used anywhere in the document. Up to now, these math |
| 391 |
alphabet allocations were permanent, even if they were |
| 392 |
used only once; |
| 393 |
the result was that in complex documents you |
| 394 |
could easily run out of available math font groups. |
| 395 |
The only remedy for this was to |
| 396 |
define your own math version, which is a complicated and cumbersome process. |
| 397 |
|
| 398 |
This situation has now been improved by the introduction of a new counter |
| 399 |
\texttt{localmathalphabets}: this counter governs how many of |
| 400 |
the math group slots are assigned locally when a new math |
| 401 |
alphabet (and a new math group) is needed. |
| 402 |
% |
| 403 |
Once the current formula is finished, every such further (local) |
| 404 |
allocation is undone, giving you a fighting chance of being |
| 405 |
able to use different new math alphabets in the next formula. |
| 406 |
|
| 407 |
The default value of \texttt{localmathalphabets} is 2, |
| 408 |
but if you need more local alphabets because of the complexity of your |
| 409 |
document, you can set this to a higher value such as 4 or 5. |
| 410 |
Setting it even higher is possible, but this would seldom |
| 411 |
be useful because many group slots will be taken up by |
| 412 |
symbol fonts and such slots are always permanently allocated, |
| 413 |
whether used or not. |
| 414 |
% |
| 415 |
\githubissue{676} |
| 416 |
|
| 417 |
|
| 418 |
\subsection{New default value for \cs{tracinglostchars}} |
| 419 |
|
| 420 |
In 2021 all \TeX{} engines were enhanced so that \cs{tracinglostchars} |
| 421 |
supported the value \texttt{3} to turn missing |
| 422 |
characters into errors and not just warnings. |
| 423 |
% |
| 424 |
This engine change made us |
| 425 |
realize that \LaTeX{} should set a better default value for this parameter |
| 426 |
(previously, the warning was written only to the transcript file). |
| 427 |
Using the now available value of \texttt{3} as the default |
| 428 |
would be ideal, but for |
| 429 |
compatibility reasons we have only increased it to \texttt{2} in the kernel. |
| 430 |
% |
| 431 |
However, we recommend setting \cs{tracinglostchars}\texttt{=3}, |
| 432 |
in either a package or the |
| 433 |
preamble of your documents: this is because having missing glyphs |
| 434 |
in the output is definitely an error and should therefore be |
| 435 |
flagged as such (to ensure that it gets proper attention). |
| 436 |
Further reasons, related especially to Unicode engines, for making |
| 437 |
this recommended change are explained later in this newsletter |
| 438 |
(in connection with the misuse of text accents in math mode). |
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
\subsection{\cs{PackageNote} and \cs{ClassNote} added} |
| 443 |
|
| 444 |
\LaTeX{} offers these three commands: \cs{PackageError} to signal errors that |
| 445 |
stop the processing; \cs{PackageWarning} to generate a warning message on the |
| 446 |
terminal but continue with the processing; and \cs{PackageInfo} |
| 447 |
to provide some information that is only written to the \texttt{.log} |
| 448 |
file but not sent to the terminal. |
| 449 |
% |
| 450 |
What has not existed up to now is a way to provide |
| 451 |
information on the terminal that identifies itself as coming from |
| 452 |
a specific package but which does not claim to be a warning. |
| 453 |
(Packages that wanted to write to the terminal used \cs{PackageWarning} |
| 454 |
even though the information was not in fact a warning.) |
| 455 |
|
| 456 |
We have therefore now added \cs{PackageNote} (and the closely |
| 457 |
related \cs{PackageNoteNoLine}); these identify |
| 458 |
themselves as \enquote{informational}, but they still go to the terminal and |
| 459 |
not only to the \texttt{.log} file. |
| 460 |
% |
| 461 |
Similar commands exist for classes and so there too we have |
| 462 |
new commands: \cs{ClassNote} and \cs{ClassNoteNoLine}. |
| 463 |
% |
| 464 |
\githubissue{613} |
| 465 |
|
| 466 |
|
| 467 |
\subsection{New \cs{ShowFloat} command} |
| 468 |
|
| 469 |
The package \pkg{fltrace} offers a (fairly low-level but very |
| 470 |
detailed) way to trace \LaTeX's float mechanism. This can help in |
| 471 |
understanding why a certain float is placed into a certain |
| 472 |
region, or why it shows up unexpectedly on a later page. |
| 473 |
\LaTeX{} stores floats in registers named \cs{bx@A}, \cs{bx@B}, etc., |
| 474 |
and these names show up in the tracing information. |
| 475 |
|
| 476 |
To display the contents of a float register, you can now say |
| 477 |
\verb=\ShowFloat{=\textit{identifier}\verb=}= where |
| 478 |
\textit{identifier} is the uppercase letter (or letters) after |
| 479 |
\texttt{bx@} in the register name shown in the tracing. |
| 480 |
If additional |
| 481 |
registers have been allocated (with \cs{extrafloats}), the |
| 482 |
\textit{identifier} can also be a number. The command is generally |
| 483 |
available, whether or not you have loaded \pkg{fltrace}, because |
| 484 |
it is also useful when interpreting the tracing output of the |
| 485 |
\pkg{fewerfloatpages} package. |
| 486 |
|
| 487 |
|
| 488 |
\subsection{New argument for \cs{counterwithin}/\texttt{without}} |
| 489 |
|
| 490 |
The commands \cs{counterwithout} and \cs{counterwithin} each now has |
| 491 |
an additional optional argument, similar to that of the command |
| 492 |
\cs{numberwithin} from \pkg{amsmath}, |
| 493 |
for which these are now the preferred replacements. |
| 494 |
This optional argument |
| 495 |
specifies the format of the counter, such as \cs{roman}; |
| 496 |
the default value is \cs{arabic}. |
| 497 |
Alternatively, you can use a starred form, in which case the format of the |
| 498 |
counter is not altered at all. |
| 499 |
|
| 500 |
\subsection{Tests for package and class loading} |
| 501 |
|
| 502 |
To test whether a package has been loaded you can now use \cs{IfPackageLoadedTF} |
| 503 |
\Arg{package} \Arg{true} \Arg{false} and, based on the result, execute |
| 504 |
different code. It is also possible to check whether the package was loaded |
| 505 |
with certain options. This is done with |
| 506 |
\cs{IfPackageLoadedWithOptionsTF}. It takes four arguments: |
| 507 |
\Arg{package}\Arg{option-list}\Arg{true}\Arg{false}. |
| 508 |
% |
| 509 |
It uses the \meta{false} code if one or more options in |
| 510 |
the \meta{option-list} were |
| 511 |
not specified when loading the package, or if the package |
| 512 |
has never been loaded. |
| 513 |
% |
| 514 |
Both commands can be used anywhere in the document, i.e., |
| 515 |
they are not restricted to the preamble.% |
| 516 |
\footnote{This is now also true for the |
| 517 |
corresponding internal commands, e.g., \cs{@ifpackageloaded}, that |
| 518 |
had this restriction in the past.} |
| 519 |
|
| 520 |
For classes, similar commands, with \texttt{Package} replaced by |
| 521 |
\texttt{Class} in the name, are provided. |
| 522 |
% |
| 523 |
\githubissue{621} |
| 524 |
|
| 525 |
|
| 526 |
\subsection{Better handling for a misuse of \cs{include}} |
| 527 |
|
| 528 |
The command \cs{include} has by now been used quite often, but |
| 529 |
erroneously, to input a variety of files in the preamble of the document |
| 530 |
(before \verb|\begin{document}|). |
| 531 |
% |
| 532 |
Therefore \LaTeX\ now warns about such bad use of \cs{include}. |
| 533 |
As a recovery action it will nevertheless input the specified file |
| 534 |
if it exists (this is as before). Note, however, that this is now done |
| 535 |
without any adjustments to the \texttt{.aux} file settings and |
| 536 |
without running the \cs{include} file hooks (only the generic |
| 537 |
file hooks from \cs{InputIfFileExists} are run). |
| 538 |
% |
| 539 |
\githubissue{645} |
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
\section{Code improvements} |
| 544 |
|
| 545 |
|
| 546 |
\subsection{Use OpenType version of Latin Modern Upright Italic font} |
| 547 |
When a Latin Modern font is used with the TU encoding under \XeTeX\ or \LuaTeX\ |
| 548 |
and fontshape \texttt{ui} is requested, \LaTeX\ now uses the OpenType |
| 549 |
version of the font instead of substituting the (T1-encoded) Type 1 version. |
| 550 |
|
| 551 |
|
| 552 |
\subsection{Additional Extended Latin characters predefined} |
| 553 |
More characters, such as \'k (U+1E31), are now pre-defined and |
| 554 |
do not need a \verb|\DeclareUnicodeCharacter| declaration. |
| 555 |
% |
| 556 |
\githubissue{593} |
| 557 |
|
| 558 |
|
| 559 |
\subsection{Check \cs{endfoo} in \cs{NewDocumentEnvironment}} |
| 560 |
|
| 561 |
The \cs{newenvironment} command has always checked that neither \cs{foo} nor |
| 562 |
\cs{endfoo} exists before creating a \texttt{foo} environment. |
| 563 |
In contrast (for historical reasons) the more recently introduced |
| 564 |
command \cs{NewDocumentEnvironment} |
| 565 |
checked only for \cs{foo}. |
| 566 |
% |
| 567 |
The behavior of \cs{NewDocumentEnvironment} now aligns with that |
| 568 |
of \cs{newenvironment}, except that it gives distinct errors |
| 569 |
concerning the existence of \cs{foo} and \cs{endfoo}. |
| 570 |
|
| 571 |
|
| 572 |
\subsection{Improve the error |
| 573 |
message \texttt{\textup{\cs{begin} ended by \textellipsis}}} |
| 574 |
|
| 575 |
In the past it was possible to get an error message along the lines |
| 576 |
of ``\verb=\begin{foo} ended by \end{foo}=''. This could happen when the |
| 577 |
environment name was partly hidden inside a macro. It happened because |
| 578 |
the test was comparing the literal strings, whereas in the error message |
| 579 |
these got fully expanded. |
| 580 |
% |
| 581 |
This has now been changed to show a more sensible error |
| 582 |
message. |
| 583 |
% |
| 584 |
\githubissue{587} |
| 585 |
|
| 586 |
|
| 587 |
\subsection{Pick up all arguments to \cs{contentsline}} |
| 588 |
|
| 589 |
A \cs{contentsline} command in the \texttt{.toc} file is always followed by |
| 590 |
four arguments, the last one being empty except when using the |
| 591 |
\pkg{hyperref} package. The \cs{contentsline} command itself only used the |
| 592 |
first three arguments and it relied on the fourth being empty (and thus |
| 593 |
doing no harm). |
| 594 |
% |
| 595 |
But this assumption is not always correct: e.g., if |
| 596 |
you at first decide to load \pkg{hyperref} but then later you remove |
| 597 |
this loading from the preamble. |
| 598 |
% |
| 599 |
So now all four arguments are picked up, with the |
| 600 |
fourth being saved away so that it can be used by \pkg{hyperref}. |
| 601 |
% |
| 602 |
\githubissue{633} |
| 603 |
|
| 604 |
|
| 605 |
\subsection{Allow dropping a math list in \LuaTeX\ callback} |
| 606 |
|
| 607 |
The \LuaTeX\ callbacks \texttt{pre\_mlist\_to\_hlist\_filter} |
| 608 |
and \texttt{post\_mlist\_to\_hlist\_filter} no longer create an error when |
| 609 |
the callback handler indicates removal of the entire math list. |
| 610 |
% |
| 611 |
\githubissue{644} |
| 612 |
|
| 613 |
\subsection{Extended label handling in package code} |
| 614 |
|
| 615 |
Since 2020, as noted in \LaTeX\ News 32~\cite{34:ltnews32}, \LaTeX\ has |
| 616 |
recorded the name of the counter associated with the current label in |
| 617 |
the internal command \cs{@currentcounter}. This facility (originally |
| 618 |
from the \pkg{zref} package of Heiko Oberdiek) can be used to generate |
| 619 |
prefixes such as \enquote{Figure} before the reference text, |
| 620 |
as long as the counter is not counting different objects in a single sequence (e.g., lemmas and theorems). |
| 621 |
% |
| 622 |
In the most |
| 623 |
common cases the current label is set by \cs{refstepcounter}, which |
| 624 |
automatically stores the counter name; but some constructs (alignments |
| 625 |
and footnotes) may need to store the current label directly and so for |
| 626 |
these it is useful to update additionally \cs{@currentcounter} so as to |
| 627 |
store this counter name. |
| 628 |
|
| 629 |
In this release both the footnote command in the kernel and |
| 630 |
also some of the environments in the \pkg{amsmath} package |
| 631 |
have been updated in this way. |
| 632 |
% |
| 633 |
We encourage the maintainers of any class or |
| 634 |
package files that define \cs{@currentlabel} to also set |
| 635 |
\cs{@currentcounter} at the same point. |
| 636 |
% |
| 637 |
\githubissue{300, 687} |
| 638 |
|
| 639 |
|
| 640 |
\subsection{Better message if text accent used in math mode} |
| 641 |
|
| 642 |
Using text accents like \verb|\^| in math does not work |
| 643 |
(and \TeX{} explicitly provides math accents such as \cs{hat} |
| 644 |
for accessing such symbols in math mode). Therefore \LaTeX\ issued a |
| 645 |
warning when such a wrongly placed accent was encountered |
| 646 |
and this was often followed by a strange, and apparently |
| 647 |
unrelated, low-level error. |
| 648 |
% |
| 649 |
This has now been changed so that the message from this |
| 650 |
error is at least about accents, which we hope is less puzzling. |
| 651 |
|
| 652 |
Discussion of such warnings or errors reminds us to reinforce |
| 653 |
here a recommendation from earlier in this newsletter, as part |
| 654 |
of the item on the value of \cs{tracinglostchars}. |
| 655 |
% |
| 656 |
Using \TeX\ implementations from 2020 onwards, any warning that |
| 657 |
concerns missing characters can be |
| 658 |
converted to an error by setting \cs{tracinglostchars} to 3; we therefore |
| 659 |
now recommend changing this setting to 3, especially for |
| 660 |
Unicode engines where such missing characters are common (because |
| 661 |
no font supports the full Unicode range). |
| 662 |
% |
| 663 |
\githubissue{643} |
| 664 |
|
| 665 |
|
| 666 |
\section{Bug fixes} |
| 667 |
|
| 668 |
\subsection[Replicate argument processors for all |
| 669 |
embellishments in command declarations] |
| 670 |
{Replicate argument processors for all embellishments in command declarations} |
| 671 |
|
| 672 |
There was a bug in \pkg{ltcmd} (formerly \pkg{xparse}) that caused |
| 673 |
commands to misbehave if they were defined with embellishments and |
| 674 |
argument processors. In that case, only one (possibly void) argument |
| 675 |
processor would be added to the full set of embellishment arguments, |
| 676 |
resulting in too few processors in some cases and thus leading to unpredictable |
| 677 |
behavior. This bug has been fixed by applying the same argument |
| 678 |
processors to all the embellishments in a set, so that a declaration like: |
| 679 |
\begin{verbatim} |
| 680 |
\NewDocumentCommand\foo{>{\TrimSpaces}e{_^}} |
| 681 |
{(#1)[#2]} |
| 682 |
\foo^{ a }_{ b } |
| 683 |
\end{verbatim} |
| 684 |
will now correctly apply \cs{TrimSpaces} to both arguments. |
| 685 |
% |
| 686 |
\githubissue{639} |
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
\subsection{Correct case changing of \cs{ij} and \cs{IJ}} |
| 691 |
|
| 692 |
|
| 693 |
The ligatures \enquote{\ij} and \enquote{\IJ}, as used in Dutch, |
| 694 |
are available (for most \TeX{} fonts) only |
| 695 |
when the commands \cs{ij} or |
| 696 |
\cs{IJ} are used, or when you enter them as the Unicode characters U+0133 or |
| 697 |
U+0132. |
| 698 |
% |
| 699 |
However, when using \texttt{OT1} or \texttt{T1} encoded fonts in |
| 700 |
\pdfTeX, the upper or lower casing with \cs{MakeUppercase} and |
| 701 |
\cs{MakeLowercase} would always fail regardless of the input method. |
| 702 |
This has now been corrected. At the same time we improved the |
| 703 |
hyphenation results for words containing this ligature (when using the \texttt{OT1} encoding). |
| 704 |
% |
| 705 |
\githubissue{658} |
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
\subsection{Legacy font series default changes} |
| 710 |
|
| 711 |
In the past, changes to the font series defaults were made by directly |
| 712 |
altering \cs{bfdefault} or \cs{mddefault}. Since 2020 there is now |
| 713 |
\cs{DeclareFontSeriesDefault} that allows more granular control: |
| 714 |
with this declaration you can alter the default for individual font |
| 715 |
metafamilies by, for example, changing the bold setting only for the |
| 716 |
sans serif family, without changing it for \cs{rmfamily} or \cs{ttfamily}. |
| 717 |
See~\cite{34:ltnews31} for more details. |
| 718 |
|
| 719 |
For backwards compatibility, changing \cs{bfdefault} with |
| 720 |
\cs{renewcommand} remained possible; if used, this alters the setting |
| 721 |
for all metafamilies in one go. This alteration cannot be done when the |
| 722 |
\cs{renewcommand} happens and it was therefore delayed until the next |
| 723 |
time \cs{bfseries} or \cs{mdseries} was executed. |
| 724 |
% |
| 725 |
However, the problem with that |
| 726 |
approach was that any call to \cs{DeclareFontSeriesDefault} in |
| 727 |
the meantime was overwritten; thus, these two approaches didn't |
| 728 |
work well in combination. |
| 729 |
There was a problem because older font packages |
| 730 |
use the legacy method while newer ones use |
| 731 |
\cs{DeclareFontSeriesDefault}. |
| 732 |
|
| 733 |
This has now been resolved by changing |
| 734 |
\cs{DeclareFontSeriesDefault} to do any necessary resetting prior to |
| 735 |
setting the new defaults. |
| 736 |
% |
| 737 |
\githubissue{663} |
| 738 |
|
| 739 |
|
| 740 |
\subsection{Use of \texttt{\textup{\#}} in \cs{textbf} and similar commands} |
| 741 |
Previously you could not use the macro parameter character \texttt{\#} |
| 742 |
in inline functions |
| 743 |
within the argument of \cs{textbf} or similar text font commands. |
| 744 |
An internal definition is now guarded with \cs{unexpanded} |
| 745 |
so that the use of \texttt{\#} here no longer generates an error. |
| 746 |
% |
| 747 |
\githubissue{665} |
| 748 |
|
| 749 |
|
| 750 |
|
| 751 |
\section{Changes to packages in the \pkg{amsmath} category} |
| 752 |
\subsection{Improved compatibility with \pkg{hyperref}} |
| 753 |
|
| 754 |
This change in \pkg{amsmath} fixes a spacing problem caused by the |
| 755 |
method used in \pkg{hyperref} to change the \env{equation} environment. |
| 756 |
% |
| 757 |
For simplicity, an explicit, low-level (hence possibly temporary) |
| 758 |
patch has been added to \pkg{amsmath}: this consists |
| 759 |
of an extra, empty (hence invisible) |
| 760 |
\cs{mathopen} atom (with no mathematical meaning) at the start of the |
| 761 |
environment's mathematical content. |
| 762 |
% |
| 763 |
\githubissue{652} |
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
\section{Changes to packages in the \pkg{graphics} category} |
| 768 |
|
| 769 |
|
| 770 |
\subsection{\pkg{graphicx}:\ New key, for alt text} |
| 771 |
|
| 772 |
A new key, \texttt{alt}, has been added to \cs{includegraphics} to |
| 773 |
support the addition of descriptive text that is important for |
| 774 |
accessibility. This key is unused by default; it can be deployed by |
| 775 |
extension packages and it will provide useful support for other future |
| 776 |
possibilities. |
| 777 |
% |
| 778 |
\githubissue{651} |
| 779 |
|
| 780 |
|
| 781 |
\section{Changes to packages in the \pkg{tools} category} |
| 782 |
|
| 783 |
\subsection{\pkg{array}: No \cs{mathsurround} around a \env{tabular}} |
| 784 |
|
| 785 |
A \env{tabular} environment is typeset (internally) as an \env{array} |
| 786 |
environment with special settings, and it therefore uses (hidden) math mode. |
| 787 |
Since it is not in fact a math formula, |
| 788 |
no extra space from \cs{mathsurround} should be added |
| 789 |
(the spacing around the \env{tabular} should not get changed). |
| 790 |
% |
| 791 |
Note that this bug has been present ``forever'', which shows that \cs{mathsurround} |
| 792 |
is never used, or at least its use is never noticed. |
| 793 |
At any rate, this bug has now finally been fixed. |
| 794 |
% |
| 795 |
\githubissue{614} |
| 796 |
|
| 797 |
|
| 798 |
\subsection{\pkg{longtable}: Improvements after a section heading} |
| 799 |
The \env{longtable} environment now sets the \cs{@nobreakfalse} flag |
| 800 |
to correct the typesetting when a table immediately follows a heading. |
| 801 |
Previously the spacing and indentation changes that are required |
| 802 |
immediately after a section heading were incorrectly triggered |
| 803 |
within the next paragraph (if any) |
| 804 |
following the table. |
| 805 |
% |
| 806 |
A similar test for |
| 807 |
\cs{if@noskipsec} has been added, so that a table is correctly placed after |
| 808 |
a run-in heading rather than appearing before that heading. |
| 809 |
% |
| 810 |
\githubissue[s]{131 and 173} |
| 811 |
|
| 812 |
|
| 813 |
\subsection{\pkg{multicol}: Better column break control} |
| 814 |
|
| 815 |
From version 1.9 onwards \cs{columnbreak} accepts an optional |
| 816 |
argument (like \cs{pagebreak}) in which you can specify the |
| 817 |
desirability of breaking the column after the current line: supported values are |
| 818 |
\texttt{0} to \texttt{4}, with higher numbers indicating increased desirability. |
| 819 |
This version also adds \cs{newcolumn}, |
| 820 |
which forces a break but runs the column short (comparable to |
| 821 |
\cs{newpage} for pages). |
| 822 |
% |
| 823 |
\githubissue{682} |
| 824 |
|
| 825 |
|
| 826 |
\subsection{\pkg{varioref}: Improved handling of missing labels} |
| 827 |
|
| 828 |
If an undefined label is referenced, \pkg{varioref} makes a default |
| 829 |
definition so that later processing finds the right structure (two |
| 830 |
brace groups inside \cs{r@}\meta{label}) However, if \pkg{nameref} or |
| 831 |
\pkg{hyperref} is loaded, this data structure changes to having five |
| 832 |
arguments; this could cause low-level errors in some cases. |
| 833 |
The code has therefore now been changed to avoid these errors. |
| 834 |
% |
| 835 |
\sxissue{q/603948} |
| 836 |
|
| 837 |
|
| 838 |
\medskip |
| 839 |
|
| 840 |
\begin{thebibliography}{9} |
| 841 |
|
| 842 |
\fontsize{9.3}{11.3}\selectfont |
| 843 |
|
| 844 |
\bibitem{34:blueprint} Frank Mittelbach and Chris Rowley: |
| 845 |
\emph{\LaTeX{} Tagged PDF \Dash A blueprint for a large project}.\\ |
| 846 |
\url{https://latex-project.org/publications/indexbyyear/2020/} |
| 847 |
|
| 848 |
\bibitem{34:source2e} |
| 849 |
\emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\ |
| 850 |
\url{https://latex-project.org/help/documentation/} |
| 851 |
|
| 852 |
\bibitem{34:ltnews31} \LaTeX{} Project Team: |
| 853 |
\emph{\LaTeXe{} news 31}.\\ |
| 854 |
\url{https://latex-project.org/news/latex2e-news/ltnews31.pdf} |
| 855 |
|
| 856 |
\bibitem{34:ltnews32} \LaTeX{} Project Team: |
| 857 |
\emph{\LaTeXe{} news 32}.\\ |
| 858 |
\url{https://latex-project.org/news/latex2e-news/ltnews32.pdf} |
| 859 |
|
| 860 |
\bibitem{34:ltnews33} \LaTeX{} Project Team: |
| 861 |
\emph{\LaTeXe{} news 33}.\\ |
| 862 |
\url{https://latex-project.org/news/latex2e-news/ltnews33.pdf} |
| 863 |
|
| 864 |
\end{thebibliography} |
| 865 |
|
| 866 |
|
| 867 |
|
| 868 |
\end{document} |
| 869 |
|
| 870 |
|