[Tex/LaTex] How to generate .pdf files with vim-latex suite

dvipsps2pdfvim-latex

I'm having trouble setting up vim-latex suite to produce .pdf files. Right now the \ll (<leader>ll) command will compile latex. Then \lv (<leader>lv) will produce a .dvi file.

Is there another command to initiate the standard .tex -> .dvi -> .ps -> .pdf build sequence?

Alternatively, can I configure \lb to create .ps and .pdf files?

So far I have tried the following commands from the vim-latx documentation:

let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'
let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'

However, this doesn't build ps or pdf file. I can still make them manually with dvips mydoc.dvi and ps2pdf mydoc.ps.

Best Answer

I would guess that you had g:Tex_DefaultTargetFormat set to its default value of dvi (at least for Windows/Unix according to the documentation).

With g:Tex_DefaultTargetFormat set to dvi, compilation will follow the chain set by g:Tex_FormatDependency_dvi rather than g:Tex_FormatDependency_pdf which by default will only lead to g:Tex_CompileRule_dvi being executed.

In order to get the dvi -> ps -> pdf chain working, you would need

  • let g:Tex_FormatDependency_dvi = 'dvi,ps,pdf' rather than let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' so that when Vim-LaTeX tries to build a dvi file (as it defaults to), it follows the dvi -> ps -> pdf chain.

or

  • g:Tex_DefaultTargetFormat='pdf' rather than g:Tex_DefaultTargetFormat='dvi' so it follows the g:Tex_FormatDependency_pdf which you defined in the question to perform the dvi -> ps -> pdf chain.

For running pdflatex you should be able to just use g:Tex_DefaultTargetFormat='pdf' with g:Tex_CompileRule_pdf and g:Tex_FormatDependency_pdf left to their defaults.

Related Question