I'm sure this is a dupe, but I'll go ahead anyway:

LaTeX relates many of its messages to lines in files. For example:

LaTeX Font Info:    Try loading font information for OT1+lmtt on input line 81.

But it is often unclear which line of which file is it referring to. Whether it's always a .tex file or possibly a .sty or .cls; whether its the file in its original form, or after it has had some macro expansion; etc. If you try looking for the filename in the lines before the message, you find many filenames, none of which were written by you (e.g. epstopdf-sys.cfg, grfext.sty, omslmsy.fd, taken from the same example - which I won't fully list here, since this question is more general).

So is there a simple rule or determining where in the input the message relates to?


If you look in the log file, every time TeX opens a file it prints a ( followed by the path to the file, and when it closes a file it prints a ) so by matching (or more likely getting your editor to match for you) () pairs you can work out the currently open file for any message in the log.

The same is needed for error messages where the number is given as l.56 but there modern TeX systems have a command line option (--file-line-error) to put the filename into the error message, but that name is not available to macro generated messages, even if the option is used.

  • But what if one file uses macros from another file which uses macros from another file etc. - the inner files are themselves ok, but the errors occur on the inside. How do I get the stack of file-lineno, file-lineno etc.? – einpoklum Jun 27 '15 at 9:56
  • 1
    @einpoklum as I say above if the log says (filea (fileb... (filec..) .. error on line 5 by matching braces you can deduce it is line 5 of fileb – David Carlisle Jun 27 '15 at 10:05
  • but not which line of filea... – einpoklum Jun 27 '15 at 10:19
  • @David: I think that what he means is that it might be hard to trace the error back to where fileb is called in the original document. – Martin Argerami Jun 27 '15 at 11:48
  • @MartinArgerami that's life:-) – David Carlisle Jun 27 '15 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.