2

I am wondering if there is a bash tool available that I can pipe my latex output through and retrieve a more user-friendly output (i.e. file and line number of error). Currently, I am using a bash script to run pdflatex and bibtex. I develop in Atom and don't want to use any of the graphical Latex editors.

Brian
  • 121

2 Answers2

2

There is ltx2any which will not only automatically compile your latex document but also produce a beautiful summary of any warnings and error messages (several different file formats are available). An example of the output from its website:

enter image description here

See https://github.com/reitzig/ltx2any for more information

2

It is easier to find the line numbers if you use --file-line-error then given bb831.tex looking like

\documentclass{article}

\begin{document}


aaaa \zzzzz


bbbb }


\end{document}

The bash command line

pdflatex -interaction=scrollmode --file-line-error bb831 | grep -A2 '^\.[^\.]*\.tex:'

produces terminal output of just

./bb831.tex:6: Undefined control sequence.
l.6 aaaa \zzzzz

./bb831.tex:9: Too many }'s.
l.9 bbbb }
David Carlisle
  • 757,742