LaTeX error "Something's wrong--perhaps a missing \item": cause and fix
LaTeX is inside a list environment such as itemize, enumerate or description and found text, or the end of the list, before any \item.
Why it happens
- Text stands between
\begin{itemize}and the first\item. - The list is empty:
\end{itemize}follows\begin{itemize}without an\item. - A list stands in a table cell of type
l,corr. Those columns cannot hold paragraphs or lists. - A
$in an earlier item has no partner, so the next\itemfalls into math mode. The log then shows Command \item invalid in math mode first.
How to fix it
- Start every entry with
\item, the first one too. Indescriptionwrite\item[Term]. - Move introductory text in front of
\begin{itemize}. - Delete empty lists or comment them out completely.
- For a list in a table, use a column with a width such as
p{4cm}.
A document that produces the message
\documentclass{article}
\begin{document}
\begin{itemize}
First point
\item Second point
\end{itemize}
\end{document}The corrected document
\documentclass{article}
\begin{document}
\begin{itemize}
\item First point
\item Second point
\end{itemize}
\end{document}Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.
Finding the line in the editor
The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.