5

So I'm making a beamer document. And sometimes I will forget to add a } somewhere. When I do this, the compiler complains that there is a missing }, but it has no idea where it is. Narrowing it down to at least a subsection would be very helpful. But sometimes if I haven't compiled in a while, I have to delete sections of the document to find the error by process of elimination. Surely there is a better way! Why doesn't the compiler do this natively??

The error I get is this:

"! File ended while scanning use of \frame. \par <*> Frankenslides.tex I suspect you have forgotten a }', causing me to read past where you wanted me to stop. I'll try to recover; but if the error is serious, you'd better typeE' or `X' now and fix your file. ! Emergency stop."

I forgot to add a } after 2^{-1... Thanks!

7
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – cfr
    Dec 7, 2014 at 2:08
  • Do you really delete them? Commenting them out is sufficient. I think the compiler tries but in the case of some errors, it is already at the end of the document before it realises there's a problem. Commenting half of your code, then a quarter, then an eighth or whatever is about the best you can do. There are syntax checkers but I've never used one. A good editor, can help to highlight matching pairs etc. (I wish mine were better at this as it is just plain confused sometimes!)
    – cfr
    Dec 7, 2014 at 2:10
  • In these kinds of "runaway" errors, TeX has (probably/usually) not yet reached the end of the file, so it can't really tell you what line the problem is. Good editors usually let you check for unbalanced braces, however. (In emacs, there's M-x check-parens, e.g.)
    – jon
    Dec 7, 2014 at 3:02
  • When I was writing my thesis, a certain commercial word processing suite kept forcing me to quit-without-saving because it opened so many files that the OS stopped giving it more resources in order to stop the entire system going down. Today, it just wouldn't tell you there was an error. In any case, you can use it, fix it or leave it. Your freedom. Your choice. Not a choice proprietary software gives you, of course. (The issue is not commercial or not. It is free or not.)
    – cfr
    Dec 7, 2014 at 3:26
  • 3
    You don't have to remove or comment code: simply move the \end{document} up. Also the log should show you the number of slides already output and so give you a clue about the place of the error. Dec 7, 2014 at 7:48

1 Answer 1

3

TeX does give more clues, you just did not show them in your quotation above.

If there is a $x^{$ on a frame the error is

[2])
Runaway argument?
{title of bad frame} \begin {itemize} \item [Esophagus] Four columns \ETC.
! File ended while scanning use of \frame.
<inserted text> 
                \par 

You omitted the first three lines which tells you that

[2]

page 2 has been shipped out, so the error is on page 3.

Runaway argument?

It's a {} matching error.

    {title of bad frame} \begin {itemize} \item [Esophagus] Four columns \ETC.

The start of the frame command (or environment) with the mis-matched braces is as shown.

1
  • Oh! You're right. What mislead me was that when I clicked on the error, it let me to the text that I included. What you wrote was not visible initially, and I had to scroll back. Dec 8, 2014 at 5:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .