[Vim-latex-devel] project/file specific settings
Brought to you by:
srinathava,
tmaas
From: Francesco M. <fra...@gm...> - 2012-11-23 10:42:26
|
Dear list, this is the first time for me on this list. I began to use vim-latex recently, and I like it very much. I looked on the web for an easy way to switch between latex and pdflatex, but I couldn't find any suggestion My standard settings in ~/.vim/ftplugin/tex.vim are the following "set targets > let g:Tex_DefaultTargetFormat = 'dvi' > let g:Tex_MultipleCompileFormats = 'dvi' > let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' > "set compilation rules > let g:Tex_CompileRule_dvi = 'latex -scr-special -synctex=1 $*' > let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' > let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps' As now, if I want to use pdflatex, I modify the above file > "set targets > let g:Tex_DefaultTargetFormat = 'pdf' > let g:Tex_MultipleCompileFormats = 'pdf' > let g:Tex_FormatDependency_pdf = 'pdf' > "set compilation rules > let g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*' This is very prone to errors if I work on more than a tex file at a time. I've tried opening a tex file and insert the commands for pdf in the vim command line (with the idea of save the session) without success [1]. I have found the plugin 'localvimrc' and created a local vimrc file in the project directory with the pdf specifications, but didn't work as (I think) the vimrc is loaded before the latex-vim files are. Is there some way to switch easely between latex and pdflatex or some mechanism like localvimrc? An idea could be to put the default settings into ~/.vimrc (with a check for a tex file) and the pdflatex one in a local vimrc, but to me is not very neat and I don't know if it would work (if the latex-vim plugin is loaded after the vimrc the g:Tex_* would be undefined) Thanks in advance for any help or suggestion Cheers, Francesco [1] error : PDF mode expected, but DVI mode detected!\MessageBreak If you are using `latex', then call `pdflatex'.\MessageBreak Otherwise check and correct the driver options.\MessageBreak Error recovery by switching to PDF mode% |