The -file-line-error command line flag for tex, latex, etc., is very effective. When you have a large project with plenty of files, the error message indicates very clearly not only the line number, but also the name of the file in which it occurred.
Unfortunately, this flag does nothing for warnings. What's the most effective way to find the name of the file in which under- or over- full warnings occur? Ideally, this could be done without resorting to an IDE.
The answers provided to the following questions are neat and related:
- How to find the error line in a multi file document
- Warnings and errors highlighting when compiling in Bash environment
- How to easily determine the full name of the latex file when a build error occurs?
- Adjust line numbers in error messages
Clarification
The problem becomes difficult when you have several levels of nesting and large log files (mine range between 5,000 and 30,000 lines, with lots of mostly useless information.)
A file open in indicated in the log by (filename, while a file close is
indicated by ). Now, suppose you have a main file which inputs section files, each of which inputs several subsection files, each of which inputs tables and figures.
Suppose that you see an overfull message in line 17,432 in your log file, which says that the error occurred at input line 182. You have two options:
- search for line 182 in all files that make your project
- do a backward search in your log file, carefully balancing open and close parenthesis until you find which of the input files was active at line 17,432 of the log file.
Here is an actual excerpt from my .log file. Note that there are many open and close parenthesis in it which are not related to file inclusion. Also observe that input line numbers are missing from the last message in this excerpt.
21983 LaTeX Font Info: Font shape `T1/ptm/bx/n' in size not available 21984 (Font) Font shape `T1/ptm/b/n' tried instead on input line 21. 21985 21986 Overfull \hbox (9.91599pt too wide) in paragraph at lines 14--22 21987 \T1/ptm/m/n/10 (\T1/ptm/b/n/10 N\T1/ptm/m/n/10 umber of \T1/ptm/b/n/10 I\T1/ptm 21988 /m/n/10 nstance \T1/ptm/b/n/10 V\T1/ptm/m/n/10 ariables), \T1/ptm/b/n/10 MTE \ 21989 T1/ptm/m/n/10 (\T1/ptm/b/n/10 M\T1/ptm/m/n/10 u\T1/ptm/b/n/10 t\T1/ptm/m/n/10 a 21990 bility (\T1/ptm/b/n/10 E\T1/ptm/m/n/10 xplicit)), 21991 [] 21992 21993 21994 Underfull \vbox (badness 10000) has occurred while \output is active []