This is a comparison of the existing methods (plus a new suggestion by me below)
If you come across this question, you most likely want to quickly find the parts that you're interested in in the log file/output.
(the question itself only concern terminal output (stdout), but the errors/messages are in both the log file and terminal)
In my experience, the parts that you're possibly interested in are
- (most frequent) The errors raised by TeX.
- (less frequent, only if you do some TeX programming) Debug error messages printed by
\show, \showtokens, \tl_show:n, \regex_show:n or similar.
- The warnings produced by TeX.
- Whether it can parse an existing file. (so you don't need to change your existing compilation command)
The table below compares the tools, with respect to the conditions above. The first line is my new suggestion.
The file in (7) is used.
| Tool |
On error |
On \show (3) |
On warning |
Parse log file |
texfot cat a.log |
Configurable |
Configurable |
Continue |
Yes |
pulp a.log |
Configurable |
? |
Configurable |
Yes |
xelatex a.tex |
Prompt (4) |
Prompt |
Continue |
No |
xelatex a.tex < /dev/null |
Stop |
Stop |
Continue |
No |
latexmk [-g] a.tex |
Stop |
Stop |
Continue |
No |
texfot xelatex a.tex |
Stop |
Stop |
Continue |
Partial (6) |
xelatex a.tex < <(yes "") |
Continue |
Continue |
Continue |
No |
latexmk [-g] -latexoption=-interaction=nonstopmode a.tex |
Continue |
Continue |
Continue |
No |
texfot xelatex -interaction=nonstopmode a.tex |
Continue |
Continue |
Continue |
Partial |
xelatex -interaction batchmode |
Hide and continue |
Hide and continue |
Hide |
No |
latexmk -silent [-g] -latexoption=-interaction=nonstopmode a.tex |
Hide and continue |
Hide and continue |
Hide |
No |
xelatex -interaction batchmode with manual \nonstopmode ... \batchmode |
Hide and continue (1) |
Configurable |
Hide |
No |
rubber-info a.tex |
Configurable |
Hide |
Configurable |
Yes |
pplatex -i a.log (5) |
Configurable |
Hide |
Configurable |
Yes |
silence package |
? |
? |
? |
No |
pydflatex a.tex |
? |
? |
? |
? |
(1): The user could wrap it manually, but it requires knowing where the error is in the first place.
(2): About texfot --interactive xelatex a.tex: The flag doesn't have any effect, see pdflatex bash script to supress all output except error messages?
(3): The "Stop" case can always be converted to "Continue". See How can I make TeX stop on the first error, but do not stop on \show (or \tl_show:n)? (disclaimer: my question)
(4): See How can one stop LaTeX compilation? for what to do with the prompt.
(5): May requires compilation from source if the provided binary does not work. Supports cmake.
(6): "Partial" means being able to run the compiler with any option, but requires re-run to filter.
(7): The example file:
\documentclass[12pt]{article}
\begin{document}
\ExplSyntaxOn
\def \a {123}
\show \a
\tl_show:N \a
\tl_analysis_show:n {123}
\ExplSyntaxOff
Some example formula x^2+1=0
\end{document}
Regardless of the method, because LaTeX log file is relatively unstructured, any solution that parses the log file is subject to error.
Looks like Pulp is not mentioned in the other answers. This is a quote from its README:
What is pulp?
Do you find LaTeX's output too voluminous? Do you wish it would get straight to the point and just tell you the errors and where they occurred? When you see this:
Underfull \hbox (badness 3679) in paragraph at lines 278--282
[]\OT1/cmr/m/n/12 Shin-Cheng Mu, Zhen-jiang Hu, and
[]
[278]
Underfull \hbox (badness 10000) in paragraph at lines 318--323
[]\OT1/cmr/m/n/12 Yingfei Xiong,
[]
) [279] (./paper.aux)
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
) )
(\end occurred when \iftrue on line 2 was incomplete)
Here is how much of TeX's memory you used:
14398 strings out of 495035
257795 string characters out of 6181701
330613 words of memory out of 5000000
17235 multiletter control sequences out of 15000+600000
23715 words of font info for 95 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
66i,21n,72p,680b,1562s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/share/texlive/texmf-
dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/f
onts/type1/public/amsfonts/cm/cmcsc10.pfb></usr/share/texlive/texmf-dist/fonts/
type1/public/amsfonts/cm/cmex10.pfb></usr/share/texlive/texmf-dist/fonts/type1/
public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public
/amsfonts/cm/cmmi12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfo
nts/cm/cmmi6.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/
cmmi7.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.p
fb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></us
r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share
/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/share/texlive
/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb></usr/share/texlive/texmf-d
ist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive/texmf-dist/font
s/type1/public/amsfonts/cm/cmss10.pfb></usr/share/texlive/texmf-dist/fonts/type
1/public/amsfonts/cm/cmss12.pfb></usr/share/texlive/texmf-dist/fonts/type1/publ
ic/amsfonts/cm/cmss8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsf
onts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/c
m/cmsy6.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7
.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy8.pfb></
usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></usr/sh
are/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti12.pfb></usr/share/te
xlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti8.pfb></usr/share/texlive/t
exmf-dist/fonts/type1/public/amsfonts/cm/cmtt12.pfb></usr/share/texlive/texmf-d
ist/fonts/type1/public/amsfonts/symbols/msam10.pfb></usr/share/texlive/texmf-di
st/fonts/type1/public/amsfonts/symbols/msbm10.pfb>
Output written on paper.pdf (285 pages, 1369913 bytes).
PDF statistics:
1660 PDF objects out of 1728 (max. 8388607)
1107 compressed objects within 12 object streams
0 named destinations out of 1000 (max. 500000)
224 words of extra memory for PDF output out of 10000 (max. 10000000)
...do your eyes automatically skip to the line about cross-references without conscious effort? Then you need pulp. Compare LaTeX's spew with what pulp has to say about that file:
./delta.tex:133-133: LaTeX warning: Float too large for page by 4.64713pt on input line 133.
./delta.tex:2649-2649: LaTeX warning: Float too large for page by 74.48848pt on input line 2649.
./delta.tex:3817-3817: LaTeX warning: Float too large for page by 99.13847pt on input line 3817.
./delta.tex:3923-3923: wrapfig warning: Collision between wrapping environments on input line 3923.
./delta.tex:3925-3925: wrapfig warning: Stationary wrapfigure forced to float on input line 3925.
./delta.tex:3951-3951: wrapfig warning: Collision between wrapping environments on input line 3951.
./delta.tex:3954-3954: wrapfig warning: Stationary wrapfigure forced to float on input line 3954.
./skeleton_dissertation.tex:36-?: LaTeX warning: Label(s) may have changed. Rerun to get cross-references right.
2-2: (\end occurred when \iftrue on line 2 was incomplete)
Not only is the label warning more clearly highlighted, a number of other errors -- which were scrolled way the heck off the terminal ages ago if you were just using pdflatex -- are more clearly visible, together with information about which source file and line number caused the problem. (In fact, even messages which do not have a line number directly in them will have a "best guess" assigned to them by pulp to give you an idea of where in the file to start looking.)
textag belongs here. Could you please add it (and get rid of then-obsolete comments)? – doncherry Mar 30 '12 at 01:15texfot, which is included in various distributions nowadays. – Evgeni Sergeev Jul 28 '17 at 14:55tmuxto have a separate terminal pane just for compiling. I often have three panes: one for the TeX document in Vim, one for compiling, and another for actually using the command line that won't be junked up by TeX log output. – musarithmia Feb 02 '22 at 16:58