[latex3-commits] [git/LaTeX3-latex3-latex2e] ProvideHook: docu updates by Ulrike (114e1d73)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Apr 30 12:45:26 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : ProvideHook
Link       : https://github.com/latex3/latex2e/commit/114e1d7317a05f514e2a9990c45448eedafc57dc

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

commit 114e1d7317a05f514e2a9990c45448eedafc57dc
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Apr 30 12:45:26 2021 +0200

    docu updates by Ulrike


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

114e1d7317a05f514e2a9990c45448eedafc57dc
 base/ltcmdhooks.dtx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/base/ltcmdhooks.dtx b/base/ltcmdhooks.dtx
index 294dd611..aee180d2 100644
--- a/base/ltcmdhooks.dtx
+++ b/base/ltcmdhooks.dtx
@@ -14,7 +14,7 @@
 %%% From File: ltcmdhooks.dtx
 %
 \def\ltcmdhooksversion{v1.0a}
-\def\ltcmdhooksdate{2021/04/19}
+\def\ltcmdhooksdate{2021/04/30}
 %
 %
 %
@@ -168,10 +168,16 @@
 % At |\begin{document}| all the delayed patches will be executed, and if
 % the command doesn't exist the code is still added to the hook, but it
 % will not be executed.  After |\begin{document}|, when \cs{AddToHook}
-% is called with a generic |cmd| hook, the command will be immediately
+% is called with a generic |cmd| hook the first time, the command will be immediately 
 % patched to include the hook, and if it doesn't exist or if it can't be
-% patched for any reason, an error is thrown.
+% patched for any reason, an error is thrown; if \cs{AddToHook} was already
+% used in the preamble no new patching is attempted.
 %
+% This has the consequence that commands defined or redefined after   
+% |\begin{document}| only use generic |cmd| hook code if
+% \cs{AddToHook} is called the first time after their definition, or if
+% they explicitly use the generic hook code in their definition
+% by calling \cs{UseHook} as part of their code.
 %
 %
 % \subsection{Commands that look ahead}
@@ -220,7 +226,7 @@
 %    \AddToHook{cmd/fancybox/after}{<code>}
 % \end{verbatim}
 % and then use the \cs[no-index]{fancybox} command you will see that it
-% will be completely broken bcause the hook will get executed in the
+% will be completely broken, because the hook will get executed in the
 % middle of parsing for optional \texttt{(...)} argument.
 %
 % If, on the other hand, you want to add hooks to your command you can





More information about the latex3-commits mailing list.