Re: [Vim-latex-devel] Viewing pdf
Brought to you by:
srinathava,
tmaas
|
From: Ruthard B. <rut...@we...> - 2016-02-25 20:12:56
|
Hello Mario,
I cannot tell what you are doing wrong, as the vim-latex style of
compiling and viewing is not very intuitive to me.
My solution is to use the latex binaries directly:
In .vim/after/ftplugin/tex.vim I have:
(pdf is a link to my pdf-viewer of the day -- usually mupdf)
--------------------%<--------------------------
""" compile and display
function TexCompileAndDisplayPdf()
:write
:!xelatex % && pdf %<.pdf
endfunction
command Compile call TexCompileAndDisplayPdf()
""" display
function TexDisplayPdf()
:!pdf %<.pdf
endfunction
command Display call TexDisplayPdf()
--------------------%<--------------------------
By the way, the -vim/after/{ftplugin,plugin,...} tree is the intended
place for customization. The files in the .vim/after tree are loaded
AFTER (hence the name) the main files thus overriding the default
settings. Furthermore customizations of the main plugin files will be
lost on updates, the ./vim/after tree is left untouched on update.
Regards, Ruthard
>== Auszüge aus der Nachricht von Mario D vom 2016-02-23 09:21:
> 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
> 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
--
Dr. Ruthard Baudach
Speckertsweg 36a
97209 Veitshöchheim
----
Emails bitte verschlüsseln und signieren.
Meine PGP-Id: 0xAC5AC6C2
|