[latex3-commits] [git/LaTeX3-latex3-latex2e] gh963: Allow robust commands as environments (aa24bde5)

PhelypeOleinik phelype.oleinik at latex-project.org
Tue Nov 29 04:45:31 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : gh963
Link       : https://github.com/latex3/latex2e/commit/aa24bde5851d535085d173e8a45ee09ce580f5d4

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

commit aa24bde5851d535085d173e8a45ee09ce580f5d4
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Tue Nov 29 00:45:31 2022 -0300

    Allow robust commands as environments
    
    e.g.: \begin{bfseries}


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

aa24bde5851d535085d173e8a45ee09ce580f5d4
 base/ltdefns.dtx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index 9062b09a..c66346c9 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -1836,7 +1836,8 @@
 %   \cs{newcommand} with optional arguments.
 %    \begin{macrocode}
 \def\@showenvironmentlisthook{%
-  {\@if at newcommand \@show at environment@opt}}
+  {\@if at DeclareRobustCommand \@show at DeclareRobustCommand@env}%
+  {\@if at newcommand \@show at newcommand@env}}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1846,13 +1847,19 @@
 %   Same as before, it is initialized to cope with \cs{DeclareRobustCommand} and
 %   \cs{newcommand} with optional arguments.
 %    \begin{macrocode}
-\long\def\@show at environment@opt#1{%
+\long\def\@show at newcommand@env#1{%
   \typeout{> \string\begin{\@expl at cs@to at str@@N#1}=environment:}%
   \typeout{->\@expl at cs@replacement at spec@@N#1.^^J}%
   \expandafter\@show at newcommand@aux
     \csname\@backslashchar\@expl at cs@to at str@@N#1\expandafter\endcsname
     \expandafter{#1}%
   \@show at environment@end#1}
+\long\def\@show at DeclareRobustCommand@env#1{%
+  \typeout{> \string\begin{\@expl at cs@to at str@@N#1}=environment:}%
+  \typeout{->\@expl at cs@replacement at spec@@N#1.^^J}%
+  \expandafter\show at kernel@robust at command
+    \csname\@expl at cs@to at str@@N#1 \endcsname
+  \@show at environment@end#1}
 \long\def\@show at environment@end#1{%
   \expandafter\@show at normalenv@meaning
     \csname end\@expl at cs@to at str@@N#1\endcsname





More information about the latex3-commits mailing list.