Skip to content

Commit

Permalink
fix for #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Nov 16, 2023
1 parent 79f1207 commit 5064cfc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2023-11-16 Frank Mittelbach <[email protected]>
* ltpara.dtx (subsection{Providing hooks for paragraphs}):
Correct error message: hook left horizontal not vertical mode (gh/1182)

2023-11-09 Yukai Chou <[email protected]>
* clsguide-historic.tex, usrguide.tex:
Replace quotation with quote envs for zero para indent
Expand Down
10 changes: 6 additions & 4 deletions base/ltpara.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
%%% From File: ltpara.dtx
%
% \begin{macrocode}
\def\ltparaversion{v1.0l}
\def\ltparadate{2023/01/30}
\def\ltparaversion{v1.0m}
\def\ltparadate{2023/11/16}
% \end{macrocode}
%<*driver>
\documentclass{l3doc}
Expand Down Expand Up @@ -811,9 +811,11 @@
\hook_use:n {para/begin}
% \end{macrocode}
% If we aren't in horizontal mode any longer the hooks above misbehaved.
% \changes{v1.0m}{2023/11/16}{Correct error message: hook
% left horizontal not vertical mode (gh/1182)}
% \begin{macrocode}
\if_mode_horizontal: \else:
\msg_error:nnnn { hooks }{ para-mode }{begin}{vertical} \fi:
\msg_error:nnnn { hooks }{ para-mode }{begin}{horizontal} \fi:
% \end{macrocode}
% Finally we reinsert the indentation box (unless suppressed) and
% then call \cs{everypar} the way legacy \LaTeX\ code expects it.
Expand Down Expand Up @@ -845,7 +847,7 @@
%<latexrelease> \@kernel@before@para@begin
%<latexrelease> \hook_use:n {para/begin}
%<latexrelease> \if_mode_horizontal: \else:
%<latexrelease> \msg_error:nnnn { hooks }{ para-mode }{begin}{vertical} \fi:
%<latexrelease> \msg_error:nnnn { hooks }{ para-mode }{begin}{horizontal} \fi:
%<latexrelease> \@@_handle_indent:
%<latexrelease>}
% \end{macrocode}
Expand Down
4 changes: 2 additions & 2 deletions base/testfiles-lthooks2/ltpara-002.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

A para.

\AddToHookNext{para/begin}{Ohh\par\OmitIndent} % get out again
\AddToHookNext{para/begin}{Ohh\par\OmitIndent} % get out again and generate an error

A second para.

\AddToHookNext{para/end}{Ohh\par} % get out again
\AddToHookNext{para/end}{Ohh\par} % get out again too early and generate an error


A third para.
Expand Down
4 changes: 2 additions & 2 deletions base/testfiles-lthooks2/ltpara-002.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ PARA: 1 end (document level on input line ...)
PARA: 1 start (document level on input line ...)
PARA: 1 end (document level on input line ...)
! LaTeX hooks Error: Illegal mode change in hook 'para/begin'.
(hooks) Hook code did not remain in vertical mode.
(hooks) Hook code did not remain in horizontal mode.
For immediate help type H <return>.
...
l. ...A
second para.
Paragraph hooks cannot change the TeX mode without causing endless recursion.
The hook code in 'para/begin' needs to stay in vertical mode, but it didn't.
The hook code in 'para/begin' needs to stay in horizontal mode, but it didn't.
Examine the hook code with \ShowHook to find the issue.
PARA: 1 start (document level on input line ...)
PARA: 1 end (document level on input line ...)
Expand Down

0 comments on commit 5064cfc

Please sign in to comment.