[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Pre-load xparse if expl3 doesn't provide \NewDocumentCommand (f8ca17bd)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Mar 5 23:07:25 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/f8ca17bdaf1d1e2d24574627a7f3982f1c96030c

>---------------------------------------------------------------

commit f8ca17bdaf1d1e2d24574627a7f3982f1c96030c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Mar 5 22:03:44 2020 +0000

    Pre-load xparse if expl3 doesn't provide \NewDocumentCommand
    
    This uses a specific .ltx file to do the work.


>---------------------------------------------------------------

f8ca17bdaf1d1e2d24574627a7f3982f1c96030c
 base/changes.txt |  4 ++++
 base/ltexpl.dtx  | 19 +++++++++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 89757269..1841a18c 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,10 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2020-03-05  Joseph Wright <joseph.wright at morningstar2.co.uk>
+
+    * ltexpl.dtx: Pre-load xparse where expl3 does not define \NewDocumentCommand
+
 2020-03-02  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltfssini.dtx (section{Custom series settings for main document families}):
diff --git a/base/ltexpl.dtx b/base/ltexpl.dtx
index 754459ed..e86b80ac 100644
--- a/base/ltexpl.dtx
+++ b/base/ltexpl.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltexpl.dtx}
-             [2020-03-02 v1.0b LaTeX Kernel (expl3-dependent code)]
+             [2020-03-05 v1.1 LaTeX Kernel (expl3-dependent code)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltfinal.dtx}
@@ -74,6 +74,8 @@
 %    refined version!
 % \changes{v1.0a}{2020/03/02}
 %         {Don't load expl3 if already in the format (gh/295)}
+% \changes{v1.1}{2020/03/05}
+%         {Load xparse.ltx if \cs{NewDocumentCommand} is not defined by expl3.ltx}
 %    \begin{macrocode}
 \expandafter\ifx\csname tex\string _let:D\endcsname\relax
   \IfFileExists{expl3.ltx}
@@ -83,18 +85,27 @@
         \ifdefined\filesize 1\fi
         \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi
         >0 %
+        \expandafter\@firstofone
       \else
         \message{Skipping expl3-dependent extensions}
 %<2ekernel>      \expandafter\endinput
-%<latexrelease>      \expandafter\@gobbletwo
+%<latexrelease>      \expandafter\@gobble
       \fi
     }
     {%
       \message{Skipping expl3-dependent extensions}%
 %<2ekernel>    \endinput
-%<latexrelease>    \@gobbletwo
+%<latexrelease>    \@gobble
+    }%
+    {%
+      \input{expl3.ltx}
+      \ifdefined\NewDocumentCommand
+      \else
+        \IfFileExists{xparse.ltx}
+          {\input{xparse.ltx}}
+          {}%
+       \fi
     }%
-  \input{expl3.ltx}
 \else
   \GenericInfo{}{Skipping: expl3 code already part of the format}
 \fi





More information about the latex3-commits mailing list.