Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving an Example in lthooks-doc Documentation #1599

Open
Sophanatprime opened this issue Dec 31, 2024 · 1 comment
Open

Improving an Example in lthooks-doc Documentation #1599

Sophanatprime opened this issue Dec 31, 2024 · 1 comment
Assignees
Labels
bug (documentation) category base (latex) fixed in dev Fixed in development branch, not in stable release

Comments

@Sophanatprime
Copy link

I would like to report a potential improvement in the lthooks-doc documentation. The following example is currently included in the documentation:

\AddToHook{env/quote/before}{\small}
\begin{quote}
  A quote set in a smaller typeface
\end{quote}
...
\RemoveFromHook{env/quote/before}
... now back to normal for further quotes

the source code

latex2e/base/lthooks.dtx

Lines 441 to 452 in 5dbc00a

% 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.,
%\begin{verbatim}
% \AddToHook{env/quote/before}{\small}
% \begin{quote}
% A quote set in a smaller typeface
% \end{quote}
% ...
% \RemoveFromHook{env/quote/before}
% ... now back to normal for further quotes
%\end{verbatim}

The issue arises when users employ the above code. Even after using \RemoveFromHook to remove \small, subsequent text would remain in a smaller typeface. This can be confusing because env/quote/before is not limited to the quote environment but rather affects the global scope in this example. Users who are unaware of this behavior or have not yet read section 3.1.1 might mistakenly believe that \RemoveFromHook is not functioning correctly.

It would be beneficial to clarify this behavior in the documentation to prevent misunderstandings, or change env/quote/before to env/quote/begin.

@FrankMittelbach
Copy link
Member

that's a clear documentation bug, thanks for pointing it out -- all the best for 2025

muzimuzhi added a commit to muzimuzhi/latex2e that referenced this issue Dec 31, 2024
FrankMittelbach added a commit that referenced this issue Jan 3, 2025
@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Jan 3, 2025
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to Done in dev in upcoming LaTeX2e releases Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (documentation) category base (latex) fixed in dev Fixed in development branch, not in stable release
Projects
Status: Done in dev
Development

No branches or pull requests

2 participants