Recommended build system for latex? [closed]
Solution 1:
I've just tried out latexmk. If you do
latexmk -pvc file.tex
Then it will auto preview (DVI by default).
- Handles dependencies
- DVI, ps or pdf
- Iterates fine.
- Very configurable, see
man latexmk
Downsides:
- It doesnt condense errors, which isnt hugely useful (workaround: use rubber-info separately)
- Bug in the man file: "Sometimes a viewer (gv) tries to read an updated .ps or .pdf file after its creation is started but before the file is complete. Work around: manually refresh (or reopen) display.". It would be better if it built it via a temporary .pdf file to avoid this.
- Not hugely user friendly.
Solution 2:
After considering all these options for some time, I have settled with the following solution.
- Set vim to write continuously as I type.
- Run a script in the background to build continuously, refreshing the pdf as it goes. latexmk is nearly good enough, except that it builds in place, which gets reloaded at a bad time in okular (my viewer).
The script is available at https://github.com/pbiggar/texbuild.
Use rubber-info to get the errors and warnings from the log file. The script above saves the log file in t.log. In vim:
autocmd FileType tex set makeprg=rubber-info\ t.log
autocmd FileType tex set errorformat=%f:%l:\ %m
Solution 3:
I haven't used it myself, but I've heard of Rubber as a good alternative.
From their website:
Rubber is a program whose purpose is to handle all tasks related to the compilation of LaTeX documents. This includes compiling the document itself, of course, enough times so that all references are defined, and running BibTeX to manage bibliographic references. Automatic execution of dvips to produce PostScript documents is also included, as well as usage of pdfLaTeX to produce PDF documents.
Solution 4:
Ok, so this question is a bit old, but it came up when I googled "latex build system" so I thought I'd add my two cents. I tried the Makefile based solutions, but found the output a bit verbose and unwieldy. I figured someone might have built a scons extension for latex, but was pleasantly surprised to find that scons already natively supports latex! All you need to do is create a SConsctruct file like this:
env = Environment()
env.PDF(target="report.pdf", source="report.tex")
To build just run scons report.pdf
. Scons will automatically build .tex files included by report.tex, handle bibliographies and perform repeated builds in order to resolve all references - simple!
You can create DVI and PS files in the same way. For more info on these builders check out http://www.scons.org/doc/2.0.1/HTML/scons-user/a8524.html .
For more info on scons (a make replacement), see http://www.scons.org/