Skip to content

Commit

Permalink
hotfix for #1641
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 26, 2025
1 parent 8088d7d commit 057c42e
Show file tree
Hide file tree
Showing 4 changed files with 548 additions and 5 deletions.
9 changes: 9 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ not part of the distribution.
All changes above are only part of the development branch for the next release.
================================================================================

#########################
# 2024-11-01 PL2 Release
#########################

2025-01-26 Frank Mittelbach <[email protected]>

* ltlists.dtx:
Only migrate \cs{@doendpe} out of simple and semi-simple groups (gh/1641)

#########################
# 2024-11-01 PL1 Release
#########################
Expand Down
25 changes: 20 additions & 5 deletions base/ltlists.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
%<*driver>
% \fi
\ProvidesFile{ltlists.dtx}
[2024/06/23 v1.0u LaTeX Kernel (List Environments)]
[2025/01/26 v1.0v LaTeX Kernel (List Environments)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltlists.dtx}
Expand Down Expand Up @@ -851,11 +851,26 @@
\def\@endpetrue {%
\global\let\if@endpe\iftrue
% \end{macrocode}
% If we are inside a group then propagate to the outside:
% If we are inside a simple or a semi-simple group then propagate
% to the outside, for all other group types do nothing. Normally, we
% would start out in the group opened by \cs{begin} (type 14). When we
% migrate out of that we are either on top-level (type 0) or in
% another semi-simple group (type 14) or
% in some other group. Thus, the best order of tests is to first
% test for 14, then for 0 and finally for 1 (simple group).
% \changes{v1.0v}{2025/01/26}{Only migrate \cs{@doendpe} out of simple
% and semi-simple groups (gh1641)}
% \begin{macrocode}
\ifnum\currentgrouplevel>\z@
\aftergroup\propagate@doendpe
\fi
\ifnum\currentgrouptype =14 % semi-simple group
\aftergroup\propagate@doendpe
\else
\ifnum\currentgrouptype =\z@ % no group: top-level
\else
\ifnum\currentgrouptype =\@ne % simple group
\aftergroup\propagate@doendpe
\fi
\fi
\fi
}
% \end{macrocode}
% If \cs{if@endpe} is still true after the group ends, we run \cs{@doendpe}
Expand Down
30 changes: 30 additions & 0 deletions base/testfiles/github-1641.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
\documentclass{article}

\input{test2e}

\newcommand\sample{A text of more than a single line to see the paragraph indentation. Is this enough?}

% show the group type we are dealing with

\AddToHook{cmd/@endpetrue/before}{\showthe\currentgrouptype}

\showoutput

\begin{document}

\START

\sample

\vbox{\hsize=3cm\noindent X}
\sample \space Should be indented.

\bigskip

\vbox{\hsize=3cm\noindent
\begin{itemize}\item X\end{itemize}}
\sample Should be indented!

\sample

\end{document}
Loading

0 comments on commit 057c42e

Please sign in to comment.