summaryrefslogtreecommitdiff
path: root/macros/latex/base/ltnews36.tex
blob: 5dee9587479be12865d79f9c1f4873ac3191dc34 (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
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
% \iffalse meta-comment
%
% Copyright (C) 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: ltnews36.tex
%
% This is issue 36 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}}

\publicationmonth{November}
\publicationyear{2022} %  --- DRAFT version for upcoming release}

\publicationissue{36}

\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}

The 2022-11 release of \LaTeX{} is largely a consolidation release
where we made a number of minor improvements to fix some bugs or
improve one or the other interface.

The only really important functionality that was added is described in
the next section: the ability to easily define document-level commands
and environments that accept a key/value list in one of its (usually
optional) arguments, including the ability to determine if the argument
does in fact contain such a key/value list or just a single
\enquote{classical} value.

For the \enquote{Tagged \LaTeX{} Project} this functionality is very
important because many document-level commands will need to accept
such key/value lists, for example, to specify alternative text or
overwrite default tagging if that becomes necessary in a document.


\section{Auto-detecting key/value arguments}

To allow extension of the core \LaTeX{} syntax, \pkg{ltcmd} now supports
a \texttt{={...}}\ modifier when grabbing arguments. This modifier instructs
\LaTeX{} that the argument should be passed to the underlying code as
a set of key/values. If the argument does not \enquote{look like} a set
of key/values, it will be converted into a single key/value pair, with
the argument to \texttt{=} specifying the name of that key. For
example, the \cs{caption} command could be defined as
\begin{verbatim}
  \DeclareDocumentCommand\caption
         {s ={short-text}+O{#3} +m}
         {...}
\end{verbatim}
which would mean that if the optional argument does \emph{not}
contain key/value data, it will be converted to a single key/value
pair with the key name \texttt{short-text}.

Arguments which begin with \texttt{=,} are always interpreted as
key/values even if they do not contain further \texttt{=} signs.
Any \texttt{=} signs enclosed within \verb|$...$| or \verb|\(...\)|,
i.e.~in inline math mode, are ignored, meaning that
only \texttt{=} outside of math mode will generally cause
interpretation as key/value material.

In case the argument contains a \enquote{textual} \texttt{=} sign that
is mistaken as a key/value indicator you can hide it using a brace
group as you would do in other places, e.g.,
\begin{verbatim}
\caption[{Use of = signs}]
        {Use of = signs in optional arguments}
\end{verbatim}
However, because \texttt{=} signs in math mode are already ignored, this
should seldom be necessary.


\section{A note for font package developers}

\subsection{Encoding subsets for \texttt{TS1} encoded fonts}

The text companion encoding \texttt{TS1} is unfortunately not very
faithfully supported in fonts that are not close cousins to the
Computer Modern fonts. It was therefore necessary to provide the
notion of \enquote{sub-encodings} on a per font basis. These
sub-encodings are declared for a font family with the help of a
\cs{DeclareEncodingSubset} declaration, see \cite{36:fntguide} for
details.

Maintainers of font bundles that include \texttt{TS1} encoded font
files should add an appropriate declaration into the corresponding
\texttt{ts1}\textit{family}\texttt{.fd} file, because otherwise the
default subencoding is assumed, which is probably disabling too many
glyphs that are actually available in the font.\footnote{The \LaTeX{}
  format contains declarations for many font families already.  This
  was done in 2020 to quickstart the use of the symbols in the kernel,
  but it is really the wrong place for such declarations. Thus, for
  new fonts the declarations should be placed into the corresponding
  \texttt{.fd} files.}
%
\githubissue{905}

\section{New or improved commands}

\subsection{Better language handling for case-changing commands}

The commands \cs{MakeUppercase}, \cs{MakeLowercase} and \cs{MakeTitlecase} now
automatically detect the locale currently in use when \pkg{babel} is loaded.
This allows automatic adjustment of letter mappings where appropriate. They
also accept a leading optional argument. This accepts a key--value list of
control settings. At present, there is one key available: \texttt{locale},
which can also be accessed via the alias \texttt{lang}. This is intended to
allow local setting of the language, which can be done using a BCP-47
descriptor. For example, this could be used to force Turkish case changing in
otherwise English input
\begin{verbatim}
\MakeUppercase[lang = tr]{Ragıp Hulûsi Özdem}
\end{verbatim}
yields
  \MakeUppercase[lang = tr]{Ragıp Hulûsi Özdem}.
%   RAGIP HULÛS\.I ÖZDEM.                           %TUB

\section{Code improvements}

\subsection{Support for slanted small caps in the EC fonts}
For some time \LaTeX{} has supported the combination of the shapes
small caps and italic/slanted. The EC fonts contain slanted small caps fonts
but using them required the loading of an external package. Suitable font definitions
have now been added to \pkg{t1cmd.fd} and so from now on
\begin{verbatim}
\usepackage[T1]{fontenc}
...
 \textsc{\textsl{Slanted Small Caps}};
 \textsc{\textit{Italic Small Caps}};
 \bfseries
 \textsc{\textsl{Bold Slanted Small Caps}};
 \textsc{\textit{Bold Italic Small Caps}}.
\end{verbatim}
will give the expected result: {\fontfamily{cmr}
\textsc{\textsl{Slanted Small Caps}}; \textsc{\textit{Italic Small Caps}};
\bfseries
\textsc{\textsl{Bold Slanted Small Caps}}; \textsc{\textit{Bold Italic Small Caps}}}.

Given that the Computer Modern fonts in \texttt{T1} do not have real
italic small caps but only slanted small caps, the latter is
substituted for the former. This is why both work in the above, but
there is no difference between the two (and you get a substitution
warning for the \cs{textit}\cs{textsc} shape combination).
%
\githubissue{782}


\subsection{EC sans serif at small sizes}

The EC (T1 encoded Computer Modern) sans serif fonts have errors at
small sizes: the medium weight is bolder and wider than the bold
extended. This makes them unusable at these small sizes. The default
\texttt{.fd} file has therefore been adjusted to use a scaled down 8pt
font instead.
%
\githubissue{879}



\subsection{Improve font series handling with incorrect \texttt{.fd} files}

By convention, the font series value is supposed to contain no
\texttt{m}, unless you refer to the \enquote{medium} series (which is
represented by a single \texttt{m}). For example, one should write
\texttt{c} for \enquote{medium weight, condensed width} and not
\texttt{mc}. This was one of the many space-conserving methods
necessary in the early days of \LaTeXe.

Some older \texttt{.fd} files
do not obey that convention but use \texttt{mc}, \texttt{bm}, etc., in
their declarations. As a result, some font selection scheme
functionality was not working when confronted with such \texttt{.fd}
files. We have therefore augmented \cs{DeclareSymbolFont} and
\cs{SetSymbolFont} to strip any surplus \texttt{m} from their series argument
so that they do not unnecessarily trigger font
substitutions. Regardless of this support such 
\texttt{.fd} files should get fixed by their maintainers.
%
\githubissue{918}




\subsection{Detect nested \texttt{minipage} environments}

Nesting of \texttt{minipage} environments is only partially supported
in \LaTeX{} and can lead to incorrect output, such as overfull boxes
or footnotes appearing in the wrong place;
see~\cite[p.~106]{36:Lamport}. However, until now there was no warning
if that happened.  This has been changed and the environment now
warns if you nest it in another \texttt{minipage} environment that
already contains footnotes.
%
\githubissue{168}


\subsection{Robust commands in package options}
With the standard key-based option handler added in the last release,
or with contributed packages offering similar features, users may
expect to be able to use a package option such as
\verb|[font=\bfseries]|.
Previously this failed with internal errors as the option list was
expanded via \verb|\edef|. This has now been changed to use the
existing command \verb|\protected@edef| so that any \LaTeX\ robust
command should be safe to pass to a key value option.
%
\githubissue{932}




\subsection{Improve \pkg{l3docstrip} integration into \pkg{docstrip}}

In 2020 we merged \pkg{l3docstrip.tex} into \pkg{docstrip.tex} to
support the \texttt{\%\string<@@=\meta{module}\string>} syntax of
\pkg{expl3}; see~\cite{36:ltnews32}.  However, this support was
incomplete, because it didn't cover \pkg{docstrip} lines of the form
\texttt{\%<+...>} or \texttt{\%<-...>}.  This was never noticed until
now, because usually \texttt{\%<*...>} blocks are used. Now all lines
in a \texttt{.dtx} file are subject to the \texttt{@@} replacement
approach.
%
\githubissue{903}



\subsection{\LuaTeX\ callback efficiency improvement}

The mechanism for providing the
\texttt{pre/post\_mlist\_to\_hlist\_filter} callbacks in \LuaTeX\ has
been improved to make it more reusable and to avoid overhead if these
callbacks are not used.
%
\githubissue{830}


\subsection{Rule-based ordering for \LuaTeX\ callback handlers}

In \hologo{LuaLaTeX} the callback handlers used to be called in the order
in which they were registered in, but this was often rather fragile.
It depends a lot on the load order and any attempts to enforce a
different order required unregistering and reregistering the handlers to
be reordered. Additionally, even if some ordering constraints where
enforced that way, another package loaded later could accidentally
overwrite it.

To improve this, we now order the callback handlers based on ordering
rules similar to the hook rules.

When registering a callback which should run before or after another
callback, \verb+luatexbase.declare_callback_rule+ can now be used to
record this ordering constraint.
For example
\begin{verbatim}
luatexbase.add_to_callback
 ('pre_shaping_filter', my_handler, 'my_name')
luatexbase.declare_callback_rule
 ('pre_shaping_filter',
            'my_name', 'before', 'other_name')
\end{verbatim}
will ensure that \verb+my_handler+ will always be called before the
handler registered as \verb+other_name+.

This also means that the order in which callbacks are registered no
longer implicitly defines an order.
Code which relied on this implicit order should now define the order
rules explicitly.



\section{Bug fixes}

\subsection{Prevent \TeX{} from losing a \cs{smash}}

When \TeX{} is typesetting a fraction, it will rebox the material in
either the numerator or denominator, depending on which is wider. If
the repackaged part consists of a single box, that box gets new
dimensions and if it was built using a \cs{smash} that effect vanishes
(because a smash is nothing other than zeroing some box dimension,
which now got undone). For example, in the line
\begin{verbatim}
\frac{1}{2} = \frac{1}{\smash{2^X}} 
            \neq \frac{100}{\smash{2^X}} 
\end{verbatim}
the $2$ in the denominators was not always at the same vertical position, because
the second \cs{smash} was ignored due to reboxing:
\vspace{-1.2\baselineskip}
\[
\makeatletter
\def\mathsm@sh#1#2{\setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh} % old definition
\makeatother
\newcommand*\drawbaseline{\rlap{\vrule width 60pt height 0.1pt depth 0pt }}
\qquad
\frac{1}{\drawbaseline2} = \frac{1}{\smash{2^X}}      \neq 
\frac{100}{\smash{2^X}}
\pagebreak     % not TUB
\]
The differences are subtle but noticeable.
This is now corrected and the \cs{smash} is always
honored. Thus now you get this output:
\vspace{-1.2\baselineskip}
\[
\newcommand*\drawbaseline{\rlap{\vrule width 60pt height 0.1pt depth 0pt }}
\qquad
\frac{1}{\drawbaseline2} = \frac{1}{\smash{2^X}}      \neq 
\frac{100}{\smash{2^X}}
\]
\par
\vspace{-1.5\baselineskip}
%
\githubissue{517}


\subsection{Resolve an issue with \cs{mathchoice} and \texttt{localalphabets}}

The code for keeping a number of math alphabets local (introduced in
2021; see~\cite{36:ltnews34}) used \cs{aftergroup} to do some cleanup actions after a
formula had finished.  Unfortunately, \cs{aftergroup} can't be used
inside the arguments of the \cs{mathchoice} primitive and as a result one
got low-level errors if the freezing happened in such a place.  The
implementation was therefore revised to avoid the \cs{aftergroup}
approach altogether.
%
\githubissue{921}

\subsection{Reporting of unused global options when using key/value processing}

Using the new key/value option processor did not properly report any unused
global options when it was used in handling class options. This has now been
corrected.
%
\githubissue{938}


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


%\newpage   TUB?

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

\subsection{Fix a \cs{mathcolor} bug}

The \cs{mathcolor} command introduced in \cite{36:ltnews35} needs to
scan for following sub- and superscripts, but if it did so at the end
of an alignment cell, e.g., in a \texttt{array} environment, the
\texttt{\&} was evaluated too early, causing some internal errors. This
is now properly guarded for.
%
\githubissue{901}



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

\subsection{\pkg{array}: Correctly identify single-line m-cells}

Cells in m-columns that contain only a single line are supposed to
behave like single-line p-cells and align at the same baseline. To
test for the condition, \pkg{array} used to compare the height of the cell to
the height of the strut used for the table rows. However, the height of that
strut depends on the setting of \cs{arraystretch} and if you made this
negative (or very large) the test came out wrong.  Therefore, we now
test against the height of a normal strut to ensure that single-line
cells are correctly identified as such (unless their content is truly very
tall, in which case aligning is pointless anyway).
%
\githubissue{766}


%\medskip

\begin{thebibliography}{9}

\fontsize{9.3}{11.3}\selectfont

%\bibitem{36: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{36:source2e}
%  \emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\
%  \url{https://latex-project.org/help/documentation/}

\bibitem{36: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{36:ltnews32} \LaTeX{} Project Team:
  \emph{\LaTeXe{} news 32}.\\
  \url{https://latex-project.org/news/latex2e-news/ltnews32.pdf}

\bibitem{36:ltnews34} \LaTeX{} Project Team:
  \emph{\LaTeXe{} news 34}.\\
  \url{https://latex-project.org/news/latex2e-news/ltnews34.pdf}

\bibitem{36:ltnews35} \LaTeX{} Project Team:
  \emph{\LaTeXe{} news 35}.\\
  \url{https://latex-project.org/news/latex2e-news/ltnews35.pdf}

\bibitem{36:fntguide} \LaTeX{} Project Team:
  \emph{\LaTeXe{} font selection}.\\
  \url{https://latex-project.org/help/documentation/}

%\bibitem{36: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}