4

Why I get a error when there is a \paragraph{} (or \subparagraph{}) inside a quote environment?

For the example below

\documentclass[]{article}
\begin{document}
\begin{quote}
\paragraph{My header}

Some text.
\end{quote}
\end{document}

I got

$ pdflatex --version
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013)
$ pdflatex bug-sample.tex
...
! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.7 \end{quote}
  • I can put \section inside quote environment. Why not \paragraph? – Raniere Silva Apr 6 '14 at 1:36
4

Not an answer but a workaround:

\documentclass{article}

\begin{document}
\begin{quote}
  \mbox{}%
  \paragraph{My heading} starts something.
\end{quote}
\end{document}
  • paragraph headings are usually run in; section titles are usually not. \leavevmode might also work. – barbara beeton Apr 6 '14 at 2:24
  • @barbarabeeton Thanks. I had got as far as the run in bit. What I'm not able to figure out is why that matters. So I think the workaround works because \mbox{} basically counts as something fed to \item in the trivial list environment. But why do non-run in headers satisfy the environment without that while run in headers do not? – cfr Apr 6 '14 at 2:40
  • non-run-in headers "leave vmode" when they start a new line after the header. (that sounds circular.) yes, it does have to do with feeding something to the \item. (thinking of everything as a list -- as done with quote, theorems, etc., etc. -- is not how i would have parsed the structures, but i didn't design latex. i've designed a number of styles based on plain tex, and i don't think there's a single list in the lot. but latex got the critical mass first.) – barbara beeton Apr 6 '14 at 3:16
  • re lists and plain tex, i lied. indexes are based on list structures. and actual lists. but not quotes, or tables of contents (those are structured paragraphs), and certainly not theorems or proofs. it's just historical fact. – barbara beeton Apr 6 '14 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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