This question: \addvspace can't replace \vspace shows a situation in which an error message can be confusing. If \addvspace
is used when not in vmode the error message obtained is
! LaTeX Error: Something's wrong--perhaps a missing \item.
which can be seen, for example, compiling the following simple example
\documentclass{article}
\begin{document}
a\addvspace{3em}
\end{document}
in this case, the error message is not really descriptive and could be misleading. The definition of \addvspace
(Section
16.5 Vertical spacing in source2e
) explains what's going on:
\def\addvspace#1{%
\ifvmode
\if@minipage\else
\ifdim \lastskip =\z@
\vskip #1\relax
\else
\@tempskipb#1\relax
\@xaddvskip
\fi
\fi
\else
\@noitemerr
\fi}
so when \addvspace is used not in vmode, \@noitemerr
is called producing the mentioned error message, as can be seeing in lterror.dtx
.
\gdef\@noitemerr{%
<!autoload> \@latex@error{Something's wrong--perhaps a missing %
<!autoload> \protect\item}\@ehc}
<autoload> \@autoerr\@noitemerr}
Which other situations have you encountered in which the error message obtained seems confusing and (apparently) not related to the problem originating the error?
I would suggest to accompany each answer with the textual error message, a minimal example code producing the error, and a brief explanation of why that is the error message.