% \iffalse meta-comment
%
% Copyright (C) 2021-2024
% 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}
