I use Vim to edit LaTeX documents and pdflatex to compile the documents. One problem with using pdflatex is that it takes time to go through the output to see if there is any warning/errors. Sometimes, I even spend few minutes trying to understand whether a certain line is just an information line or an error/warning. Any idea to make this task easier? Any rules for reading the output of pdflatex? Or may be some tools?
-
Warnings usually won't interrupt the compile and errors usually will. What parts of the output are you trying to understand? Post an excerpt.– Matthew LeingangCommented Dec 16, 2010 at 10:16
-
1Aha, so you mean if the compile is not interrupted than I have no errors? Well, I just want to have a nice list of warnings and errors just like programming IDEs.– RafidCommented Dec 16, 2010 at 10:21
-
1See tex.stackexchange.com/questions/2470/…– Charles StewartCommented Dec 16, 2010 at 11:15
-
3Are you using the Vim-LaTeX plug-in or compiling from outside Vim? Vim-LaTeX will halt on error and give you an IDE-like list of errors. It doesn't halt on warnings, though. stackoverflow.com/questions/3244908/… has some discussion of how to halt on warning, but I've not tired it.– hoylandCommented Dec 16, 2010 at 13:42
2 Answers
Try compiling with
pdflatex -file-line-error <filename>
That way, the .log file will generate C-style errors which begin with filename.tex:12:Error message
, for an error on line 12; I think vim may even have built-in mechanisms for parsing these, or if not, making a regex for finding them in the log should not be hard.
As others have mentioned there are Vim plugins that have built in methods for dealing with LaTeX errors. Personally, the Vim-LaTeX (AKA the LaTeX suite) plugin annoys me. I think both AucTeX for vim and Vim LaTeX-box, but to each their own. They all have their own methods for dealing with errors.
To make things easier: The LaTeX build wrapper ltx2any offers a nice (and aesthetical very pleasing) summary of any error or warnings in different file formates, amongst them pdf
and markdown
.
From its webpage:
Aggregates error messages and warnings from all tools into a nicely formatted log (Markdown or PDF) with references to source files and original logs.