[latex3-commits] [git/LaTeX3-latex3-latex2e] gh569: Docs (b002bf3e)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Aug 30 05:35:25 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh569
Link       : https://github.com/latex3/latex2e/commit/b002bf3ea9475ce07abe26cadf6321ef19eb0e3d

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

commit b002bf3ea9475ce07abe26cadf6321ef19eb0e3d
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon Aug 30 00:35:25 2021 -0300

    Docs


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

b002bf3ea9475ce07abe26cadf6321ef19eb0e3d
 base/ltcmd.dtx | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 2d120fbf..3261cade 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -2202,6 +2202,10 @@
 %
 % \begin{macro}{\@@_copy_environment:nnNN}
 % \begin{macro}{\@@_copy_environment:Nnnnnnn}
+%   Copying an environment's \cs{begin} part is pretty much like copying
+%   a command, except it has a longer name, and at the end we have to
+%   copy \cs[no-index]{environment~\meta{name}} into
+%   \cs[no-index]{\meta{name}}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_copy_environment:nnNN #1 #2 #3 #4
   {
@@ -2214,6 +2218,19 @@
   }
 \cs_new:Npn \@@_copy_environment:Nnnnnnn #1 #2 #3 #4 #5 #6 #7
   { #1 \exp_not:n { {#2} } {#7} \exp_not:n { {#4} {#5} {#6} } }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_copy_environment_end:nnNN}
+% \begin{macro}{\@@_copy_environment_end_aux:nnNN}
+%   Copying an environment's \cs{end} part is a bit trickier.  We first
+%   have to make sure that both parts are named
+%   \cs[no-index]{end\meta{name}} (that's actually not a hard
+%   requirement, but an environment \cs{end} command makes no sense
+%   without the |end| in its name), and strip the leading |end| from the
+%   strings.  After that, copying is straightforward.
+%    \begin{macrocode}
 \cs_new_protected:Npn \@@_copy_environment_end:nnNN #1 #2
   {
     \@@_check_end:Nn \l_@@_tmpa_tl {#1}
@@ -2229,6 +2246,13 @@
       { environment~ #1 ~end~aux~ } { environment~ #2 ~end~aux~ }
     \cs_set_eq:cc { end #1 } { environment~ #1 ~end }
   }
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_check_end:Nn,\@@_check_end:n,\@@_check_end:w}
+%   To check whether an \cs{end} command is valid, we look for the
+%   string |end| at the beginning of the command name, and if not found,
+%   raise an error:
+%    \begin{macrocode}
 \cs_new_protected:Npn \@@_check_end:Nn #1 #2
   {
     \tl_set:Nx #1 { \@@_check_end:n {#2} }
@@ -2249,6 +2273,7 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % Not much to do regarding \pkg{latexrelease}: we could remove the
 % entries from \cs{@declarecommandcopylisthook}, but it doesn't seem





More information about the latex3-commits mailing list.