[latex3-commits] [git/LaTeX3-latex3-latex2e] robustness: Make \begin and \end robust (without breaking tabular like environments) (58ad19dc)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Aug 29 15:19:33 CEST 2019


Repository : https://github.com/latex3/latex2e
On branch  : robustness
Link       : https://github.com/latex3/latex2e/commit/58ad19dcf3dddf86cab4f15f7eec7f6a2cb960ca

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

commit 58ad19dcf3dddf86cab4f15f7eec7f6a2cb960ca
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Aug 29 15:19:33 2019 +0200

    Make \begin and \end robust (without breaking tabular like environments)


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

58ad19dcf3dddf86cab4f15f7eec7f6a2cb960ca
 base/changes.txt                                   |   5 +
 base/doc/ltnews30.tex                              |  19 ++--
 base/ltdefns.dtx                                   |  29 ++---
 base/ltmiscen.dtx                                  | 119 ++++++++++++++++++++-
 base/testfiles/github-robust-0123.luatex.tlg       |   4 +
 base/testfiles/github-robust-0123.lvt              |   4 +-
 base/testfiles/github-robust-0123.tlg              |   4 +
 base/testfiles/github-robust-0123.xetex.tlg        |   4 +
 base/testfiles/tltc001.luatex.tlg                  |  18 ++--
 base/testfiles/tltc001.tlg                         |  18 ++--
 base/testfiles/tltc001.xetex.tlg                   |  18 ++--
 .../amsmath/testfiles/github-amsrobust-0123.tlg    |   2 +-
 12 files changed, 191 insertions(+), 53 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 9d8a2a83..2d4c18fb 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2019-08-29  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltmiscen.dtx (subsection{Environments}):
+	Make \begin/\end robust
+
 2019-08-27  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* lttab.dtx:	Make various commands robust
diff --git a/base/doc/ltnews30.tex b/base/doc/ltnews30.tex
index 748806cf..f082b944 100644
--- a/base/doc/ltnews30.tex
+++ b/base/doc/ltnews30.tex
@@ -173,7 +173,7 @@ A related change is that file names used as part of \cs{input},  \cs{includegrap
 
 
 
-\section{Making more user commands made robust}
+\section{Making more user commands robust}
 
 In the early days of \LaTeX{} many commands were fragile, i.e., they
 needed \cs{protect} in front of them when used in places such as
@@ -185,16 +185,23 @@ once, except for a few that for one or the other reasons need to
 always expand (at least partially) or where it rather unlikely that
 they are ever needed in a so-called \enquote{moving argument}.
 
+Doing this for \cs{begin} and \cs{end} was rather tricky as the
+standard mechanism with \cs{DeclareRobustCommand} doesn't work here,
+at least not for \cs{end} as that needs to expand during typesetting
+without generating a \cs{relax} (from the \cs{protect}. Such a token
+would start a new row in table environments, such as \texttt{tabular}
+etc. Furthermore some packages try to look into the definition of
+\cs{end} by expanding it several times. Thus expansion with
+\cs{expandafter} had to produce exactly the same result as before. But
+in the end we overcame that hurdle too, so now environments are
+automatically robust if used in places like headings or
+\verb=\typeout= and so forth.
+
 What hasn't been tackled yet is \pkg{amsmath}. As this package
 redefines a number of basic math construct they become fragile again
 once the package is loaded. This area will be addressed in a follow up
 release.
 
-Also still fragile are \verb=\begin= and \verb=\end= as there are
-several packages that explicitly try to look ahead into the code
-executed by \verb=\end= and making it robust would result in severe
-failures.  Because of this it is currently unclear whether or not
-these commands can be altered eventually.
 
 \githubissue{123}
 
diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index a8c61fbc..4c58c019 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -1046,7 +1046,7 @@
 %
 %    \emph{Note}: setting |\protect| to any value other than |\relax|
 %    whilst in `typesetting' mode will cause commands to go into an
-%    infinite loop!  In particular, setting |\relax| to |\@empty| will
+%    infinite loop!  In particular, setting |\protect| to |\@empty| will
 %    cause |\_| to loop forever.  It will also break lots of other
 %    things, such as protected |\ifmmode|s inside |\halign|s.  If you
 %    really really have to do such a thing, then please set
@@ -1101,7 +1101,9 @@
 % \end{macro}
 %
 % \begin{macro}{\@typeset at protect}
-%
+%     We set \cs{@typeset at protect} to \cs{relax} rather than \cs{@empty}
+%     to make sure that the protection mechanism stops the look-ahead
+%     and expansion performed at the start of \cs{halign} cells.
 %    \begin{macrocode}
 \let\@typeset at protect\relax
 %    \end{macrocode}
@@ -1251,11 +1253,10 @@
 %    Only for compatibility reasons if \texttt{latexrelease} requests
 %    a rollback of the kernel. For this reason we pretend that this
 %    command existed in all earler versions of \LaTeX{} i.e., we are
-%    not rolling it back since we need it precisely then (but as it
-%    isn't yet used it is still commented out).
+%    not rolling it back since we need it precisely then.
 %    \begin{macrocode}
-%\def\kernel at make@fragile#1{%
-%  \@ifundefined{\expandafter\@gobble\string#1\space}%
+\def\kernel at make@fragile#1{%
+  \@ifundefined{\expandafter\@gobble\string#1\space}%
 %    \end{macrocode}
 %    If not robust do nothing.
 %    \begin{macrocode}
@@ -1264,16 +1265,18 @@
 %    Otherwise copy \verb*=\foo = back to \verb=\foo= and then undefine
 %    the payload command.
 %    \begin{macrocode}
-%     {%
-%      \global\expandafter\let\expandafter #1\csname
-%      \expandafter\@gobble\string#1\space\endcsname
-%      \global\expandafter\let\csname
-%      \expandafter\@gobble\string#1\space\endcsname\@undefined
-%     }%            
-%}
+     {%
+      \global\expandafter\let\expandafter #1\csname
+      \expandafter\@gobble\string#1\space\endcsname
+      \global\expandafter\let\csname
+      \expandafter\@gobble\string#1\space\endcsname\@undefined
+     }%            
+}
 %    \end{macrocode}
 %  \end{macro}
 %
+%
+%
 % \subsection{Internal defining commands}
 %
 % These commands are used internally to define other \LaTeX{}
diff --git a/base/ltmiscen.dtx b/base/ltmiscen.dtx
index 4893ba2b..4b8853f4 100644
--- a/base/ltmiscen.dtx
+++ b/base/ltmiscen.dtx
@@ -32,7 +32,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltmiscen.dtx}
-             [2019/08/27 v1.1p LaTeX Kernel (Misc. Environments)]
+             [2019/08/29 v1.1p LaTeX Kernel (Misc. Environments)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltmiscen.dtx}
@@ -506,8 +506,13 @@
 %      remember line number. Used by \cs{@badend} to display
 %      position of non-matching \cs{begin}.}
 % \changes{v1.1e}{1996/07/26}{remove \cs{global} before \cs{@ignore...}}
+% \changes{v1.1p}{2019/08/27}{Make command robust}
 %    \begin{macrocode}
-\def\begin#1{%
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease>                 {\begin}{Making \begin/\end robust}%
+\DeclareRobustCommand\begin[1]{%
   \@ifundefined{#1}%
     {\def\reserved at a{\@latex at error{Environment #1 undefined}\@eha}}%
     {\def\reserved at a{\def\@currenvir{#1}%
@@ -516,17 +521,123 @@
   \@ignorefalse
   \begingroup\@endpefalse\reserved at a}
 %    \end{macrocode}
-%  \end{macro}
+%    A version that doesn't start out with \cs{relax} when in
+%    typesetting mode would be the following, but since \cs{begin}
+%    issues a \cs{begingroup} it wouldn't help much with respect to
+%    allowing things like \cs{noalign} or \cs{multicolumn} inside.
+%    \begin{macrocode}
+%\edef\begin
+%  {\unexpanded{%
+%       \ifx\protect\@typeset at protect
+%         \expandafter\@gobble
+%       \fi
+%       \protect
+%     }%
+%   \expandafter\noexpand\csname begin \endcsname
+%  }
+%\@namedef{begin }#1{%
+%  \@ifundefined{#1}%
+%    {\def\reserved at a{\@latex at error{Environment #1 undefined}\@eha}}%
+%    {\def\reserved at a{\def\@currenvir{#1}%
+%     \edef\@currenvline{\on at line}%
+%     \csname #1\endcsname}}%
+%  \@ignorefalse
+%  \begingroup\@endpefalse\reserved at a}
+%    \end{macrocode}
 %
 %  \begin{macro}{\end}
+%    While \cs{begin} was made robust simply by using
+%    \cs{DeclareRobustCommand} we need to be a bit more subtle with
+%    \cs{end} as there are packages out there that try to look into
+%    the top-level contents of \verb=\end{foo}= (that is at the expansion
+%    of \verb=\endfoo=) to see if it contains certain macros. This is
+%    done by hitting \verb=\end{foo}=  with three \cs{expandafter}s,
+%    the first to get
+%\begin{verbatim}
+%  \csname endfoo\endcsname       \@checkend{foo}% etc.
+%\end{verbatim}
+%    the second to expand the \cs{csname}, i.e., to get to
+%\begin{verbatim}
+%  \endfoo                        \@checkend{foo}% etc.
+%\end{verbatim}
+%    and the third to finally get to the top-level content of
+%    \verb=\endfoo=, i.e.
+%\begin{verbatim}
+%  <top-level content of \endfoo> \@checkend{foo}% etc.
+%\end{verbatim}
+%    Therefore a robust replacement should produce the same results
+%    after three expansions (there first is obviously different).
+%
+%    Basically the definition of \cs{end} should either produce
+%    \verb*=\protect\end = (when not doing typesetting) or it should
+%    produce \verb*=\end = (without the \cs{protect}) when doing typesetting.
+%    Furthermore, it should (when in typesetting mode) show exactly the
+%    same result as
+%    \verb*=\end = (which is the original fragile definition
+%    of \cs{end}) when you expand either of them twice, i.e.,
+%\begin{verbatim}
+%  \endfoo                        \@checkend{foo}% etc.
+%\end{verbatim}
+%    That is achieved with the code below (which is worth studying
+%    carefully).
+%
+%    There is some trickery involved here: in particular we use
+%    \cs{romannumeral} to change a single expansion into three
+%    successive expansions in one go. That primitive expands until it
+%    has scanned a number (0 in this case, so it doesn't produce any
+%    output) and so it allows us to place arbitrary many
+%    \cs{expandafter}s inside that are all going to be executed when
+%    \cs{romannumeral} is hit by a single \cs{expandafter}.
+%
 % \changes{v1.1e}{1996/07/26}{remove \cs{global} before \cs{@ignore...}}
+% \changes{v1.1p}{2019/08/27}{Make command robust}
+%
+%    \begin{macrocode}
+\edef\end
+  {\unexpanded{%
+     \romannumeral
+       \ifx\protect\@typeset at protect
+       \expandafter       %1
+         \expandafter        %2
+       \expandafter       %1
+           \expandafter         %3 expands the \csname inside \end<space>
+       \expandafter       %1
+         \expandafter        %2  expands \end<space>
+       \expandafter       %1     expands the \else
+           \z@
+       \else
+         \expandafter\z@\expandafter\protect
+       \fi
+   }%
+   \expandafter\noexpand\csname end \endcsname
+  }
+%    \end{macrocode}
+%    And here is the original definition of \cs{end} the way it was in
+%    \LaTeX{} for several decades now hidden in \verb*=\end =.
 %    \begin{macrocode}
-\def\end#1{%
+\@namedef{end }#1{%
   \csname end#1\endcsname\@checkend{#1}%
   \expandafter\endgroup\if at endpe\@doendpe\fi
   \if at ignore\@ignorefalse\ignorespaces\fi}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%    An here the rollback in case that is ever needed.
+%    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\begin}{Making \begin/\end robust}%
+%<latexrelease>\kernel at make@fragile\begin
+%<latexrelease>\kernel at make@fragile\end
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
 %    \end{macrocode}
 %  \end{macro}
+%  \end{macro}
+%
+%
+%
+%
 %
 %  \begin{macro}{\@checkend}
 %    \begin{macrocode}
diff --git a/base/testfiles/github-robust-0123.luatex.tlg b/base/testfiles/github-robust-0123.luatex.tlg
index 8e103cfb..064c78bf 100644
--- a/base/testfiles/github-robust-0123.luatex.tlg
+++ b/base/testfiles/github-robust-0123.luatex.tlg
@@ -6,6 +6,10 @@ LaTeX Font Info:    Redeclaring math delimiter \Downarrow on input line ....
 <recently read> \Downarrow  
 l. ......dafter\show\csname Downarrow\space\endcsname
 ---------------------------------------
+\begin{foo} -> \begin {foo}
+---------------------------------------
+\end{foo} -> \end {foo}
+---------------------------------------
 ====================================
  Not worth making robust ...
 ====================================
diff --git a/base/testfiles/github-robust-0123.lvt b/base/testfiles/github-robust-0123.lvt
index 05492687..b533e4dd 100644
--- a/base/testfiles/github-robust-0123.lvt
+++ b/base/testfiles/github-robust-0123.lvt
@@ -49,7 +49,6 @@
 %%\test{\counterwithout{section}{footnote}}     -- breaks badly
 %%\test{\displaylines{foo}}     -- breaks badly
 %%\test{\else}     -- breaks badly
-%%\test{\end{foo}}     -- breaks badly
 %%\test{\enlargethispage{5pt}}     -- breaks badly
 %%\test{\enumerate}     -- breaks badly
 %%\test{\eqnarray}        -- breaks badly
@@ -111,7 +110,8 @@
 % now ok ...
 
 
-%\test{\begin{foo}}          % breaks really really badly
+\test{\begin{foo}}          % breaks really really badly
+\test{\end{foo}}     -- breaks badly
 
 
 
diff --git a/base/testfiles/github-robust-0123.tlg b/base/testfiles/github-robust-0123.tlg
index 93237f9f..fe521782 100644
--- a/base/testfiles/github-robust-0123.tlg
+++ b/base/testfiles/github-robust-0123.tlg
@@ -6,6 +6,10 @@ LaTeX Font Info:    Redeclaring math delimiter \Downarrow on input line ....
 <recently read> \Downarrow  
 l. ......fter\show\csname Downarrow\space\endcsname
 ---------------------------------------
+\begin{foo} -> \begin {foo}
+---------------------------------------
+\end{foo} -> \end {foo}
+---------------------------------------
 ====================================
  Not worth making robust ...
 ====================================
diff --git a/base/testfiles/github-robust-0123.xetex.tlg b/base/testfiles/github-robust-0123.xetex.tlg
index 9353e387..de1c3b3c 100644
--- a/base/testfiles/github-robust-0123.xetex.tlg
+++ b/base/testfiles/github-robust-0123.xetex.tlg
@@ -6,6 +6,10 @@ LaTeX Font Info:    Redeclaring math delimiter \Downarrow on input line ....
 <recently read> \Downarrow  
 l. ......fter\show\csname Downarrow\space\endcsname
 ---------------------------------------
+\begin{foo} -> \begin {foo}
+---------------------------------------
+\end{foo} -> \end {foo}
+---------------------------------------
 ====================================
  Not worth making robust ...
 ====================================
diff --git a/base/testfiles/tltc001.luatex.tlg b/base/testfiles/tltc001.luatex.tlg
index c4709d60..a48e1a43 100644
--- a/base/testfiles/tltc001.luatex.tlg
+++ b/base/testfiles/tltc001.luatex.tlg
@@ -128,8 +128,8 @@ Type  H <return>  for immediate help.
                                                   \endgroup 
 \@checkend ...ed at a \@currenvir \else \@badend {#1}
                                                   \fi 
-\end #1->\csname end#1\endcsname \@checkend {#1}
-                                                \expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname \@checkend {#1}
+                                                 \expandafter \endgroup \if at ...
 l. ...\end{foo}
 Your command was ignored.
 Type  I <command> <return>  to replace it with another command,
@@ -1388,8 +1388,8 @@ Type  H <return>  for immediate help.
                                                   \fi 
 \endtrivlist ... \@inmatherr {\end {\@currenvir }}
                                                   \fi \if at noparlist \else \i...
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1405,8 +1405,8 @@ Type  H <return>  for immediate help.
                                           \addvspace \@topsepadd \@endpetrue 
 \endtrivlist ...vskip \@tempskipa \fi \@endparenv 
                                                   \fi 
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1422,8 +1422,8 @@ Type  H <return>  for immediate help.
                                                   \@endpetrue 
 \endtrivlist ...vskip \@tempskipa \fi \@endparenv 
                                                   \fi 
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1432,7 +1432,7 @@ If that doesn't work, type  X <return>  to quit.
 $
 <to be read again> 
 \endgroup 
-\end ...kend {#1}\expandafter \endgroup \if at endpe 
+\end  ...end {#1}\expandafter \endgroup \if at endpe 
                                                   \@doendpe \fi \if at ignore \...
 l. ...\end{itemize}
 I've inserted something that you may have forgotten.
diff --git a/base/testfiles/tltc001.tlg b/base/testfiles/tltc001.tlg
index db026a88..146cf35f 100644
--- a/base/testfiles/tltc001.tlg
+++ b/base/testfiles/tltc001.tlg
@@ -128,8 +128,8 @@ Type  H <return>  for immediate help.
                                                   \endgroup 
 \@checkend ...ed at a \@currenvir \else \@badend {#1}
                                                   \fi 
-\end #1->\csname end#1\endcsname \@checkend {#1}
-                                                \expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname \@checkend {#1}
+                                                 \expandafter \endgroup \if at ...
 l. ...\end{foo}
 Your command was ignored.
 Type  I <command> <return>  to replace it with another command,
@@ -1205,8 +1205,8 @@ Type  H <return>  for immediate help.
                                                   \fi 
 \endtrivlist ... \@inmatherr {\end {\@currenvir }}
                                                   \fi \if at noparlist \else \i...
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1222,8 +1222,8 @@ Type  H <return>  for immediate help.
                                           \addvspace \@topsepadd \@endpetrue 
 \endtrivlist ...vskip \@tempskipa \fi \@endparenv 
                                                   \fi 
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1239,8 +1239,8 @@ Type  H <return>  for immediate help.
                                                   \@endpetrue 
 \endtrivlist ...vskip \@tempskipa \fi \@endparenv 
                                                   \fi 
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1249,7 +1249,7 @@ If that doesn't work, type  X <return>  to quit.
                 $
 <to be read again> 
                    \endgroup 
-\end ...kend {#1}\expandafter \endgroup \if at endpe 
+\end  ...end {#1}\expandafter \endgroup \if at endpe 
                                                   \@doendpe \fi \if at ignore \...
 l. ...\end{itemize}
 I've inserted something that you may have forgotten.
diff --git a/base/testfiles/tltc001.xetex.tlg b/base/testfiles/tltc001.xetex.tlg
index db026a88..146cf35f 100644
--- a/base/testfiles/tltc001.xetex.tlg
+++ b/base/testfiles/tltc001.xetex.tlg
@@ -128,8 +128,8 @@ Type  H <return>  for immediate help.
                                                   \endgroup 
 \@checkend ...ed at a \@currenvir \else \@badend {#1}
                                                   \fi 
-\end #1->\csname end#1\endcsname \@checkend {#1}
-                                                \expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname \@checkend {#1}
+                                                 \expandafter \endgroup \if at ...
 l. ...\end{foo}
 Your command was ignored.
 Type  I <command> <return>  to replace it with another command,
@@ -1205,8 +1205,8 @@ Type  H <return>  for immediate help.
                                                   \fi 
 \endtrivlist ... \@inmatherr {\end {\@currenvir }}
                                                   \fi \if at noparlist \else \i...
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1222,8 +1222,8 @@ Type  H <return>  for immediate help.
                                           \addvspace \@topsepadd \@endpetrue 
 \endtrivlist ...vskip \@tempskipa \fi \@endparenv 
                                                   \fi 
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1239,8 +1239,8 @@ Type  H <return>  for immediate help.
                                                   \@endpetrue 
 \endtrivlist ...vskip \@tempskipa \fi \@endparenv 
                                                   \fi 
-\end #1->\csname end#1\endcsname 
-                                 \@checkend {#1}\expandafter \endgroup \if at e...
+\end  #1->\csname end#1\endcsname 
+                                  \@checkend {#1}\expandafter \endgroup \if at ...
 l. ...\end{itemize}
 Try typing  <return>  to proceed.
 If that doesn't work, type  X <return>  to quit.
@@ -1249,7 +1249,7 @@ If that doesn't work, type  X <return>  to quit.
                 $
 <to be read again> 
                    \endgroup 
-\end ...kend {#1}\expandafter \endgroup \if at endpe 
+\end  ...end {#1}\expandafter \endgroup \if at endpe 
                                                   \@doendpe \fi \if at ignore \...
 l. ...\end{itemize}
 I've inserted something that you may have forgotten.
diff --git a/required/amsmath/testfiles/github-amsrobust-0123.tlg b/required/amsmath/testfiles/github-amsrobust-0123.tlg
index 45029d67..f59c6adb 100644
--- a/required/amsmath/testfiles/github-amsrobust-0123.tlg
+++ b/required/amsmath/testfiles/github-amsrobust-0123.tlg
@@ -284,7 +284,7 @@ Don't change this file in any respect.
 ---------------------------------------
 \egroup -> \egroup {foo}{bar}{baz}
 ---------------------------------------
-\end -> \endfoo \def \def document{document}\edef { on input line ...}\GenericError {               }{LaTeX Error: Can be used only in preamble}{See the LaTeX manual or LaTeX Companion for explanation.}{Your command was ignored.\MessageBreak Type  I <command> <return>  to replace it with another command,\MessageBreak or  <return>  to continue without it.}{foo}\GenericError {               }{LaTeX Error: \begin{document} ended by \end{foo}}{See the LaTeX manual or LaTeX Companion for explanation.}{Your command was ignored.\MessageBreak Type  I <command> <return>  to replace it with another command,\MessageBreak or  <return>  to continue without it.}\endgroup {bar}{baz}
+\end -> \end {foo}{bar}{baz}
 ---------------------------------------
 \eqref -> \textup {\hbox {\mathsurround \z@ \normalfont (\ignorespaces \G at refundefinedtrue\text {\normalfont \bfseries ??}\GenericWarning {               }{LaTeX Warning: Reference `foo' on page 1 undefined}\unskip \@@italiccorr )}}{bar}{baz}
 ---------------------------------------





More information about the latex3-commits mailing list