% \iffalse meta-comment % % Copyright 2019-2021 % 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: ltnews35.tex % % This is issue 35 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\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{June} \publicationyear{2022 --- DRAFT version for upcoming release} \publicationissue{35} \begin{document} \tubcommand{\addtolength\textheight{4.2pc}} % only for TUB \maketitle {\hyphenpenalty=10000 \spaceskip=3.33pt \hbadness=10000 \tableofcontents} \setlength\rightskip{0pt plus 3em} \medskip \section{Introduction} \section{Document metadata interface} Until recently there was no dedicated location to declare settings that affect a document as a whole. Settings had to be placed somewhere in the preamble or as class options or sometimes even as package options. For some such settings this may cause issues, e.g., setting the PDF version is only possible as long as the PDF output file has not yet been opened which can be caused by loading one or the other package. For the \enquote{\LaTeX{} Tagged PDF project}~\cite{35:blueprint} further metadata about the whole document (and its processing) need to be specified and again this data should be all placed in a single well-defined place. For this reason we introduce the new command \cs{DocumentMetadata} to unify all such settings in one place. The command expects a key/value list that describes all document metadata for the current document. It is only allowed to be used at the very beginning of the document, i.e., the declaration has to be placed \emph{before} \cs{documentclass} and will issue an error if found later. At this point in time we only provide the bare command in the format, the actual processing of the key/value is defined externally and the necessary code will be loaded if the command is used. This scheme is chosen for two reasons: by adding the command in the kernel it is available to everybody without the need to load a special package using \cs{RequirePackage}. The actual processing, though, is external so that we can easily extend the code (e.g., offering additional keys or changing the internal processing) while the above mentioned project is progressing. Both together allows users to immediately benefit from intermediate results produced as part of the project, as well as offering the \LaTeX{} Project Team the flexibility to enable such intermediate results (for test purposes or even production use) in-between and independently of regular \LaTeX{} releases. Over time, tested and approved functionality can then seamlessly move into the kernel at a later stage without any alterations to documents already using it. At the same time, not using the new consolidated interface means that existing documents are in no way affected by the work that is carried out and is in a wider alpha or beta test phase. Documentation about the new command and already existing keys are in \file{l3meta.pdf} and \file{documentmetadata-support.pdf} and also in the documentation of the \pkg{pdfmanagement-testphase} package. \section{The \pkg{latex-lab} bundle} \emph{write about it} \section{New or improved commands} \subsection{A kevyal approach to option handling} The classical \LaTeXe{} method for handling options, using \cs{ProcessOptions}, treats each entry in the list as a string. Many package authors have sought to extend this handling by treating each entry as a key--value pair (keyval) instead. To-date, this has required the use of additional packages, for example \pkg{kvoptions}. The \LaTeX{} team have for some time offered the package \pkg{l3keys2e} to allow keyvals defined using the L3 programming layer module \pkg{l3keys} to act as package options. This ability has now been integrated directly into the kernel. As part of this integration, the syntax for processing keyval options has been refined, such that \begin{verbatim} \ProcessKeyOptions \end{verbatim} will now automatically pick up the package name as the key \emph{family}, unless explicitly given as an optional argument. \begin{verbatim} \ProcessKeyOptions[family] \end{verbatim} A version which does not consider global options, \cs{ProcessKeyPackageOptions}, is also available. To support creating key options in for this mechanism, the new command \cs{DeclareKeys} has been added. This works using the same general approach as \pkg{l3keys} or \pkg{pgfkeys}: each key has one or more \emph{properties} which define its behavior. Options for packages which use this new approach will not be checked for clashes by the kernel. Instead, each time a \cs{usepackage} or \cs{RequirePackage} line is encountered, the list of options given will be passed to \cs{ProcessKeyPackageOptions}. Options which can only be given the first time a package is loaded can be marked using the property \texttt{.usage = load}, and will result in a warning if used in a subsequent package loading line. Package options defined in this way can also be set within a package using the new command \cs{SetKeys}, which again takes an optional argument to specify the \emph{family}, plus a mandatory one for the options themselves. \subsection{Floating point and integer calculations} The L3 programming layer offers expandable commands for calculating floating point and integer values, but so far these functions have only been available to programmers, because they require \cs{ExplSyntaxOn} to be in force. To make them easily available at the document-level, the small package \pkg{xfp} defined \cs{fpeval} and \cs{inteval}. An example of use could be the following: \begin{verbatim} \LaTeX{} can now compute: \[ \frac{\sin (3.5)}{2} + 2\cdot 10^{-3} = \fpeval{sin(3.5)/2 + 2e-3} \] \end{verbatim} which produces the following output: \begin{quote} \LaTeX{} can now compute: \[ \frac{\sin (3.5)}{2} + 2\cdot 10^{-3} = \fpeval{sin(3.5)/2 + 2e-3} \] \end{quote} These two commands have now been moved into the kernel and in addition we also provide \cs{dimeval} and \cs{skipeval}. The details of their syntax are described in \file{usrguide3.pdf}. The command \cs{fpeval} offers a rich syntax allows for extensive calculations whereas the other three commands are essentially thin wrappers for \cs{numexpr}, \cs{dimexpr}, and \cs{glueexpr} \Dash therefore inheriting some syntax peculiars and limitations in expressiveness. \begin{verbatim} \newcommand\calulateheight[1]{% \setlength\textheight{\dimeval{\topskip + \baselineskip * \inteval{#1-1}}}} \end{verbatim} The above, for example, calculates the appropriate \cs{textheight} for a given number of text lines. % \githubissue{711} \subsection{CamelCase commands for changing arguments to csnames} It is sometimes helpful to \enquote{construct} a command name on the fly rather than providing it as a single \cs{...} token. For these kind of tasks the \LaTeX3 programming layer offers a general mechanism (in form of \cs{exp\_args:N...} and \cs{cs\_generate\_variant:Nn}). However, when declaring new document-level commands with \cs{NewDocumentCommand} or \cs{NewCommandCopy}, etc.\ the L3 programming layer may not be active, and even if it is, mixing CamelCase syntax with L3 programming syntax is not really a good approach. We have therefore added the commands \cs{UseName} and \cs{ExpandArgs} to assist in such situations, e.g., \begin{verbatim} \NewDocumentCommand\newcopyedit{mO{red}} {\newcounter{todo#1}% \ExpandArgs{c}\NewDocumentCommand{#1}{s m}% {\stepcounter{todo#1}% \IfBooleanTF {##1}% {\todo[color=#2!10]% {\UseName{thetodo#1}: ##2}}% {\todo[inline,color=#2!10]% {\UseName{thetodo#1}: ##2}}% }% } \end{verbatim} which provides a declaration mechanism for copyedit commands, so that \verb=\newcopyedit{FMi}[blue]= then defines \cs{FMi} (and the necessary counter). The command \cs{ExpandArgs} can be useful with the argument \texttt{cc} or \texttt{Nc} in combination with \cs{NewCommandCopy} if the old or new command name or both need constructing. Finally, there is \cs{UseName} which takes its argument and turns it into a command (i.e., a CamelCase version of \cs{@nameuse} (\LaTeXe) or \cs{use:c} (L3 programming layer)) which was also used in the example above. % \githubissue{735} \subsection{???} % \githubissue{???} \section{Code improvements} \subsection{\class{ltxdoc} gets a \option{nocfg} option} The \LaTeX{} sources are formatted with the \class{ltxdoc} class, which supports loading a local config file \file{ltxdoc.cfg}. In the past the \LaTeX{} sources used such a file but it was not distributed. As a result reprocessing the \LaTeX{} sources elsewhere showed formatting changes. We now distribute this file which means that it is loaded by default. With the option \option{nocfg} this can be prevented. \subsection{\pkg{doc} upgraded to version~3} After roughly three decades the \pkg{doc} package gets a cautious uplift, as already announced at the TUG conference 2019\Dash changes to \pkg{doc} are obviously always done in a leisurely manner. Given that most documentation is nowadays viewed on screen, \pkg{hyperref} support is added and by default enabled (suppress it with option \option{nohyperref} or alternatively with \option{hyperref}\texttt{=false}) so the internal cross-reference are properly resolved including those from the index back into the document. Furthermore, \pkg{doc} has now a general mechanism to define additional \enquote{doc} elements besides the two \texttt{Macro} and \texttt{Env} it did know in the past. This enables better documentation because you can now clearly mark different types of objects instead of simply calling them all \enquote{macros}. If desired, they can be collected together under a heading in the index so that you have a section just with your document interface commands, or with all parameters, or \ldots The code borrows ideas from Didier Verna's \pkg{dox} package (although the document level interface is different) and it makes use of Heiko Oberdiek's \pkg{hypdoc} package, which at some point in the future will be completely integrated, given that its whole purpose it to patch \pkg{doc}'s internal commands to make them \pkg{hyperref}-aware. All changes are expected to be upward compatible, but if you run into issues with older documentation using \pkg{doc} a simple and quick solution is to load the package as follows: \verb/\usepackage{doc}[=v2]/ \subsection{\pkg{doc} can now show dates in change log} Up to now the change log was always sorted by version numbers (ignoring the date that was given in the \cs{changes} command). It can now be sorted by both version and date if you specify the option \option{reportchangedates} on package level and in that case the changes are displayed with \begin{quote} \meta{version} -- \meta{date} \end{quote} as the heading (instead of just \meta{version}), when using \cs{PrintChanges}. % \githubissue{gh/531} \subsection{Lua\TeX\ callback improvements} The Lua\TeX\ callbacks \texttt{hpack\_quality} and \texttt{vpack\_quality} are now \texttt{exclusive} and therefore only allow a single handler. The previous type \texttt{list} resulted in incorrect parameters when multiple handlers were set, therefore this only makes an existing restriction more explicit. Additionally the return value \texttt{true} for \texttt{list} callbacks is now handled internally and no longer passed on to the engine. This simplifies the handling of these callbacks and makes it easier to provide consistent interfaces for user defined \texttt{list} callbacks. \subsection{Class \class{proc} supports \option{twoside}} The document class \class{proc}, which is a small variation on the \class{article} class, now supports the \option{twoside} option displaying different data in the footer line on recto and verso pages. % \githubissue{gh/704} \subsection{Croatian character support} The default \pkg{inputenc} support has been extended to support the 9 characters D\v Z, D\v z, d\v z, LJ, Lj, lj, NJ, Nj, nj, input as single UTF-8 codepoints in the range U+01C4 to U+01CC. % \githubissue{gh/723} \subsection{Cleanup of the Unicode declaration interface} When declaring encoding specific commands for the Unicode (TU) encoding some declarations (e.g., \cs{DeclareUnicodeComposite}) do not have an explicit argument for the the encoding name, but instead use the command \cs{UnicodeEncodingName} internally. There was one exception though: \cs{DeclareUnicodeAccent} required an explicit encoding argument. This inconsistency has now been removed and the encoding name is always implicit. To avoid a breaking change for a few packages on CTAN \cs{DeclareUnicodeAccent} still accepts three arguments if the second argument is \texttt{TU} or \cs{UnicodeEncodingName}. Once all packages have been updated this code branch will get removed. At the same time we added \cs{DeclareUnicodeCommand} and \cs{DeclareUnicodeSymbol} for consistency. They also use \cs{UnincodeEncodingName} internally, instead of requiring an encoding argument as their general purpose counterparts do. % \githubissue{253} \subsection{???} % \githubissue{???} \section{Bug fixes} \subsection{Using \cs{DeclareUnicodeCharacter} with C1 control points} An error in the UTF-8 handling for non-Unicode \TeX, has prevented \cs{DeclareUnicodeCharacter} being used with characters in the range hex 80 to 9F, this has been corrected in this release. % \githubissue{730} \subsection{Fix \cs{ShowCommand} when used with \pkg{ltcmd}} When \cs{ShowCommand} support was added for \pkg{ltcmd} in the previous release~\cite{35:ltnews34}, a blunder in the code made it so that when \cs{ShowCommand} was used on a command defined with \pkg{ltcmd}, it only printed the meaning of the command in the terminal, but didn't stop for interaction as it does elsewhere (mimicking \cs{show}). The issue is now fixed. % \githubissue{739} \section{Changes to packages in the \pkg{amsmath} category} \subsection{???} % \githubissue{???} \section{Changes to packages in the \pkg{graphics} category} \subsection{Color in formulas} While it is possible to color parts of a formula using \cs{color} commands the approach is fairly cumbersome. For example, to color an summation sign, but not its limits, you need four \cs{color} commands and some seemingly unnecessary set of braces to get coloring and spacing right: \begin{verbatim} \[ X = \color{red} \sum % without {{ the superscript below is misplaced _{{\color{black} i=1}} % without {{ the \sum is black ^{{\color{black} n}} \color{black} % without it the x_i is red x_i \] \end{verbatim} Leave out any of the \cs{color} commands or any of the \verb={{...}}= will give you a wrong result instead of the desired \[ X = \color{red} \sum _{{\color{black} i=1}} % without {{ the superscript is misplaced ^{{\color{black} n}} % without {{ the \sum is black \color{black} % without it the x_i is red x_i \] So even if this is possible, it is not a very practical solution and furthermore there are a number of cases where it is impossible to color a certain part of a formula, for example, an opening symbol such as \verb=\left(= but not the corresponding \verb=\right)=. We have therefore added the command \cs{mathcolor} to the \pkg{color} and \pkg{xcolor} package, which has the same syntax as \cs{textcolor}, but is specially designed for use in math and handles sub and superscripts and other aspects correctly and preserves correct spacing. Thus, the above example can now be written as \begin{verbatim} \[ X = \mathcolor{red}{\sum}_{i=1}^n x_i \] \end{verbatim} For details and further examples, see \file{mathcolor.pdf}. \subsection{???} % \githubissue{???} \section{Changes to packages in the \pkg{tools} category} \subsection{\pkg{multicol}: Fix \cs{newcolumn}} The recently added \cs{newcolumn} didn't work properly if used in vertical mode, where it behaved like \cs{columnbreak}, i.e., spreading the column material out instead running the column short. % \sxissue{q/624940} \subsection{\pkg{bm}: Fix for \pkg{amsmath} operators} An internal command used in the definition of operator commands such as \cs{sin} in \pkg{amsmath} has been guarded in \cs{bm} to prevent internal syntax errors due to premature expansion. % \githubissue{744} \medskip \begin{thebibliography}{9} \fontsize{9.3}{11.3}\selectfont \bibitem{35: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{35:source2e} \emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\ \url{https://latex-project.org/help/documentation/} \bibitem{35:ltnews31} \LaTeX{} Project Team: \emph{\LaTeXe{} news 31}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews31.pdf} \bibitem{35:ltnews32} \LaTeX{} Project Team: \emph{\LaTeXe{} news 32}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews32.pdf} \bibitem{35:ltnews33} \LaTeX{} Project Team: \emph{\LaTeXe{} news 33}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews33.pdf} \bibitem{35:ltnews34} \LaTeX{} Project Team: \emph{\LaTeXe{} news 34}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews34.pdf} \end{thebibliography} \end{document}