| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright 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: ltnews42.tex |
| 30 |
% |
| 31 |
% This is issue 42 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} |
| 43 |
|
| 44 |
\usepackage[T1]{fontenc} |
| 45 |
|
| 46 |
\usepackage{lmodern,url,hologo} |
| 47 |
|
| 48 |
\usepackage{csquotes} |
| 49 |
\usepackage{multicol} |
| 50 |
\usepackage{color} |
| 51 |
|
| 52 |
\providecommand\hook[1]{\texttt{#1}} |
| 53 |
|
| 54 |
\providecommand\meta[1]{$\langle$\textrm{\itshape#1}$\rangle$} |
| 55 |
\providecommand\option[1]{\texttt{#1}} |
| 56 |
\providecommand\env[1]{\texttt{#1}} |
| 57 |
\providecommand\Arg[1]{\texttt\{\meta{#1}\texttt\}} |
| 58 |
|
| 59 |
|
| 60 |
\providecommand\eTeX{\hologo{eTeX}} |
| 61 |
\providecommand\XeTeX{\hologo{XeTeX}} |
| 62 |
\providecommand\LuaTeX{\hologo{LuaTeX}} |
| 63 |
\providecommand\pdfTeX{\hologo{pdfTeX}} |
| 64 |
\providecommand\MiKTeX{\hologo{MiKTeX}} |
| 65 |
\providecommand\CTAN{\textsc{ctan}} |
| 66 |
\providecommand\TL{\TeX\,Live} |
| 67 |
|
| 68 |
\providecommand\githubissue[2][]{\ifhmode\unskip\fi |
| 69 |
\quad\penalty500\strut\nobreak\hfill |
| 70 |
\mbox{\small\slshape(% |
| 71 |
\href{https://github.com/latex3/latex2e/issues/\getfirstgithubissue#2 \relax}% |
| 72 |
{github issue#1 #2}% |
| 73 |
)}% |
| 74 |
\par\smallskip} |
| 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 |
% issues from the tagging-project: |
| 80 |
|
| 81 |
\providecommand\taggingissue[2][]{\ifhmode\unskip\fi |
| 82 |
\quad\penalty500\strut\nobreak\hfill |
| 83 |
\mbox{\small\slshape(% |
| 84 |
\href{https://github.com/latex3/tagging-project/issues/\getfirstgithubissue#2 \relax}% |
| 85 |
{tagging-project issue#1 #2}% |
| 86 |
)}% |
| 87 |
\par\smallskip} |
| 88 |
|
| 89 |
\providecommand\sxissue[1]{\ifhmode\unskip |
| 90 |
\else |
| 91 |
% githubissue preceding |
| 92 |
\vskip-\smallskipamount |
| 93 |
\vskip-\parskip |
| 94 |
\fi |
| 95 |
\quad\penalty500\strut\nobreak\hfill |
| 96 |
\mbox{\small\slshape(\url{https://tex.stackexchange.com/#1})}\par} |
| 97 |
|
| 98 |
\providecommand\gnatsissue[2]{\ifhmode\unskip\fi |
| 99 |
\quad\penalty500\strut\nobreak\hfill |
| 100 |
\mbox{\small\slshape(% |
| 101 |
\href{https://www.latex-project.org/cgi-bin/ltxbugs2html?pr=#1\%2F\getfirstgithubissue#2 \relax}% |
| 102 |
{gnats issue #1/#2}% |
| 103 |
)}% |
| 104 |
\par} |
| 105 |
|
| 106 |
\let\cls\pkg |
| 107 |
\providecommand\env[1]{\texttt{#1}} |
| 108 |
\providecommand\acro[1]{\textsc{#1}} |
| 109 |
|
| 110 |
\vbadness=1400 % accept slightly empty columns |
| 111 |
|
| 112 |
|
| 113 |
\let\finalpagebreak\pagebreak % for TUB (if they use it) |
| 114 |
\let\finalvspace\vspace % for document layout fixes |
| 115 |
|
| 116 |
\makeatletter |
| 117 |
% maybe not the greatest design but normally we wouldn't have subsubsections |
| 118 |
\renewcommand{\subsubsection}{% |
| 119 |
\@startsection {subsubsection}{2}{0pt}{1.5ex \@plus 1ex \@minus .2ex}% |
| 120 |
{-1em}{\@subheadingfont\colonize}% |
| 121 |
} |
| 122 |
\providecommand\colonize[1]{#1:} |
| 123 |
\makeatother |
| 124 |
|
| 125 |
|
| 126 |
% Undo ltnews's \verbatim@font with active < and > |
| 127 |
\makeatletter |
| 128 |
\def\verbatim@font{\normalsize\ttfamily} |
| 129 |
\makeatother |
| 130 |
|
| 131 |
|
| 132 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 133 |
\providecommand\tubcommand[1]{} |
| 134 |
\tubcommand{\input{tubltmac}} |
| 135 |
|
| 136 |
\publicationmonth{November} |
| 137 |
\publicationyear{2025} |
| 138 |
\publicationyear{2025} |
| 139 |
|
| 140 |
\publicationissue{42} |
| 141 |
|
| 142 |
\begin{document} |
| 143 |
|
| 144 |
\maketitle |
| 145 |
{\hyphenpenalty=10000 \exhyphenpenalty=10000 \spaceskip=3.33pt \hbadness=10000 |
| 146 |
\tableofcontents} |
| 147 |
|
| 148 |
\pagebreak |
| 149 |
|
| 150 |
\setlength\rightskip{0pt plus 3em} |
| 151 |
|
| 152 |
\section{Introduction} |
| 153 |
|
| 154 |
Fans of Douglas Adams will know that this must be a special issue of the |
| 155 |
\LaTeX{} news; unfortunately it doesn't give us the |
| 156 |
\enquote{Answer to the Ultimate Question of Life, the Universe, and |
| 157 |
Everything} yet \Dash we still need to address a few more issues to reach that |
| 158 |
point. |
| 159 |
|
| 160 |
%\looseness=-1 |
| 161 |
% |
| 162 |
However, with this release we have made further progress in |
| 163 |
generating tagged and accessible PDF documents from \LaTeX{}. To |
| 164 |
indicate this, we move away from calling it a prototype solution as by |
| 165 |
now it can be used in production workflows\Dash and indeed already has |
| 166 |
been\Dash as long as one |
| 167 |
restricts the documents to already-supported packages. This does not |
| 168 |
mean that \pkg{latex-lab} code (where the tagging support currently |
| 169 |
resides) is no longer under development, but that the user-facing side |
| 170 |
of the project is by now fairly\\ stable and~usable. |
| 171 |
|
| 172 |
Outside of the tagging project we have added new functionality to the |
| 173 |
font selection support as well as code improvements and additional |
| 174 |
functionality in a number of other places, for example, supporting |
| 175 |
value expansion of key values at the time of declaration, which is |
| 176 |
useful when specifying template instances and in similar places. |
| 177 |
|
| 178 |
As usual, there have been a few bugs to take care of (odd ones for |
| 179 |
sure this time) and we also decided to finally retire a few packages |
| 180 |
from the tools collection. More precisely, we suggest that they should no |
| 181 |
longer be used |
| 182 |
in new documents |
| 183 |
as there are better possibilities available by now. |
| 184 |
|
| 185 |
|
| 186 |
\section{News from the Tagged PDF project} |
| 187 |
|
| 188 |
\subsection{Expanding the \cs{DocumentMetadata} command} |
| 189 |
|
| 190 |
In 2022 we introduced \cs{DocumentMetadata} with a twofold |
| 191 |
purpose: to provide a dedicated place for document-wide settings and |
| 192 |
metadata, and to act as a trigger command to identify documents that |
| 193 |
want to load new code. The latter allows the use of the new, extended |
| 194 |
interfaces essential for the tagging project, but also useful |
| 195 |
without tagging. |
| 196 |
|
| 197 |
Initially, using \cs{DocumentMetadata} with an empty argument loaded |
| 198 |
only the PDF management code and a new \pkg{hyperref} driver was used. |
| 199 |
Since November 2024 \cs{DocumentMetadata} changes the default encoding |
| 200 |
from OT1 to T1; and since June 2025 it also changes the default PDF |
| 201 |
version from 1.7 to 2.0. |
| 202 |
|
| 203 |
Additional code from \pkg{latex-lab} (needed, e.g., for the tagging project) |
| 204 |
had to be loaded explicitly by using the \texttt{testphase} or the new |
| 205 |
\texttt{tagging} key in the argument of \cs{DocumentMetadata}. Whilst |
| 206 |
this allowed for the selective loading and testing of the new code, it |
| 207 |
also produced problems for classes and packages adapting their code |
| 208 |
for the tagging project since it was difficult to test which parts of |
| 209 |
the \pkg{latex-lab} code were active. |
| 210 |
|
| 211 |
In this release we therefore extend \cs{DocumentMetadata} even |
| 212 |
further: it will now load directly all the code that one would get when |
| 213 |
using the \texttt{tagging=off} or the \texttt{testphase=latest} key. |
| 214 |
|
| 215 |
The values \texttt{phase-I}, \texttt{phase-II}, \texttt{phase-III} of |
| 216 |
the \texttt{testphase} key will no longer load different code variants |
| 217 |
but only activate tagging. Extra modules not yet incorporated in the |
| 218 |
\texttt{latest} set of modules can still be loaded by using the |
| 219 |
\texttt{testphase} key. |
| 220 |
|
| 221 |
For documents that want to load the PDF management but do not want the |
| 222 |
new tagging support code we provide a dedicated package. Such |
| 223 |
documents should replace |
| 224 |
\begin{verbatim} |
| 225 |
\DocumentMetadata{pdfversion=1.7, |
| 226 |
pdfstandard=a-3b} |
| 227 |
\end{verbatim} |
| 228 |
by |
| 229 |
\begin{verbatim} |
| 230 |
\RequirePackage{pdfmanagement} |
| 231 |
\SetKeys[document/metadata] |
| 232 |
{pdfversion=1.7,pdfstandard=a-3b} |
| 233 |
\end{verbatim} |
| 234 |
|
| 235 |
\subsection{Checking the compatibility with the tagging support code} |
| 236 |
|
| 237 |
We maintain a database showing the compatibility of classes and |
| 238 |
packages with the tagging support code. This data can be viewed |
| 239 |
online~\cite{tagging-status}. We have now exported a part of the data |
| 240 |
into a small package \pkg{latex-tagging-status} and added a key |
| 241 |
\texttt{check-tagging-status} to \cs{DocumentMetadata}. When used, the |
| 242 |
status of the packages and the class used by the document will be |
| 243 |
shown at the end of the log file. |
| 244 |
|
| 245 |
\looseness=-1 |
| 246 |
% |
| 247 |
This status is only a rough overview and a debugging aid, not a final report! |
| 248 |
Using packages that are classified as incompatible or partially |
| 249 |
incompatible does not mean that the tagging is necessarily broken. For |
| 250 |
example, \pkg{hyperref} is partially incompatible as form fields |
| 251 |
are not properly tagged (this requires the use of the \pkg{l3pdffield} |
| 252 |
package), but in documents without form fields it is unproblematic. |
| 253 |
In case of partially-compatible or incompatible packages the full |
| 254 |
table should be checked as it often contains an explanation of what is |
| 255 |
not yet working. |
| 256 |
|
| 257 |
The package \pkg{latex-tagging-status} will be regularly updated to |
| 258 |
reflect changes in packages and the status database. Erroneous |
| 259 |
messages should be reported at the tagging project |
| 260 |
github repository~\cite{tagging-project}. It is also possible to create a pull |
| 261 |
request to update or correct the data. |
| 262 |
|
| 263 |
|
| 264 |
\subsection{Requiring or testing for the tagging support code} |
| 265 |
|
| 266 |
Classes or packages that are written only for the new code loaded by |
| 267 |
\cs{DocumentMetadata} can use the new command |
| 268 |
\cs{NeedsDocumentMetadata} at the start of the class or package |
| 269 |
file. It will produce a suitable error message if the tagging support |
| 270 |
code has not been loaded. |
| 271 |
|
| 272 |
Classes and packages that want to support both legacy documents and |
| 273 |
newer documents using \cs{DocumentMetadata} can now use |
| 274 |
\cs{IfDocumentMetadataTF} to test whether the new code has been loaded |
| 275 |
\Dash eventually in combination with a test of the date of the format. To |
| 276 |
test whether the PDF management has been loaded, the test |
| 277 |
\cs{IfPDFManagementActiveTF} is provided. |
| 278 |
|
| 279 |
|
| 280 |
\subsection{Moving paragraph tagging into sockets} |
| 281 |
|
| 282 |
Paragraphs in \LaTeX{} can be nested, e.g., you can have a paragraph |
| 283 |
containing a display quote, which in turn consists of more than one |
| 284 |
(sub)paragraph, followed by some more text which all belongs to the |
| 285 |
same outer paragraph. |
| 286 |
|
| 287 |
To model such \enquote{semantic paragraphs} \LaTeX{} uses a structure |
| 288 |
named \texttt{text-unit}\footnote{The name is under review and is |
| 289 |
likely to change in the future.} and uses \texttt{text} (role mapped to |
| 290 |
\texttt{P}) only for (portions of) the paragraph text. |
| 291 |
|
| 292 |
This is semantically clear and allows processors who care to identify |
| 293 |
the complete paragraphs by looking for \texttt{text-unit} tags. But |
| 294 |
we received a request for an option to disable the tagging of the |
| 295 |
\enquote{semantic paragraphs}, so with this release we moved the |
| 296 |
relevant tagging code into sockets. The \enquote{semantic paragraphs} |
| 297 |
can now be disabled by assigning the \texttt{noop} plug to these |
| 298 |
sockets: |
| 299 |
\begin{verbatim} |
| 300 |
\AssignTaggingSocketPlug{para/semantic/begin} |
| 301 |
{noop} |
| 302 |
\AssignTaggingSocketPlug{para/semantic/end} |
| 303 |
{noop} |
| 304 |
\end{verbatim} |
| 305 |
|
| 306 |
\subsection{Hooks for \cs{includegraphics} keys} |
| 307 |
|
| 308 |
The three key definitions \texttt{alt}, \texttt{actualtext} and |
| 309 |
\texttt{artifact} used by \cs{includegraphics} now contain hooks, |
| 310 |
named \texttt{Gin/alt}, \texttt{Gin/actualtext}, and |
| 311 |
\texttt{Gin/artifact}.\footnote{\texttt{Gin} refers to the family name |
| 312 |
used by keys in the \pkg{graphicx} package.} The first two are hooks |
| 313 |
with two arguments and get as first argument the purified (with |
| 314 |
\verb+\text_purify:n+) value of the key which is also used in |
| 315 |
the PDF, and as second argument the raw value. The hooks are processed |
| 316 |
even if tagging is not activated. With them it is possible, for example, |
| 317 |
to store the alternative text: |
| 318 |
\begin{verbatim} |
| 319 |
\AddToHookWithArguments{Gin/alt} |
| 320 |
{\gdef\myalttext{#2}} |
| 321 |
\includegraphics[alt=Hello World] |
| 322 |
{example-image} |
| 323 |
The alt text of the graphic was \myalttext. |
| 324 |
\end{verbatim} |
| 325 |
|
| 326 |
|
| 327 |
\subsection{Symbolic structure names} |
| 328 |
|
| 329 |
The names of structure elements tags may be taken from the standard |
| 330 |
PDF namespaces like \verb|Sect|, \verb|H1| or \verb|Figure| but they |
| 331 |
can also use alternative names, provided the latter are role-mapped to |
| 332 |
a standard name. The second approach is useful for three reasons: |
| 333 |
\begin{itemize} |
| 334 |
\item It looks nicer, if, e.g., a bible uses tag names such as |
| 335 |
\texttt{Testament}, \texttt{Book} or \texttt{Chapter} instead of |
| 336 |
\texttt{Sect}. |
| 337 |
\item It is possible to formulate additional constraints on such |
| 338 |
structures in a schema and thus ensure that there is no |
| 339 |
\texttt{Testament} inside a \texttt{Book}, something that cannot |
| 340 |
be done if \texttt{Sect} is used everywhere. |
| 341 |
\item We can provide a uniform \LaTeX{} set of names for tags. |
| 342 |
\end{itemize} |
| 343 |
|
| 344 |
Currently it is difficult for document authors to change tag names, |
| 345 |
as the tagging support code uses either a fixed name or some ad hoc |
| 346 |
internal variable. We therefore added three commands that offer an |
| 347 |
interface to declare, use and reassign \emph{symbolic structure |
| 348 |
names}. \verb+\NewStructureName+ takes one argument and declares a |
| 349 |
\emph{symbolic structure name}. The expandable command |
| 350 |
\verb+\UseStructureName+ takes one argument and allows using the name |
| 351 |
in a \cs{tagstructbegin} command. \verb+\AssignStructureRole+ allows |
| 352 |
assigning a role to the symbolic structure name. |
| 353 |
|
| 354 |
In the coming months the various tag names in the tagging code will |
| 355 |
be replaced by such symbolic names. Once the process is finished, |
| 356 |
document and class authors will have a flexible tool to set up the |
| 357 |
tag names of their~documents. |
| 358 |
|
| 359 |
|
| 360 |
\subsection{Normalizing key names for block environments} |
| 361 |
|
| 362 |
The display block environments, such as \texttt{itemize}, |
| 363 |
\texttt{center}, \texttt{verbatim}, etc.,\ were all reimplemented |
| 364 |
a while back to become tagging-aware. That was also the first time we |
| 365 |
used the template/instance mechanism to offer consistent layout |
| 366 |
configuration possibilities (heading commands will be next to use that |
| 367 |
approach). Doing this meant experimenting with different setups to see |
| 368 |
what works best. However, as a side effect of these trials and |
| 369 |
rewrites we ended up with a rather inconsistent set of key names |
| 370 |
%FMi prefer my version really :-) |
| 371 |
across the different templates, so after the dust had settled it was |
| 372 |
%FMi across the different templates, so since the dust has settled it was |
| 373 |
about time to take a look at the complete set and standardize the key |
| 374 |
names as much as possible. This task has been largely |
| 375 |
completed, though some changes are still likely while we |
| 376 |
develop more templates covering other areas. |
| 377 |
|
| 378 |
These changes are basically transparent for users who are just |
| 379 |
interested in producing tagged and accessible documents out of the |
| 380 |
box. However, for people who have started to customize the layout of the |
| 381 |
environments, using for example \cs{EditInstance}, the key |
| 382 |
name changes need to be reflected accordingly. |
| 383 |
|
| 384 |
|
| 385 |
\subsection{Contexts in typesetting} |
| 386 |
|
| 387 |
Sometimes document elements should change their layout depending on |
| 388 |
where they are used; for example, lists might use less vertical space |
| 389 |
when used inside a footnote or a float. To allow for such designs in a |
| 390 |
consistent and easy way we introduce the concept of \enquote{named |
| 391 |
contexts}: while typesetting the document \LaTeX{} keeps track of a |
| 392 |
current \enquote{primary context} and a current \enquote{secondary |
| 393 |
context}. They are changed automatically when certain commands, such |
| 394 |
as \cs{footnote}, or environments, such as floats, etc., are typeset. |
| 395 |
|
| 396 |
For the primary context, \LaTeX{} distinguishes by default between |
| 397 |
typesetting material in the main galley (context name is |
| 398 |
\meta{empty}), or in a \texttt{footnote}, \texttt{marginal}, |
| 399 |
\texttt{float}, \texttt{caption}, \texttt{header}, or \texttt{footer}. |
| 400 |
|
| 401 |
The \enquote{secondary context} is by default used to identify |
| 402 |
typesetting in different font sizes and therefore knows about |
| 403 |
\texttt{tiny}, \texttt{scriptsize}, \texttt{footnotesize}, |
| 404 |
\texttt{small}, \texttt{large}, \texttt{Large}, \texttt{LARGE}, |
| 405 |
\texttt{huge}, \texttt{Huge}, and \meta{empty} (denoting typesetting |
| 406 |
in \cs{normalsize}). |
| 407 |
|
| 408 |
In theory it would be possible for commands and environments to query |
| 409 |
the current context and then alter their behavior; however, that would |
| 410 |
require comparatively complex coding. Instead, the main usage for the |
| 411 |
context is with template instances that are used to define layouts. |
| 412 |
If a template instance is used via |
| 413 |
\cs{UseInstance}\Arg{type}\Arg{inst-name} then this normally results |
| 414 |
in calling up an instance of type \meta{type} with the name |
| 415 |
\meta{inst-name}.\footnote{Such instances are defined with a |
| 416 |
\cs{DeclareInstance} or \cs{DeclareInstanceCopy} declaration; see the |
| 417 |
documentation in the file \texttt{lttemplates-doc.pdf}.} |
| 418 |
|
| 419 |
However, when the \enquote{primary context} and/or the |
| 420 |
\enquote{secondary context} is non-empty then \cs{UseInstance} |
| 421 |
searches for an instance that is especially tailored to the current |
| 422 |
context. This works as follows: |
| 423 |
\begin{itemize} |
| 424 |
\item The string\texttt{:}\meta{primary |
| 425 |
context}\texttt{:}\meta{secondary context} is appended to |
| 426 |
\meta{inst-name} and if that instance exists it is |
| 427 |
used.\footnote{Note that this means that if the \meta{primary |
| 428 |
context} is empty we effectively append \texttt{::}\meta{secondary |
| 429 |
context}.} |
| 430 |
\item |
| 431 |
If not, then \meta{inst-name}\texttt{:}\meta{primary context} is |
| 432 |
tried. |
| 433 |
%FMi next. % removed to fix pagination issue |
| 434 |
\item |
| 435 |
If that doesn't exist either, then \meta{inst-name} is used as usual. |
| 436 |
\end{itemize} |
| 437 |
% |
| 438 |
This means it becomes trivial to alter the behavior of instances if |
| 439 |
they appear in a special typesetting context. For example, if |
| 440 |
\texttt{itemize-1} is the instance name for first-level itemize lists |
| 441 |
then one can define another instance named \texttt{itemize-1:footnote} |
| 442 |
to describe a special layout used in footnotes. More details on this |
| 443 |
can be found in \texttt{latex-lab-context.pdf} or by using |
| 444 |
\verb*=texdoc latex-lab-context= on the command line. |
| 445 |
|
| 446 |
At this point in time the mechanism is still rather experimental; |
| 447 |
i.e., we provide and use it in \pkg{latex-lab} to gain experience |
| 448 |
and we also encourage developers to experiment with it and provide |
| 449 |
feedback. Details of the implementation are likely to change though. |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
\subsection{MathML intent attributes} |
| 455 |
|
| 456 |
Two new commands, \cs{MathMLintent} and \cs{MathMLarg} are added. They |
| 457 |
are defined in the format as no-ops so they may be added to command |
| 458 |
definitions in packages. If \pkg{luamml} is enabled to generate |
| 459 |
MathML, these commands allow \emph{intent} and \emph{arg} attributes |
| 460 |
to be specified. |
| 461 |
% |
| 462 |
A definition such as |
| 463 |
\begin{verbatim} |
| 464 |
\newcommand\abs[1]{% |
| 465 |
\MathMLintent |
| 466 |
{absolute-value($x)}% |
| 467 |
{{\lvert\MathMLarg{x}{#1}\rvert}}% |
| 468 |
} |
| 469 |
\end{verbatim} |
| 470 |
would cause \verb|\abs{y}| to generate |
| 471 |
\begin{verbatim} |
| 472 |
<mrow intent="absolute-value($x)"> |
| 473 |
<mo>|</mo><mi arg="x">y</mi><mo>|</mo> |
| 474 |
</mrow> |
| 475 |
\end{verbatim} |
| 476 |
which will allow Assistive Technology (AT) to correctly read the |
| 477 |
ambiguous notation $|y|$ as \enquote{the absolute value of y} or some |
| 478 |
similar reading depending on the chosen language. |
| 479 |
|
| 480 |
|
| 481 |
\subsection{Correctly handle tagging of math in tabular cells} |
| 482 |
|
| 483 |
Mathematical content in tabular cells was not correctly tagged when a |
| 484 |
MathML representation was automatically generated by \LuaTeX{}. Also |
| 485 |
tabular preambles of the form \verb=>{$}c<{$}= or \verb=>{\(}c<{\)}= |
| 486 |
failed. This has been corrected. |
| 487 |
% |
| 488 |
\taggingissue[s]{973 983} |
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
\section{New or improved commands} |
| 493 |
|
| 494 |
\subsection{Support separate font families for script fonts} |
| 495 |
|
| 496 |
In \TeX's math processing separate fonts can be selected for text, |
| 497 |
script and scriptscript sizes. \LaTeX's NFSS traditionally uses the |
| 498 |
same font family at different sizes, handling adjustments needed for |
| 499 |
making fonts appear better in a script location through the use of |
| 500 |
optical sizes. This works great for traditional \TeX{} fonts, but for |
| 501 |
OpenType fonts it leads to issues. OpenType math assumes the font in |
| 502 |
a script location has a separate feature set and therefore receives |
| 503 |
specific adjustments. |
| 504 |
|
| 505 |
To support this without relying on heuristics based on the font size, |
| 506 |
a new command \verb+\DeclareMathScriptfontMapping+ has been added. It |
| 507 |
takes three pairs of encoding/family arguments to indicate that |
| 508 |
when the first pair is used as the math main font, the second and the third |
| 509 |
should be used as the script and scriptscript font, respectively. |
| 510 |
% |
| 511 |
\githubissue{1707} |
| 512 |
|
| 513 |
|
| 514 |
\subsection[Programming support for font metafamilies] |
| 515 |
{Programming support for \LaTeX's font metafamilies} |
| 516 |
|
| 517 |
\LaTeX{} knows three main document font families: \cs{rmfamily} for |
| 518 |
the document's serifed font family, \cs{sffamily} for its sans serif |
| 519 |
font family, and \cs{ttfamily} for its monospaced font family. In |
| 520 |
addition, other font families can be used by the user or in a document |
| 521 |
class or package by explicitly loading them through |
| 522 |
\cs{fontfamily}\texttt\{\meta{name}\texttt\}\cs{selectfont}. |
| 523 |
|
| 524 |
In some cases it is helpful to know which of the three metafamilies |
| 525 |
(if any) is currently used for typesetting, and this information is |
| 526 |
now made available for programmers in \cs{@currentmetafamily}. It |
| 527 |
returns either \texttt{rm}, \texttt{sf}, \texttt{tt}, or \texttt{??} |
| 528 |
(in case none of the metafamilies is currently used). |
| 529 |
|
| 530 |
As a small application of this, the \LaTeX{} kernel now also contains |
| 531 |
\cs{@restoremetafamily}. If the current metafamily is \meta{name} it |
| 532 |
executes \cs{\meta{name}family}, e.g., \cs{sffamily}, and that then |
| 533 |
executes the hook \texttt{\meta{name}family} besides other |
| 534 |
re-initializations. This can be useful if that hook contains |
| 535 |
conditional code and the condition has changed, therefore requiring |
| 536 |
re-initialization. |
| 537 |
|
| 538 |
\subsection{Recovering the argument specifier for document commands} |
| 539 |
|
| 540 |
In \LaTeX{} News 38~\cite{42:ltnews38} we explained that we had |
| 541 |
\emph{removed} \cs{GetDocumentCommandArgSpec} since we felt that it |
| 542 |
was only required for debugging. However, there are some special |
| 543 |
use cases where access to the argument specification is useful: see, |
| 544 |
for example, \url{https://github.com/latex3/latex3/pull/1799}. We have |
| 545 |
therefore looked again at this area and added a \emph{code} interface |
| 546 |
\cs{\detokenize{cmd_arg_spec:N}} for accessing the argument |
| 547 |
specification. The use of a code-level rather than design-level name |
| 548 |
here reflects the fact that this is a very specialized use case, |
| 549 |
mainly of interest to package~authors. |
| 550 |
|
| 551 |
\section{Code improvements} |
| 552 |
|
| 553 |
\subsection{Ensure that commands without arguments are not \cs{long}} |
| 554 |
|
| 555 |
In its original implementation \cs{newcommand} or \cs{renewcommand} |
| 556 |
always defined commands using \cs{long}\cs{def} even if the commands |
| 557 |
had no arguments, i.e., in situations where the concept of \cs{long} |
| 558 |
made no sense whatsoever. |
| 559 |
|
| 560 |
The issue with that behavior is that commands differing only in their |
| 561 |
\cs{long} status are nevertheless considered different when compared |
| 562 |
with \cs{ifx}, even if there are no arguments to which the \cs{long} |
| 563 |
would apply. Thus, after \verb=\renewcommand\rmdefault{lmr}= and |
| 564 |
\verb=\def\test{lmr}= the test \verb=\ifx\test\rmdefault= would be |
| 565 |
\emph{false}, but it would be \emph{true} if \cs{rmdefault} had been |
| 566 |
defined using \cs{def} (as many class files do). This made comparing |
| 567 |
commands without arguments rather difficult. |
| 568 |
% |
| 569 |
We have therefore changed \cs{newcommand} and friends so that commands |
| 570 |
without arguments are always defined without using the unnecessary |
| 571 |
\cs{long} prefix. |
| 572 |
|
| 573 |
Going forward, this will simplify package and kernel code as the code |
| 574 |
can reliably assume that such macros are not \cs{long} regardless of |
| 575 |
whether they are defined by \cs{renewcommand} or \cs{def}. |
| 576 |
|
| 577 |
There is a small chance that this is a breaking change for some |
| 578 |
package code (though we don't know of any case). For instance, if the code was |
| 579 |
deliberately checking against \cs{long}\cs{def} only\Dash in that case, |
| 580 |
the test now needs to be made against the definition without \cs{long} |
| 581 |
(or against both, which is what the NFSS implementation of the kernel |
| 582 |
did in the past). |
| 583 |
% |
| 584 |
\githubissue{571} |
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
\subsection{Avoid strange warnings about font substitutions} |
| 589 |
|
| 590 |
A font series value such as \texttt{sbc} contains both the weight |
| 591 |
(\texttt{sb}, i.e.\ ``semibold'') and the width (\texttt{c}, |
| 592 |
i.e.\ ``condensed'') of the font. If you want to reset only one of the |
| 593 |
two to ``medium'' and keep the other, you can use |
| 594 |
\verb+\fontseries{m?}+ or \verb+\fontseries{?m}+: The former switches |
| 595 |
\texttt{sbc} to \texttt{c}, the latter switches \texttt{sbc} to |
| 596 |
\texttt{sb}. However, if the resulting series does not exist, you got |
| 597 |
strange warnings in the past, e.g.: |
| 598 |
\begin{verbatim} |
| 599 |
LaTeX Font Warning: |
| 600 |
Font shape `OT1/cmss/c/n' undefined |
| 601 |
using `OT1/cmss/m?/n' instead on input line 7. |
| 602 |
LaTeX Font Warning: |
| 603 |
Font shape `OT1/cmss/m?/n' undefined |
| 604 |
using `OT1/cmss/m/n' instead on input line 7. |
| 605 |
\end{verbatim} |
| 606 |
This has now been corrected so that you get a single, more meaningful |
| 607 |
warning: |
| 608 |
\begin{verbatim} |
| 609 |
LaTeX Font Warning: |
| 610 |
Font shape `OT1/cmss/c/n' undefined |
| 611 |
using `OT1/cmss/m/n' instead on input line 7. |
| 612 |
\end{verbatim} |
| 613 |
If the \texttt{m} series does not exist either, you will still get |
| 614 |
strange warnings, but this should affect very few fonts. The |
| 615 |
source file was also tidied up a little on this occasion. |
| 616 |
% |
| 617 |
\githubissue{1727} |
| 618 |
|
| 619 |
|
| 620 |
\subsection{Improved handling of infinite shrinkage errors} |
| 621 |
|
| 622 |
In the June 2024 release~\cite{42:ltnews39} we described the improved |
| 623 |
mark mechanism and the problems we had when working around \TeX's |
| 624 |
\enquote{infinite shrinkage error}. By now, the engines have added a new |
| 625 |
primitive \cs{ignoreprimitiveerror} which can be used to turn this |
| 626 |
error into a warning, when, for example, you do only a trial splitting |
| 627 |
of a box. This noticeably improves the output in the \texttt{.log} |
| 628 |
file from |
| 629 |
\makeatletter |
| 630 |
\begingroup |
| 631 |
\def\verbatim@font{\small\ttfamily} |
| 632 |
\makeatletter |
| 633 |
\begin{verbatim} |
| 634 |
! Infinite glue shrinkage found in box being split. |
| 635 |
<argument> Infinite shrink error above ignored ! |
| 636 |
l. ... } |
| 637 |
The box you are \vsplitting contains some |
| 638 |
infinitely shrinkable glue, e.g., `\vss' or |
| 639 |
`\vskip 0pt minus 1fil'. Such glue doesn't belong |
| 640 |
there; but you can safely proceed, since the |
| 641 |
offensive shrinkability has been made finite. |
| 642 |
\end{verbatim} |
| 643 |
to a simple |
| 644 |
\begin{verbatim} |
| 645 |
ignored error: Infinite glue shrinkage found in |
| 646 |
box being split |
| 647 |
\end{verbatim} |
| 648 |
|
| 649 |
Perhaps even more important, the return code from the \TeX{} run stays |
| 650 |
at 0 (unless there are real errors); so in workflows that want to test |
| 651 |
whether a \TeX{} run ended without errors, you don't get a bogus |
| 652 |
result because there is no longer an ignored error. |
| 653 |
% |
| 654 |
\githubissue{1750} |
| 655 |
|
| 656 |
\endgroup |
| 657 |
|
| 658 |
\subsection{Allow multiple family names in \cs{ProcessKeyOptions}} |
| 659 |
|
| 660 |
The ability to process key--value options was introduced into the |
| 661 |
kernel in the June 2022 release~\cite{42:ltnews35}, with the command |
| 662 |
\cs{ProcessKeyOptions} carrying out the option assignment. In the |
| 663 |
original version, this takes an optional argument which can select one |
| 664 |
key family (namespace) for options. We have now extended this to take |
| 665 |
a comma-separated list of possible families. |
| 666 |
% |
| 667 |
\githubissue{1756} |
| 668 |
|
| 669 |
\subsection{Control of value expansion in keys} |
| 670 |
|
| 671 |
Normally, key--value input is treated ``as is'', with no expansion of |
| 672 |
either key names or values. However, there are occasions when |
| 673 |
expansion of selected values is useful. We have now extended the key |
| 674 |
handling for templates (\cs{DeclareInstance}, etc.)\ and for keys |
| 675 |
created using the L3 programming layer to allow selective |
| 676 |
expansion. In both cases, the syntax uses a trailing colon and a |
| 677 |
single letter specifier: these letters are those used in |
| 678 |
\cs{ExpandArgs} or the L3 programming layer. For example, to use the |
| 679 |
values of the \LaTeXe{} variable \cs{@itemdepth}, one could have |
| 680 |
settings |
| 681 |
\begin{verbatim} |
| 682 |
key-a:c = @itemdepth , |
| 683 |
key-b:v = @itemdepth |
| 684 |
\end{verbatim} |
| 685 |
This facility will \emph{automatically} be available in any package |
| 686 |
setup macro using the L3 programming layer, for example \pkg{siunitx}. |
| 687 |
% |
| 688 |
\githubissue{1801} |
| 689 |
|
| 690 |
\subsection{Support word exclusion in case changing} |
| 691 |
|
| 692 |
Work on improving automatic case changing over previous releases has |
| 693 |
continued. We have now added the ability to `register' words for |
| 694 |
exclusion from case changing, using \cs{DeclareLowercaseExclusions}, |
| 695 |
\cs{DeclareTitlecaseExclusions} and \cs{DeclareUppercaseExclusions}. |
| 696 |
|
| 697 |
|
| 698 |
\subsection{Automatic insertion of \cs{par} tokens} |
| 699 |
|
| 700 |
Since 2022 the major \TeX\ engines have provided a parameter, |
| 701 |
\cs{partokencontext}, that controls whether a \cs{par} token is added |
| 702 |
when \TeX\ is in horizontal mode at the end of \cs{vbox} and in |
| 703 |
similar contexts. This gives more control than the classical behavior |
| 704 |
where the internal \textit{end paragraph} routine is invoked with no |
| 705 |
explicit token being added. |
| 706 |
|
| 707 |
This allows the paragraph hooks to detect the end of paragraph even in |
| 708 |
contexts such as at the end of a \cs{vbox}, where traditionally |
| 709 |
package code has had to be modified to add an explicit \cs{par}. This |
| 710 |
is expected to improve compatibility of existing packages with the |
| 711 |
tagging code. |
| 712 |
|
| 713 |
\LaTeX\ now sets this parameter to 2 by default, to enable automatic |
| 714 |
insertion of \cs{par} in these contexts. |
| 715 |
% |
| 716 |
\githubissue{1864} |
| 717 |
|
| 718 |
|
| 719 |
\subsection{Improved access to generic hooks} |
| 720 |
|
| 721 |
The code to add generic hooks such as |
| 722 |
\verb|\AddToHook{cmd/somecmd/before}{...}| |
| 723 |
has been improved so that it is more likely to succeed |
| 724 |
in cases where the command has been defined using \emph{expl3} syntax. |
| 725 |
Previously, attempts to add hooks to commands would fail if the original |
| 726 |
definition |
| 727 |
used \verb|~| in an \verb|\ExplSyntaxOn| context. |
| 728 |
% |
| 729 |
\githubissue{1099} |
| 730 |
|
| 731 |
|
| 732 |
\section{Bug fixes} |
| 733 |
|
| 734 |
\subsection[Support active characters correctly with \cs{DeclareRobustCommand}] |
| 735 |
{Support active characters correctly with\\ \cs{DeclareRobustCommand}} |
| 736 |
|
| 737 |
The mechanism used by \cs{DeclareRobustCommand} creates an internal |
| 738 |
command which has a space added to the name of the document one: so |
| 739 |
\verb*|\foo | for a command \verb|\foo|. That fails if applied to an |
| 740 |
active character: unlike normal commands, these have to be exactly one |
| 741 |
character long. Due to the way the implementation works, to date this |
| 742 |
would result in redefining \verb*|\ | every time |
| 743 |
\cs{DeclareRobustCommand} was used with an active character. This has |
| 744 |
now been corrected: robust active characters are now created using the |
| 745 |
engines' \cs{protected} mechanism and do not use an internal |
| 746 |
auxiliary. They still work in file names and labels to give the |
| 747 |
character itself. |
| 748 |
% |
| 749 |
\githubissue{345} |
| 750 |
|
| 751 |
\subsection{Avoid a \enquote{Corrupted NFSS tables} error} |
| 752 |
|
| 753 |
When a character with an accent is typeset, say \enquote{ä} or |
| 754 |
\enquote{é}, it might be the case that it doesn't exist in the font |
| 755 |
but has to be constructed from the base character and a standalone |
| 756 |
accent. If that accent is also not available in the font then \LaTeX{} |
| 757 |
attempts to find it in a different font, typically one in a different |
| 758 |
encoding, e.g., \texttt{OT1}. Unfortunately, when that involved font |
| 759 |
substitutions it resulted in a loop generating the mentioned error. |
| 760 |
This has now been corrected by adding necessary |
| 761 |
\cs{DeclareFontSubstitution} statements. |
| 762 |
% |
| 763 |
\githubissue{1709} |
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
%\subsection{A fix} |
| 768 |
|
| 769 |
%% Some text |
| 770 |
% |
| 771 |
%%\githubissue{XXXX} |
| 772 |
|
| 773 |
%\section{Changes to packages in the \pkg{amsmath} category} |
| 774 |
|
| 775 |
%\section{Changes to packages in the \pkg{graphics} category} |
| 776 |
|
| 777 |
\section{Changes to packages in the \pkg{tools} category} |
| 778 |
|
| 779 |
\subsection{Updating the status of some components} |
| 780 |
|
| 781 |
The \pkg{tools} bundle contains a range of packages with different |
| 782 |
usage profiles. Some of these were necessary in the transition from |
| 783 |
\LaTeX{}~2.09 to \LaTeXe{}, |
| 784 |
while others continue to be very widely used in |
| 785 |
current documents (for example, \pkg{array}). We have therefore marked |
| 786 |
a small number of packages |
| 787 |
\pagebreak |
| 788 |
in \pkg{tools} as \emph{retained only for |
| 789 |
historical and stability reasons}, and, where relevant, pointed to more |
| 790 |
up-to-date alternatives; the list is: |
| 791 |
\begin{itemize} |
| 792 |
\item \pkg{enumerate}: use \pkg{enumitem} instead |
| 793 |
\item \pkg{rawfonts}: retained as part of \LaTeX{}~2.09 support |
| 794 |
\item \pkg{somedefs}: retained as part of \LaTeX{}~2.09 support |
| 795 |
\item \pkg{theorem}: use \pkg{amsthm} instead |
| 796 |
\item \pkg{verbatim}: use \pkg{fancyvrb} instead |
| 797 |
\end{itemize} |
| 798 |
|
| 799 |
\subsection{Update to handling page marks in \pkg{longtable}} |
| 800 |
|
| 801 |
The \pkg{longtable} package has been updated to correctly |
| 802 |
adjust the new \LaTeX\ mark structures as each page is output. |
| 803 |
% |
| 804 |
\githubissue{1814} |
| 805 |
|
| 806 |
\subsection{Update to \pkg{bm}} |
| 807 |
|
| 808 |
The \pkg{bm} package has been extended to accept commands defined via \verb|\chardef| |
| 809 |
\Dash |
| 810 |
for example \verb|\#|. |
| 811 |
% |
| 812 |
\githubissue{1867} |
| 813 |
|
| 814 |
|
| 815 |
\section{Changes to files in the \pkg{firstaid} category} |
| 816 |
|
| 817 |
\subsection{First aid for AMS classes} |
| 818 |
|
| 819 |
The AMS classes still use the old mark mechanism (replaced by a new |
| 820 |
one in 2024 and finally retired in the June 2025 release), overwriting |
| 821 |
some but not all of the kernel code. In some cases this now causes problems, |
| 822 |
so we have added a first aid for now. |
| 823 |
% |
| 824 |
\githubissue{1887} |
| 825 |
|
| 826 |
%\newpage |
| 827 |
|
| 828 |
\begin{thebibliography}{9}\frenchspacing |
| 829 |
|
| 830 |
\fontsize{9.3}{11.3}\selectfont |
| 831 |
|
| 832 |
\bibitem{42:Lamport} |
| 833 |
Leslie Lamport. |
| 834 |
\newblock \emph{{\LaTeX}: {A} Document Preparation System: User's Guide and Reference |
| 835 |
Manual}. |
| 836 |
\newblock \mbox{Addison}-Wesley, Reading, MA, USA, 2nd edition, 1994. |
| 837 |
\newblock ISBN 0-201-52983-1. |
| 838 |
\newblock Reprinted with corrections in 1996. |
| 839 |
|
| 840 |
\bibitem{42:ltnews} \LaTeX{} Project Team. |
| 841 |
\emph{\LaTeXe{} News 1--42}. November 2025. |
| 842 |
\url{https://latex-project.org/news/latex2e-news/ltnews.pdf} |
| 843 |
|
| 844 |
\bibitem{42:ltnews35} \LaTeX{} Project Team. |
| 845 |
\emph{\LaTeXe{} News 35}. June 2022. |
| 846 |
\url{https://latex-project.org/news/latex2e-news/ltnews35.pdf} |
| 847 |
|
| 848 |
\bibitem{42:ltnews38} \LaTeX{} Project Team. |
| 849 |
\emph{\LaTeXe{} News 38}. November 2023. |
| 850 |
\url{https://latex-project.org/news/latex2e-news/ltnews38.pdf} |
| 851 |
|
| 852 |
\bibitem{42:ltnews39} \LaTeX{} Project Team. |
| 853 |
\emph{\LaTeXe{} News 39}. June 2024. |
| 854 |
\url{https://latex-project.org/news/latex2e-news/ltnews39.pdf} |
| 855 |
|
| 856 |
\bibitem{42:ltnews41} \LaTeX{} Project Team. |
| 857 |
\emph{\LaTeXe{} News 41}. June 2025. |
| 858 |
\url{https://latex-project.org/news/latex2e-news/ltnews41.pdf} |
| 859 |
|
| 860 |
\bibitem{tagging-status} \LaTeX{} Project Team. |
| 861 |
\emph{Tagging Status of \LaTeX{} Packages and Classes}. November 2025. |
| 862 |
\url{https://latex3.github.io/tagging-project/tagging-status} |
| 863 |
|
| 864 |
\bibitem{tagging-project} \LaTeX{} Project Team. |
| 865 |
\emph{The \LaTeX{} Tagged PDF repository}. November 2025. |
| 866 |
\url{https://github.com/latex3/tagging-project/issues} |
| 867 |
|
| 868 |
\end{thebibliography} |
| 869 |
|
| 870 |
\end{document} |