The log file usually gives some help. For example if you start an environment without ending it then you get
! LaTeX Error: \begin{quote} on input line 16 ended by \end{document}.
which tells you where group started, if it doesn't tell you where it should have finished.
If you have mis-matched { } pairs it depends whether they are being used for grouping or argument delimiting.
In the former case you get
(\end occurred inside a group at level 1)
which tells you something is bad and if at the start of the document you put
\tracinggroups=1
you get in addition
### simple group (level 1) entered at line 16 ({)
### bottom level
which tells you where the { was.
If it is argument matching ie you have \textbf{ with no } then you get:
Runaway argument?
{ \par aa bb xx cc \par \par \par \par 4 $\hat {\hat {\mathcal {A}}} \ETC.
! File ended while scanning use of \textbf .
which gives you some context, but not a line number, although if you have the tracinggroups set as above it is easy to guess as you are told the last group that was entered or left before the error, in this case the log shows
{leaving math shift group (level 1) entered at line 14}
)
Runaway argument?
so it isn't too hard to spot the error on line 16 as line 14 was OK and line 15 (in this case) was empty.
\end{document}earlier in the file to see when the error disappears. Try using this in a binary search strategy. – Andrew Swann Sep 13 '12 at 15:52emacs(andAUCTeX). Simple problems are easily found through syntax highlighting orM-x check-parens. For more complex needs there's things like rainbow-delimiters.el. – jon Sep 13 '12 at 20:21