You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\addvspace and \addpenalty both call \@noitemerr if they are encountered in horizontal mode. This is really a leftover from the 2.09 days, i.e., more than 30 years old. Back then, this was necessary, because the list environments changed \parto do nothing when they started, thus calling \vskip (which is executedd by \addvspace) ended in a tight loop inserting \par over and over again without ever succeeding to reach vertical mode. In 2e this behavior was changed and \par got a definition that changed to vmode after 1000 unsuccessful attempts (and then issuing \@noitemerr) as well.
Thus, itis no longer necessary to generate this error in \addvspace and the only thing that it achieves today, is either an unnecessary error message (if the command is used outside a list) or generating the error message twice (if used inside a list).
It should therefore be taken out and instead \addvspaceshould instead simply issue a \par first before applying its logic.
This is upward compatible since no valid LaTeX document can call \addvspace in hmode right now.
Minimal example showing the current behaviour
\RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!\documentclass{article}
\begin{document}
In vmode everything works:
\addvspace{1cm}
In hmode generates a no-item error and it should not (in particular not this one which is bogus).
\addvspace{1cm}
\end{document}
The text was updated successfully, but these errors were encountered:
It would probably be worth noting in any ltnews description of this change that
\mbox{a\addvspace{1in}b}
would give a lower level ! Missing } inserted error now (unless we leave in the \ifvmode test and just remove \@noitemerr in which case it would be not an error at all, just ignored.
Brief outline of the enhancement
\addvspace
and\addpenalty
both call\@noitemerr
if they are encountered in horizontal mode. This is really a leftover from the 2.09 days, i.e., more than 30 years old. Back then, this was necessary, because the list environments changed\par
to do nothing when they started, thus calling\vskip
(which is executedd by\addvspace
) ended in a tight loop inserting\par
over and over again without ever succeeding to reach vertical mode. In 2e this behavior was changed and\par
got a definition that changed to vmode after 1000 unsuccessful attempts (and then issuing\@noitemerr
) as well.Thus, itis no longer necessary to generate this error in
\addvspace
and the only thing that it achieves today, is either an unnecessary error message (if the command is used outside a list) or generating the error message twice (if used inside a list).It should therefore be taken out and instead
\addvspace
should instead simply issue a\par
first before applying its logic.This is upward compatible since no valid LaTeX document can call
\addvspace
in hmode right now.Minimal example showing the current behaviour
The text was updated successfully, but these errors were encountered: