In my ~/.vim/ftplugin/tex.vim I defined the following:

function! Set_PDF()
    let g:Tex_DefaultTargetFormat = 'pdf'
    let g:Tex_CompileRule_pdf = 'pdflatex --synctex=1
-interaction=nonstopmode -file-line-error-style $*'
    let g:Tex_CompileRule_dvi = 'pdflatex --synctex=1
-interaction=nonstopmode -file-line-error-style $*'
    let g:Tex_ViewRule_pdf =  'okular --unique 2>/dev/null 1>&2 '
    let g:Tex_ViewRule_dvi = 'okular --unique 2>/dev/null 1>&2 '
    let g:Tex_MultipleCompileFormats = ''
endfunction

function! Set_LaTeX()
    let g:Tex_DefaultTargetFormat = 'dvi'
    let g:Tex_CompileRule_dvi = 'latex -src-specials
-interaction=nonstopmode -file-line-error-style $*'
    let g:Tex_ViewRule_dvi = 'xdvi 2>/dev/null 1>&2 '
    let g:Tex_MultipleCompileFormats = ''
endfunction

noremap <leader>latex :call Set_LaTeX()
noremap <leader>pdf   :call Set_PDF()

My intention is the following: if I use ,pdf  (my leader is ,), then vim
should be set up to produce pdf whereas if I use ,latex then it should
produce dvi.

Now I open a latex file which should produce pdf, I call ,pdf and I compile
using ,ll
Everything is fine.
My problem is when I try see the resulting pdf: if I use ,lv then what I
get is the dvi file displayed by xdvi whereas if I use ,ls then I get again
the dvi file but this time it is displayed by okular.
What I would like is that by either I should get displayed the pdf by means
of okular.
What am I doing wrong?

Thanks
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to