Perhaps the most common mistake I make is to forget to place a closing bracket, i.e. }
, or closing command, e.g. \end{description}
. When compiling, such mistakes usually do not say, "\begin{description}
is missing a closing command.", rather, they say something like, "\end{document}
appeared unexpectedly."
- In a large, complicated document, it can be difficult to find the source of such errors.
- When the errors appear inside an
\input
file, these are often more difficult to find. - These are further made difficult when some macros require additional brackets, e.g.
\begin{tabular}{lll}
.
Are there any techniques or strategies one can apply to quickly locate the items which are missing closing items, in a document?
M-x check-parens
, which looks for unbalanced braces, parentheses, and brackets. That's what I use. Back in the day, I also made use ofbibclean
, I think, for .bib files. But I don't have it installed any more.\begin{foo}...\end{foo}
pair and leaves the cursor between them.end{environment}
at the time I add\begin{environment}
.