From 0525ef25305c7f48ef158ac19f68bae09c664d60 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 8 Jun 2022 20:41:20 +0000
Subject: latex2e (8jun22)

git-svn-id: svn://tug.org/texlive/trunk@63514 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/latex/base/ltexpl.dtx | 135 ++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 3 deletions(-)

(limited to 'Master/texmf-dist/source/latex/base/ltexpl.dtx')

diff --git a/Master/texmf-dist/source/latex/base/ltexpl.dtx b/Master/texmf-dist/source/latex/base/ltexpl.dtx
index 021edc644c3..aab189bec28 100644
--- a/Master/texmf-dist/source/latex/base/ltexpl.dtx
+++ b/Master/texmf-dist/source/latex/base/ltexpl.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2019-2021
+% Copyright (C) 2019-2022
 % The LaTeX Project and any individual authors listed elsewhere
 % in this file.
 %
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltexpl.dtx}
-             [2021/04/20 v1.3c LaTeX Kernel (expl3-dependent code)]
+             [2022/02/28 v1.3f LaTeX Kernel (expl3-dependent code)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltexpl.dtx}
@@ -57,7 +57,7 @@
 %
 % \section{\pkg{expl3}-dependent code}
 %
-% \StopEventually{}
+% \MaybeStop{}
 %
 % \changes{v0.0}{2019-10-02}{Initial version}
 %
@@ -288,6 +288,14 @@
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
 %
+% Now in |latexrelease| mode, redefine a few commands to avoid ``already
+% defined'' errors.
+% \changes{v1.3f}{2022/02/28}
+%                {Move latexrelease redefinitions from ltcmd.dtx}
+%    \begin{macrocode}
+%<latexrelease>\@ifundefined{ExplSyntaxOff}{}{\latexrelease@postltexpl}
+%    \end{macrocode}
+%
 % \changes{v1.3a}{2021/01/21}
 %                {Move \pkg{xparse} rollback code to \texttt{ltcmd.dtx}}
 %
@@ -387,4 +395,125 @@
 %    \end{macrocode}
 %
 %
+%
+%
+%
+%
+% \section{Document-level command names for \pkg{expl3} functions}
+%
+%    Current home for L3 programing layer functions that we make
+%    directly available at the document level. This section may need
+%    to be moved later (after \cs{NewDocumentCommand} is defined in
+%    case we want to use that in the setup).
+%
+%
+% \DescribeMacro\fpeval
+%    The expandable command \cs{fpeval} takes as its argument a
+%    floating point expression and produces a result using the normal
+%    rules of mathematics. As this command is expandable it can be
+%    used where \TeX{} requires a number and for example within a
+%    low-level \cs{edef} operation to give a purely numerical
+%    result. See \texttt{usrguide3} for further explanation.
+%
+% \DescribeMacro\inteval
+% \DescribeMacro\dimeval
+% \DescribeMacro\skipeval
+%    The expandable command \cs{inteval} takes as its argument an
+%    integer expression and produces a result using the normal rules
+%    of mathematics. The operations recognised are |+|, |-|, |*| and
+%    |/| plus parentheses. Division occurs with \emph{rounding}, and
+%    ties are rounded away from zero. As this command is expandable it
+%    can be used where \TeX{} requires a number and for example within
+%    a low-level \cs{edef} operation to give a purely numerical
+%    result. See \texttt{usrguide3} for further explanation.
+%    \cs{dimeval} and \cs{skipeval} are similar, but generate fixed and
+%    rubber length values, respectively.
+%
+%
+%
+% \begin{macro}{\fpeval,\inteval,\dimeval,\skipeval}
+%    A document level wrapper around the code level function for
+%    floating point calculations.
+% \changes{v1.3d}{2021/11/30}{Moved over from \texttt{xfp} package (gh/711)}
+%    \begin{macrocode}
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease>                 {\fpeval}{fp and int calculations}%
+\ExplSyntaxOn
+\cs_new_eq:NN \fpeval \fp_eval:n
+%    \end{macrocode}
+%     And a few more, this time wrappers around the e\TeX{} primitives.
+%    \begin{macrocode}
+\cs_new_eq:NN \inteval \int_eval:n
+%    \end{macrocode}
+%    
+% \changes{v1.3d}{2021/12/07}{Added \cs{dimeval} and \cs{skipeval} (gh/711)}
+%    \begin{macrocode}
+\cs_new_eq:NN \dimeval  \dim_eval:n
+\cs_new_eq:NN \skipeval \skip_eval:n
+\ExplSyntaxOff
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\fpeval}{fp and int calculations}%
+%<latexrelease>
+%<latexrelease>\let\fpeval\@undefined
+%<latexrelease>\let\inteval\@undefined
+%<latexrelease>\let\dimeval\@undefined
+%<latexrelease>\let\skipeval\@undefined
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%
+%
+% \DescribeMacro\UseName
+% \DescribeMacro\ExpandArgs
+%    When declaring new commands with \cs{NewDocumentCommand} or
+%    \cs{NewCommandCopy} or similar, it is sometimes necessary to
+%    ``construct'' the csname. As a general mechanism the L3
+%    programming layer has \cs{exp\_args:N...} for this, but there is
+%    no mechanism for it  if \cs{ExplSyntaxOn} is not active. We
+%    therefore offer a few of these commands also with CamelCase names.
+%
+%
+% \begin{macro}{\UseName,\ExpandArgs}
+%    A document wrapper for changing arguments to cs names for use
+%    with \cs{NewDocumentCommand} and similar functions.
+%
+% \changes{v1.3d}{2021/12/28}{Added document level names for \cs{exp\_args:Nc} and the like (gh/735)}
+% \changes{v1.3e}{2022/01/06}{Adjust document level names for \cs{exp\_args:Nc} and the like (gh/735)}
+%    \begin{macrocode}
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease>                 {\ExpandArgs}{Some pre-expansion commands}%
+\ExplSyntaxOn
+\cs_new_eq:NN \UseName \use:c
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_new:Npn \ExpandArgs #1
+  {
+    \cs_if_exist_use:cF { exp_args:N #1 }
+      { \msg_expandable_error:nnn { kernel } { unknown-arg-expansion } {#1} }
+  }
+\msg_new:nnn { kernel } { unknown-arg-expansion }
+  { Unknown~arg~expansion~"#1" }
+\ExplSyntaxOff
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\ExpandArgs}{Some pre-expansion commands}%
+%<latexrelease>
+%<latexrelease>\let\UseName\@undefined
+%<latexrelease>\let\ExpandArgs\@undefined
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%
 % \Finale
-- 
cgit v1.2.3

