28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

414 Appendix C. Error Messages<br />

in math mode <strong>and</strong> should have been typed here as \_. However, after<br />

the first $ had switched (incorrectly) in<strong>to</strong> math mode, the _ sign became<br />

allowed, with the result that the following letter s was lowered.<br />

If we now correct the text by replacing the $ sign with \$, then the _<br />

symbol is no longer in math mode, producing the error message:<br />

! Missing $ inserted.<br />

<br />

$<br />

l.5 ...ice is \$3.50 <strong>and</strong> the order number is type_<br />

sample.<br />

?<br />

Pressing 〈return〉 here tells T E X <strong>to</strong> recover from the error by inserting<br />

the apparently missing $ sign at this point before the math comm<strong>and</strong><br />

_. The processing continues, <strong>and</strong> at some place before the end of the<br />

current paragraph, T E X will notice again that the closing $ is not present.<br />

The same error message is printed as in the first case. The processing<br />

goes on with another 〈return〉 response, with the result:<br />

The price is $3.50 <strong>and</strong> the order number is typesample.<br />

In all three cases, asking for more help with H would type <strong>to</strong> the moni<strong>to</strong>r:<br />

I’ve inserted a begin-math/end-math symbol since I think<br />

you left one out. Proceed, with fingers crossed.<br />

The last sentence above is just what we recommend for mathematical<br />

error messages: keep on pressing 〈return〉 or S <strong>to</strong> get through <strong>to</strong> the end<br />

of the processing, <strong>and</strong> then look at the printed output <strong>to</strong> find the mistake.<br />

C.2.4 Errors from multi-file texts<br />

If the document text is split over many files that are <strong>to</strong> be read in with<br />

\input or \include comm<strong>and</strong>s, the line number in the error message<br />

refers <strong>to</strong> the file currently being read. A response with E 〈return〉 will call<br />

the edi<strong>to</strong>r program <strong>and</strong> open that file, going <strong>to</strong> the indicated line where<br />

the error was recognized. With the other responses, the edi<strong>to</strong>r has <strong>to</strong> be<br />

called separately, with the faulty file explicitly named.<br />

It is possible <strong>to</strong> determine which file was being processed at the time<br />

of the error by examining the processing messages or the.log file. As the<br />

files are opened for reading, T E X writes an opening parenthesis ( <strong>and</strong> the<br />

name of the file <strong>to</strong> the moni<strong>to</strong>r <strong>and</strong> <strong>to</strong> the transcript.log file. When the<br />

file is closed, a closing parenthesis ) is printed. Output page numbers<br />

are similarly written <strong>to</strong> both the moni<strong>to</strong>r <strong>and</strong> transcript file in square<br />

brackets. For example, if the moni<strong>to</strong>r shows the processing messages

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!