# Latex errors when compiling

I have a general question on reading latex errors. (I am not a very experienced latex user.) I guess I have two questions:

When I compile a file with latex, it writes a lot of junk to my terminal. Is there a way to reduce the amount of junk? (I can look in the log file if I want to see more specific things).

When I get an error message, Latex writes the line number where the error occurs. But, does Latex also tell me in what file the error occurs? (I am using a template of somebody which includes a lot of files, and has some error somewhere. The only thing I know now is that it occurs on line 765 of a certain file, but I dont know which file ....)

• Hoi meneer and welcome to TeX.SE. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show certain details, about the error, the loaded packages etc. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. – percusse Jul 30 '12 at 13:16
• What TeX distribution are you using? You should mention also the operating system and the editor you're employing to manage LaTeX files. – egreg Jul 30 '12 at 14:05
• Perhaps the -file-line-error option will help. – Peter Grill Jul 30 '12 at 17:33

In the log file, you have to look before the error message to find the file being processed. Suppose file main.tex includes file include1.tex and file include1.tex includes file include2.tex. If file include2.tex has an unknow command in line 4, then you will get this output:

(./include1.tex (./include2.tex
! Undefined control sequence.
l.4 \erro


The first open parentheses tells which file the error occurred.

I'm assuming are running latex in the command line:

latex  -interaction=nonstopmode main