I am compiling a latex document, and when I have errors, I get nice messages like
which tells me that there is an error somewhere before line 1041. So far, so good. I can use my text editor and quickly find line 1041.
But sometimes I have a latex document (say,
main.tex) that includes something like
at the beginning of the file. Now if latex tells me there is an error on line 1041, it is referring to the source code consisting of
my_headers.tex inserted into it. So if I edit the actual file
main.tex, line 1041 doesn't correspond to the error location. The location I want is 1041 minus the number of lines in
So, I can manually calculate it, or make a script, but it seems like there must be a simple option to tell latex to ignore the input/include files when calculating line numbers.