summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex-dev/base/ltnews37.tex
blob: a1197e1052863e0c1c0daedd0130a41650b09dfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
% \iffalse meta-comment
%
% Copyright 2021-2023
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -——————————————
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%    https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
% \fi
% Filename: ltnews37.tex
%
% This is issue 37 of LaTeX News.

\NeedsTeXFormat{LaTeX2e}[2020-02-02]

\documentclass{ltnews}

%%  Maybe needed only for Chris' inadequate system:
\providecommand\Dash {\unskip \textemdash}

%% NOTE:  Chris' preferred hyphens!
%%\showhyphens{parameters}
%%  \hyphenation{because parameters parameter}

\usepackage[T1]{fontenc}

\usepackage{lmodern,url,hologo}

\usepackage{csquotes}
\usepackage{multicol}
\usepackage{color}

\providecommand\hook[1]{\texttt{#1}}

\providecommand\meta[1]{$\langle$\textrm{\itshape#1}$\rangle$}
\providecommand\option[1]{\texttt{#1}}
\providecommand\env[1]{\texttt{#1}}
\providecommand\Arg[1]{\texttt\{\meta{#1}\texttt\}}


\providecommand\eTeX{\hologo{eTeX}}
\providecommand\XeTeX{\hologo{XeTeX}}
\providecommand\LuaTeX{\hologo{LuaTeX}}
\providecommand\pdfTeX{\hologo{pdfTeX}}
\providecommand\MiKTeX{\hologo{MiKTeX}}
\providecommand\CTAN{\textsc{ctan}}
\providecommand\TL{\TeX\,Live}
\providecommand\githubissue[2][]{\ifhmode\unskip\fi
     \quad\penalty500\strut\nobreak\hfill
     \mbox{\small\slshape(%
       \href{https://github.com/latex3/latex2e/issues/\getfirstgithubissue#2 \relax}%
          	    {github issue#1 #2}%
           )}%
     \par\smallskip}
%% But Chris has to mostly disable \href for his TEXPAD app:
%%  \def\href #1{}  % Only For Chris' deficient TeX engine

% simple solution right now (just link to the first issue if there are more)
\def\getfirstgithubissue#1 #2\relax{#1}

\providecommand\sxissue[1]{\ifhmode\unskip
     \else
       % githubissue preceding
       \vskip-\smallskipamount
       \vskip-\parskip
     \fi
     \quad\penalty500\strut\nobreak\hfill
     \mbox{\small\slshape(\url{https://tex.stackexchange.com/#1})}\par}

\providecommand\gnatsissue[2]{\ifhmode\unskip\fi
     \quad\penalty500\strut\nobreak\hfill
     \mbox{\small\slshape(%
       \href{https://www.latex-project.org/cgi-bin/ltxbugs2html?pr=#1\%2F\getfirstgithubissue#2 \relax}%
          	    {gnats issue #1/#2}%
           )}%
     \par}

\let\cls\pkg
\providecommand\env[1]{\texttt{#1}}
\providecommand\acro[1]{\textsc{#1}}

\vbadness=1400  % accept slightly empty columns


\makeatletter
% maybe not the greatest design but normally we wouldn't have subsubsections
\renewcommand{\subsubsection}{%
   \@startsection      {subsubsection}{2}{0pt}{1.5ex \@plus 1ex \@minus .2ex}%
      {-1em}{\@subheadingfont\colonize}%
}
\providecommand\colonize[1]{#1:}
\makeatother

\let\finalvspace\vspace          % for document layout fixes

% Undo ltnews's \verbatim@font with active < and >
\makeatletter
\def\verbatim@font{%
  \normalsize\ttfamily}
\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\providecommand\tubcommand[1]{}
\tubcommand{\input{tubltmac}}

% \publicationday{01} % change this if it's not released on 1st of a month
\publicationmonth{June}
\publicationyear{2023  --- DRAFT version for upcoming release}

\publicationissue{37}

\begin{document}

\tubcommand{\addtolength\textheight{4.2pc}}   % only for TUB

\maketitle
{\hyphenpenalty=10000 \exhyphenpenalty=10000 \spaceskip=3.33pt \hbadness=10000
\tableofcontents}

\setlength\rightskip{0pt plus 3em}


\medskip


\section{Introduction}


\section{New functionality offered as part of the
  \enquote{\LaTeX{} Tagged PDF} project}

We have now enabled new automatic tagging functionality for additional
\LaTeX{} elements, among them most display environments, standard
sectioning commands and content, figure and table listings. This can
be activated through
\begin{verbatim}
\DocumentMetadata{testphase=phase-III}
\end{verbatim}
At this point in time tagging support is only available for a
restricted set of documents, i.e., those that use one of the basic
document classes (\texttt{article}, \texttt{report}, and
\texttt{book}) and only use commands and environments described in
Lamport's \LaTeX{} manual.

Using other document classes or adding additional packages in the
preamble may work (or may partially work) but at this stage it is not
very likely, at least not for packages or classes that excessively
alter internals of \LaTeX{}.

Also note that there are still several environments and commands
described in the \LaTeX{} manual that do not have tagging support yet,
notably tabulars, floats, \texttt{tabbing} and the various math
environment.  They will get this support as part of \texttt{phase-III}
between now and the June release.

A prototype for math tagging (including support for the \pkg{amsmath}
environments) is already available, but it is mainly intended for
experimentation and feedback and the resulting tagging is by no means
the way we envision it to be eventually. If you like to try it out use
the following line:
\begin{verbatim}
\DocumentMetadata{testphase={phase-III,math}}
\end{verbatim}
Note that the math tagging code at this point in time will clash with
packages that redefine the \texttt{\$} (which then may lead to strange
errors) and that packages that use math mode for non-mathematical
constructs may result in surprising output as far as tagging is
concerned. Feedback on which packages fail with the code in one or the
other way would be appreciated.

The \texttt{latex-lab} bundle contains various 
(still untagged) documentation files about the new code that can
be accessed with \verb|texdoc -l latex-lab|.

Feedback is welcome! 
Please use \url{https://github.com/latex3/latex2e/discussions/1010}.

\section{Documentation improvements}


\subsection{Displaying the exact release dates for \LaTeX{}}

In some situations it is necessary to find out the exact release dates
for older version of the \LaTeX{} format, for example, when you need
to use different code in a package depending on the availablilty of a
certain feature and you therefore want to use
\cs{IfFormatAtLeastTF}\texttt\{\meta{date}\texttt\} or the
rather horrible construction \verb/\@ifl@t@r\fmtversion{/\meta{date}\texttt\},
if you
want to cater for formats that are older than 2020.

Or you know that your package is definitely not going to work with a
format before a certain \meta{date}, in which case you could use
\verb/\NeedsTeXFormat{LaTeX2e}[/\meta{date}\texttt] to ensure that any
  user is alerted if their format is too old.

The big problem is to know the exact \meta{date} to put into such
commands and in the past that was not that easy to find. You could have 
looked in the the file \file{changes.txt}, but that is hidden somewhere
in your installation and if you try
\verb*/texdoc -l changes.txt/ you get more than thirty results and the
right file is by no means the first.

Yukai Chou (\textsf{@muzimuzhi}) kindly provided a patch for this, so that we now have
the exact dates for each \LaTeX{} format listed in an easy to remember
place: in \file{ltnews.pdf} and that file conveniently also contains all major
features and changes to \LaTeX{} over the years\Dash one of which is
most likely the reason you need the \meta{date} date in the first
place.

It is given in parentheses in the newsletter title, thus this
newsletter tells you that on
%
\makeatletter
\mbox{\expandafter\@gobblenonyear\@year\@nil
  -\@julianmonthtonum\@month-\two@digits\@day}
\makeatother
%
the command
\cs{NewEnvironmentCopy}, a new \texttt{shipout} hook, etc.\ was made
available.  And looking into \file{ltnews.pdf} you can now easily find
out that the \LaTeX3 programming layer was added on 2020-02-02
(because the date was so nice) and not on the first of the month.
%
\githubissue{982}



\section{New or improved commands}



\subsection{Providing copy and show functions for environments}

To copy a command definition we have introduced \cs{NewCommandCopy} in
2022.  This even allows you to copy commands that consist of several internal
components, such as robust commands or those with a complex signature.
To do the same with environments, e.g., to define the environment
\env{myitemize} to be equivalent to \env{itemize}, you can now write
\begin{verbatim}
  \NewEnvironmentCopy{myitemize}{itemize}
\end{verbatim}
There are also \cs{Renew...}\ and \cs{Declare...}, which may be useful
depending on the circumstances.

In addition, we offer a \cs{ShowEnvironment} command, which displays the
\cs{begin} and \cs{end} code of the environment passed as an
argument. E.g., \verb=\ShowEnvironment{center}= results in the
following output:
\begin{verbatim}
  > \begin{center}=environment:
  > ->\trivlist \centering \item \relax .
  <recently read> }
  l. ...\ShowEnvironment{center}
  > \end{center}:
  > ->\endtrivlist .
  <recently read> }
  l. ...\ShowEnvironment{center}
\end{verbatim}
%
\githubissue{963}




\section{Code improvements}

\subsection{\pkg{doc}: Index \texttt{\textbackslash\textvisiblespace} correctly}

\emph{to write}
%
\githubissue{943}


\subsection{Default definition for \cs{do}}

The command \cs{do} with its nice public name is in reality an
internal command inherited from plain \TeX{} for list
processing. However, it only got a definition when
\verb=\begin{document}= was executed, with a result that a user
definition in the preamble was unconditionally overwritten at this
point. To properly alert the user that this command is not freely
available we now already provide a definition in the format so that
\cs{newcommand} and friends produce a proper error message instead of
providing a definition that doesn't last.
%
\githubissue{975}


\subsection{\pkg{doc}: Support the \pkg{upquote} package}

The default quote and backquote characters in typewriter fonts are
typographical quotes, e.g., the input
\begin{verbatim}
   \verb*/`prog 'my input'`/
\end{verbatim}
 is rendered as \verb*/`prog 'my input'`/ and not as
%
\begingroup              % code to mimic upquote.sty
\catcode`'=\active
\catcode``=\active
\makeatletter
\g@addto@macro\@noligs
   {\let'\textquotesingle
    \let`\textasciigrave
    \ifx\encodingdefault\upquote@OTone
    \ifx\ttdefault\upquote@cmtt
    \def'{\char13 }%
    \def`{\char18 }%
    \fi\fi}
\endgroup
%
\verb*/`prog 'my input'`/ as preferred by many programmers.

This can be adjusted, for example, with the \pkg{upquote} package,
which results in the second output. However, for historical reasons
\pkg{doc} had its own definition of \cs{verb} and \env{verbatim} and
as a consequence the two packages did not cooperate.  This has now
been fixed and loading \pkg{upquote} together with \pkg{doc} has the
desired effect.
%
\githubissue{953}


\subsection{New key for \env{filecontents}}

The \env{filecontents} environment warns on the terminal if a file
gets overwritten even if that is intentional,
e.g., when you write a temporary file over and over again.  To make
the warning less noisy in this case we added a new \texttt{nowarn} key
that redirects the overwriting warning to the transcript file. We
think that some record of the action is still required to help with
debugging, thus it is not completely silenced. The warning that
nothing gets written, because the file aready exists (and the
\texttt{force} key was not used), is not altered and still shows up on
the terminal.
%
\githubissue{958}



\subsection{A further hook for shipping out pages}

Since October 2020 the shipout process offers a number of hooks to
adjust what is happening before, during, and after the
\cs{shipout}. For example, with the \hook{shipout/before} hook, packages
can reset code they have altered (e.g., \cs{catcode}s during
verbatim-like processing) and with \hook{shipout/background} and
\hook{shipout/foreground} material can be added to the pages.
Details are given in \cite{37:ltshipout-doc}. However, what was
missing was a hook that allows a package writer to manipulate the
completed page (with foreground and background attached) just before
the actual shipout happens.

For this we now provide the additional hook \hook{shipout}. One
use case (sometimes needed in print production) is to mirror the
whole page via \cs{reflectbox} including all the extra data that may
have been added into the fore- or background.
%
\githubissue{920}



\subsection{Displaying release information in the \texttt{.log}}

\LaTeX{} displays its release information at the very beginning of the
\LaTeX{} run on the terminal and also writes it to the transcript file
if that is already opened at this point. While this is normally true,
it is not the case if the \LaTeX{} run was started passing additional
\TeX{} code on the command line, e.g.,
\begin{verbatim}
pdflatex '\PassOptionsToClass{11pt}{article}
              \input{myarticle}'
\end{verbatim}
In this case the release information is displayed when
\cs{PassOptionsToClass} is processed but the transcript file is only
opened when the output file name is known, i.e., after \cs{input} has
been seen, and as a result the release information is only shown on
the terminal.

To account for this scenario, we now repeat the release information
also at the very end of the transcript file where we can be sure that
it is open and ready to receive material.
%
\githubissue{944}





\section{Bug fixes}

\subsection{Incompatibility between \pkg{doc} and \pkg{unicode-math}}

The \pkg{unicode-math} package alters the catcode of \verb=|= but does
not adjust its value for use in \pkg{doc}, with the result that
\enquote{or} module, i.e., $\langle A | B \rangle$ are displayed in a
strange way. This is now fixed with some firstaid code that will
eventually be moved into \pkg{unicode-math}.
%
\githubissue{820}


\subsection{A fix for \cs{hspace}}

The change to \cs{hspace}, done in 2020 to make it \pkg{calc} aware,
had the unfortunate side effect that starting a paragraph with
\cs{hspace} would result in the execution of \cs{everypar} inside a
group (i.e., any local changes would immediately be revoked, breaking,
for example, \pkg{wrapfig} in that special situation).
%
This got fixed with the 2022-11 PL1 hotfix, so was already corrected in
the previous release, but only now documented in a newletter.
%
\githubissue{967}


\subsection{Improve spacing at top of \env{minipages}}

A list and several other document elements add some vertical space in
front of them. However this should not happen at the beginning of a
box (such as a \env{minipage}) and normally it doesn't, because
\TeX{} automatically drops such spaces at the start of a vertical
list. However, if there is some invisible material, such as a
\cs{color} command, some \pkg{hyperref} anchor, a \cs{write} or
something else, then the list is no longer empty and \TeX{} no longer
drops spaces, hence the difference.

With the new paragraph handling introduced in 2021 it is now finally
possible to detect and avoid this problem and apply appropriate
counter measures so that from now on the spacing will be always
correct.
%
\githubissue{989}



\section{Changes to packages in the \pkg{amsmath} category}

\section{Changes to packages in the \pkg{graphics} category}

\section{Changes to packages in the \pkg{tools} category}


\subsection{Fix handling of nested \env{multicols}}

If \env{multicols} environments have been nested into each other (the
inner one boxed) it could fail if the boxed environment appeared near a
page break. The problem was that the output routine was called while
the \cs{hsize} was still altered to fit the column width of the inner
\env{multicols} --- thereby messing up the placement of columns of the
page. This has now been fixed.
%
\githubissue{1002}



%\medskip

\begin{thebibliography}{9}

\fontsize{9.3}{11.3}\selectfont

\bibitem{37:ltshipout-doc} Frank Mittelbach, \LaTeX{}~Project~Team:
  \emph{The \texttt{\upshape ltshipout} documentation}.\\
  Run \texttt{texdoc} \texttt{ltshipout-doc} to view.

%\bibitem{37:blueprint} Frank Mittelbach and Chris Rowley:
%  \emph{\LaTeX{} Tagged PDF \Dash A blueprint for a large project}.\\
%  \url{https://latex-project.org/publications/indexbyyear/2020/}

%\bibitem{37:source2e}
%  \emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\
%  \url{https://latex-project.org/help/documentation/}

%\bibitem{37:Lamport}
%Leslie Lamport.
%\newblock {\LaTeX}: {A} Document Preparation System: User's Guide and Reference
%  Manual.
%\newblock \mbox{Addison}-Wesley, Reading, MA, USA, 2nd edition, 1994.
%\newblock ISBN 0-201-52983-1.
%\newblock Reprinted with corrections in 1996.
%
%\bibitem{37:ltnews32} \LaTeX{} Project Team:
%  \emph{\LaTeXe{} news 32}.\\
%  \url{https://latex-project.org/news/latex2e-news/ltnews32.pdf}
%
%\bibitem{37:ltnews34} \LaTeX{} Project Team:
%  \emph{\LaTeXe{} news 34}.\\
%  \url{https://latex-project.org/news/latex2e-news/ltnews34.pdf}
%
%\bibitem{37:ltnews35} \LaTeX{} Project Team:
%  \emph{\LaTeXe{} news 35}.\\
%  \url{https://latex-project.org/news/latex2e-news/ltnews35.pdf}
%
%\bibitem{37:fntguide} \LaTeX{} Project Team:
%  \emph{\LaTeXe{} font selection}.\\
%  \url{https://latex-project.org/help/documentation/}
%
%\bibitem{37:ltfilehook-doc} Frank Mittelbach, Phelype Oleinik, \LaTeX{}~Project~Team:
%  \emph{The \texttt{\upshape ltfilehook} documentation}.\\
%  Run \texttt{texdoc} \texttt{ltfilehook-doc} to view.
\end{thebibliography}



\end{document}