diff options
Diffstat (limited to 'macros/latex-dev/base/ltnews35.tex')
-rw-r--r-- | macros/latex-dev/base/ltnews35.tex | 154 |
1 files changed, 136 insertions, 18 deletions
diff --git a/macros/latex-dev/base/ltnews35.tex b/macros/latex-dev/base/ltnews35.tex index e798d4c2e4..671d6d337a 100644 --- a/macros/latex-dev/base/ltnews35.tex +++ b/macros/latex-dev/base/ltnews35.tex @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 2019-2021 +% Copyright 2021-2022 % The LaTeX Project and any individual authors listed elsewhere % in this file. % @@ -186,14 +186,44 @@ and also in the documentation of the \pkg{pdfmanagement-testphase} package. \section{The \pkg{latex-lab} bundle} -\emph{write about it} +We added a new \pkg{latex-lab}oratory bundle in which we place new +code that is going to be available only through a +\cs{DocumentMetadata} declaration and that is\Dash most +importantly\Dash work under development and subject to +change without further notice. This means, that commands and interfaces provided there may +get altered or removed again after some public testing. The code can +be accessed through the \cs{DocumentMetadata} key \texttt{testphase}. +Currently supported values are \texttt{phase-I} and \texttt{phase-II} +that enable code of the tagged PDF project (phase-I is frozen and +phase-II the phase we are currently working on). With +\begin{verbatim} +\DocumentMetadata{testphase=phase-II} +\end{verbatim} +you currently enable tagging for paragraphs and footnotes, more +document elements will follow soon. + +For more detailed testing it is also possible to pass other values to +\texttt{testphase}, for example, the first incarnation of a template +design interface based on \pkg{l3keys} can be accessed through the +value \texttt{prototype}, thus +\begin{verbatim} +\DocumentMetadata{testphase={phase-II,prototype}} +\end{verbatim} +will enable all of phase-II plus the draft template interface (which +is not yet integrated in phase-II). + +Eventually, code will move (once considered stable) from the +testphase into the \LaTeX{} kernel itself. Tagging will continue to +require a \cs{DocumentMetadata} declaration, but you will then be able +to drop the \texttt{testphase} key setting. + \section{New or improved commands} -\subsection{A kevyal approach to option handling} +\subsection{A keyval 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 @@ -217,7 +247,7 @@ unless explicitly given as an optional argument. 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 +To support creating key options 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. @@ -315,19 +345,80 @@ layer)) which was also used in the example above. \githubissue{735} +\subsection{Testing for (nearly) empty arguments} +% +In addition to \cs{IfNoValueTF} to test if an optional argument was +provided or not, there is now also \cs{IfBlankTF}, which tests if the +argument is empty or contains only blanks. Based on the result it +selects a true or false code branch. As usual, the variants +\cs{IfBlankT} and \cs{IfBlankF} are also provided for use when only one +branch leads to some action. Further details and examples are given +in \file{usrguide3.pdf}. + +This test can also be useful if you set up key/value options and want +to test if a key was specified without giving a value or through +specifying \enquote{\textit{key}\texttt{ = ,}}. + + +\subsection{Better allocator for Lua command ids} + +In \LuaTeX\ we already had the \cs{newluafunction} macro which allocates +a Lua function identifier which can be used to define commands +with \cs{luadef}. But this always required two steps: \cs{newluafunction} +defines the passed control sequence as an integer, which then has to be used +to define the actual Lua command with \cs{luadef}. After that, the integer is +no longer needed. This was inconsistent with other allocators. Therefore we +added two new allocators \cs{newluacmd} and \cs{newexpandableluacmd} which +directly define a control sequences invoking the allocated Lua function. +The first one defines a non-expandable Lua command, the second one an expandable +one. Of course, the associated Lua function still has to be defined by assigning +a function to the \verb|lua.get_functions_table()| table. The required index is +available in \cs{allocationnumber}. + +An example could be +\begin{verbatim} +\newluacmd \greeting +\directlua { +lua.get_functions_table() + [tex.count.allocationnumber] + = function() + local name = token.scan_argument() + tex.sprint('Hello ', name, '!') + end +} -\subsection{???} +\greeting{world} +\end{verbatim} % -\githubissue{???} +\githubissue{536} + + + \section{Code improvements} +\subsection{\cs{protected} UTF-8 character definitions} +The characters defined via \file{utf8.def} are now defined as \cs{protected} +macros. This makes them safe to use in expansion contexts where the +classic \cs{protect} mechanism is not enabled, notably L3 programming +layer \texttt{e} and \texttt{x} arguments. + +Related to this change \cs{MakeUppercase} and \cs{MakeLowercase} have +been updated to use the Unicode-aware case changing functions +\cs{text\string_lowercase:n} in place of the \TeX-primitive \cs{lowercase}. +A similar change will be made in the \pkg{textcase} package. + +Note for technical reasons these low level character handling changes +will not be rolled back if the format version is rolled back using the +\pkg{latexrelease} package rollback mechanism. +% +\githubissue{780} \subsection{A small update to \cs{obeylines} and \cs{obeyspaces}} The plain \TeX{} versions of \cs{obeylines} and \cs{obeyspaces} make -\verb=^^M= and \verb*= = active and force them to execute \cs{par} +\verb=^^M= and \verb*= = active and force them to execute \cs{par} %* and \cs{space}, respectively. Don Knuth makes a remark in the \TeX{}book that one can then use a trick such as \begin{verbatim} @@ -445,7 +536,7 @@ displaying different data in the footer line on recto and verso pages. \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 +D\v Z, D\v z, d\v z, LJ, Lj, lj, NJ, Nj, nj, input as single UTF-8 code points in the range U+01C4 to U+01CC. % \githubissue{gh/723} @@ -455,7 +546,7 @@ in the range U+01C4 to U+01CC. 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 +have an explicit argument for 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 @@ -474,10 +565,6 @@ argument as their general purpose counterparts do. -\subsection{???} -% -\githubissue{???} - \section{Bug fixes} @@ -503,6 +590,21 @@ is now fixed. +\subsection{Make \cs{cite}\texttt{\textbraceleft\textbraceright} produce a warning} + +When the \cs{cite} command can't resolve a citation label it issue a +warning \enquote{Citation `\meta{label}' on page \meta{page} + undefined}. However, due to some implementation details a completely +empty argument was always silently accepted. Given that there are probably +people who write \verb=\cite{}= with the intention to fill in the +correct label later it is rather unfortunate if that is not generating +a warning that something in the document is still amiss. +This has finally been corrected and a warning is now generated also in this case. +% +\githubissue{790} + + + \section{Changes to packages in the \pkg{amsmath} category} @@ -512,7 +614,7 @@ is now fixed. The package \pkg{amsopn} used to define \cs{operator@font} but this command is already provided by the \LaTeX{} format (for at least 14 years). As a result the definition in \pkg{amsopn} is equivalent to a -reset to the kernel definition, which is unnecessary and suprising if +reset to the kernel definition, which is unnecessary and surprising if you alter the math setup (e.g., by loading a package) and at a later stage add \pkg{amsmath}, which then undoes part of your setup. For this reason the definition was taken out and @@ -528,9 +630,15 @@ after loading the package. % \githubissue{734} -\subsection{???} +\subsection{\pkg{amsmath} Error in \cs{shoveleft}} + +If \cs{shoveleft} started out with the words \enquote{plus} or +\enquote{minus} it was misunderstood as part of a rubber length and +led either to an error or was swallowed without trace. By adding a +\cs{relax} this erroneous scanning into the argument of \cs{shoveleft} +is now prevented. % -\githubissue{???} +\githubissue{714} \section{Changes to packages in the \pkg{graphics} category} @@ -576,9 +684,19 @@ This command is \emph{only} allowed in formulas. For details and further examples, see \file{mathcolor.pdf}. -\subsection{???} +\subsection{Fix locating files with \cs{graphicspath}} % -\githubissue{???} + +If a call to \cs{includegraphics} asked for a file (say, \file{image}) +without extension, and if both \file{A/image.pdf} and \file{B/image.tex} +existed (both \file{A/} and \file{B/} in \cs{graphicspath}, but neither +in a folder searched by kpse), then \file{A/image.pdf} would not be +found, and a \enquote{file not found} error would be incorrectly thrown. +The issue is now fixed and the graphics file is correctly found. +% +\githubissue{776} +\sxissue{q/630167} + |