Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
13  
Package authors: make sure your package contains some amusing error messages. –  Seamus Apr 7 '11 at 20:45
add comment

2 Answers

There are many, I prefer the ones with a bit of humor from TeX itself, my two favorites:

Sorry, Pandora. (You sneaky devil.)

To trigger this message type:

\setbox0=\vbox{\halign{#\hfil\cr a\cr b\cr}}
\unhbox0
\bye

This will trigger an error Incompatible list can't be unboxed. Press 'h' for help and you will see the error.

and

Pretend that you’re Hercule Poirot: Examine all clues

How to trigger this message is left as an exercise for the reader. Clue is in the file TEX.POOL.

share|improve this answer
1  
how is the Pandora error triggered? –  Ian Thompson Apr 7 '11 at 23:23
    
@Ian Thomson please see edit –  Yiannis Lazarides Apr 8 '11 at 5:01
1  
\setbox0\vbox{}\unhbox0 is sufficient. The error message is wrong on two counts, though. It's not an \hbox that it is trying to unbox and TeX is perfectly happy to unbox an \hbox in vertical mode. –  TH. Apr 8 '11 at 6:48
add comment

Partially taken from the UK TeX FAQ entry Capacity exceeded [semantic nest …]: The MWE

\documentclass{article}
\begin{document}
\def\silly{\hbox{here's \silly being executed}}
\silly% Be silly
\end{document}

produces the following error:

! TeX capacity exceeded, sorry [grouping levels=255].
<to be read again> 
                   {
l.4 \silly

If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.