From eab51b6e0192b6b8bc0fd7d3767efe72c4982b3f Mon Sep 17 00:00:00 2001 From: Frank Mittelbach Date: Tue, 29 Oct 2024 21:37:50 +0100 Subject: [PATCH] extra docu on \RemoveFromHook --- base/lthooks.dtx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/base/lthooks.dtx b/base/lthooks.dtx index abf3a9a49..0c33c022e 100644 --- a/base/lthooks.dtx +++ b/base/lthooks.dtx @@ -405,11 +405,17 @@ % Removes any code labeled by \meta{label} from the \meta{hook}. % When the optional argument \meta{label} is not provided, the % \meta{default label} is used (see section~\ref{sec:default-label}). +% \end{function} % % If there is no code under the \meta{label} in the \meta{hook}, % or if the \meta{hook} does not exist, a warning is issued when % you attempt to \cs{RemoveFromHook}, and the command is ignored. -% \cs{RemoveFromHook} should be used only when you know exactly what +% \cs{RemoveFromHook}\marginpar{\raggedleft\rightskip5pt\itshape +% \textbf{Important:}\break The \cs{RemoveFromHook} command should be +% only used if one has full control over the code chunk to be removed. +% In particular it should not be used to remove code chunks from other +% packages! For this the \texttt{voids} relation is provided.} +% should be used only when you know exactly what % labels are in a hook. Typically this will be when some code gets added to a hook % by a package, then later this code is removed by that same package. % If you want to prevent the execution of code from another @@ -423,16 +429,15 @@ % The \meta{hook} and \meta{label} can be specified using the % dot-syntax to denote the current package name. % See section~\ref{sec:default-label}. -% \end{function} -% -% \medskip % -% In contrast to the \texttt{voids} relationship between two labels +% In contrast to the \texttt {voids} relationship between two labels % in a \cs{DeclareHookRule} this is a destructive operation as the % labeled code is removed from the hook data structure, whereas the % relationship setting can be undone by providing a different % relationship later. % +% \medskip +% % A useful application for this declaration inside the document body % is when one wants to temporarily add code to hooks and later remove % it again, e.g., @@ -538,7 +543,6 @@ % % % -% % \subsubsection{Hook names and default labels} % \label{sec:default-label} %