TeXpad

LaTeX error: \begin{…} on input line … ended by \end{…}

Environments nest like parentheses: the last one opened must be the first one closed. This error names the environment that is still open, the line where it began, and the \end that arrived out of order.

! LaTeX Error: \begin{itemize} on input line 3 ended by \end{document}.

Try it: this example has the error

Press Fix it in the error box, and it compiles to a PDF. What pdfTeX printed for it:

! LaTeX Error: \begin{itemize} on input line 3 ended by \end{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8 \end{document}
or paste your own document

Ready. Press Compile (or Ctrl/Cmd + Enter).

Open in the full editor →

Common causes

How to fix it

  1. Go to the line number in the message and find where that environment should end.
  2. Add the missing \end{…} there, or swap the two \end lines into the right order.
  3. TeXpad shows the open environment and offers to insert its \end in the right place.

Related errors