I'm getting some cryptic (for me) errors and warnings when I compile. On the advice of darn near every internet resource I could find, I dug into the .log file. The trouble is, I don't know how to interpret what I see.
I don't want to take up people's time so, where can I find a Reading LaTex .log Files for Beginners document?
Best Answer
Here are some elements of a
.log
file:The
.log
file starts out by giving some information about the compiler that you are running. For example, runninglatex
orpdflatex
the output iswhile running
xelatex
would outputEvery file (including the document class
.cls
and style.sty
files) that is loaded starts with an opening "(
" and the file name. When the file has finished loading, a closing ")
". All messages that happen during that file are written between those parenthesis. Sometimes this includes the file version or a short description of the file, as written by the package author).The page numbers are written in
[
]
square brackets.LaTeX issues "bad box" warnings whenever you have something contained within a box (the general TeX layout structure) that does not fit within it. Here's a small working example
that produces
in your
.log
file. This means that the contents of the box (in this case a box of width\linewidth
) was exceeded by46.52866pt
at lines 3-4 in your code. An actual output code segment is also visible, with the fonts loaded to typeset that "bad" part of your document (OT1/cmr/m/n/10
). These "bad boxes" are tallied and given at the very end of your compile (although this does not form part of the actual.log
file):You may sometimes get warnings such as
This means that you have used
\ref
or one of its relatives without having the appropriate\label
. In this case, you will also getat the end of your
log
file.Similarly, if you define the same
\label
in multiple places, then you will getwhich will lead to
at the end of your
log
file.Sometimes fonts cannot be found. Either a font shape (for example slanted) or some requested font size is not available. Then you'll get a message like:
or
Many of the aforementioned information is obtained by an issue of
\typeout{<stuff>}
which outputs<stuff>
to the terminal window (and subsequently makes its way into the.log
file). Warnings and errors, also included in the.log
file, arise from an issue of\<cmd>Warning
or\<cmd>Error
where<cmd>
either refers toClass
orPackage
.To some extent it is possible to have control over the information output to the
.log
file by using thesilence
package. It provides a means to filter or activate warnings, errors or other messages from packages.