Wikia

Vim Tips Wiki

Watchlist Recent changes

Automatic LaTeX compile and XDVI refresh


Tip 1605 Printable Monobook Previous Next

created September 16, 2008 · complexity basic · version 7.0


This tip is for users of latex-suite. It lets latex-suite compile the file automatically when the buffer is saved and refreshes the xdvi viewer immediately. This is particularly useful when you have a wide-screen monitor with Vim on the left and xdvi on the right.

Just put the following two lines in your vimrc. The first simply calls LaTeX-Compile at ":w", and the second lets xdvi redraw the screen.

au BufWritePost *.tex silent call Tex_CompileLatex()
au BufWritePost *.tex silent !pkill -USR1 xdvi.bin

The behaviour is taken from Eclipse's "incremental build" feature and can be adapted to other languages than latex as well.

CommentsEdit

You should replace the Tex_CompileLatex() command with Tex_RunLaTeX() if you are using *tex.latexmain files.

There is AutomaticLaTeXPlugin (ATP) which is another versatile Latex plugin for vim. It implements background compilation and also a progress bar (see this video) (this works under Linux and MacOS, but not under Windows). Its web page is here ATP, and here is its feature list.

Pages on Vim Tips Wiki

Add a Page
1,590pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
71photos on this wiki
See more >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki