configuring viewer in latex-suite

778 views
Skip to first unread message

A. Torgovitsky

unread,
Jun 19, 2009, 12:28:09 PM6/19/09
to vim...@googlegroups.com
Hi all, I'm trying to set my viewer in latex-suite to be evince. Here's
what I put in my ~/.vim/ftplugin/tex.vim file:
let g:Tex_defaultTargetFormat = 'pdf'
let g:Tex_ViewRule_pdf = 'evince'

An \ll successfully compiles my file. When I try \lv to view the file I
see from the command bar in gvim that "call Tex_ViewLateX()" is being
issued, but I get no window of any sort. (Of course I checked that
"evince" actually is the right command and that it is in the path.) Any
suggestions? Thanks

bill lam

unread,
Jun 19, 2009, 6:06:49 PM6/19/09
to vim...@googlegroups.com
On Fri, 19 Jun 2009, A. Torgovitsky wrote:
> > Hi all, I'm trying to set my viewer in latex-suite to be evince. Here's
> what I put in my ~/.vim/ftplugin/tex.vim file:
> let g:Tex_defaultTargetFormat = 'pdf'
> let g:Tex_ViewRule_pdf = 'evince'

I put the followings in my ~/.vimrc

let g:tex_flavor='latex'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_ViewRule_pdf='xpdf'

acroread also works for me but I don't use evince because it depends
on gnome.

FYI

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

A. Torgovitsky

unread,
Jun 19, 2009, 6:15:46 PM6/19/09
to vim...@googlegroups.com
Thanks...I should clarify. It's not that evince doesn't work in
particular, I can replace 'evince' with another program and it still
doesn't work. I put things in tex.vim because that's how the
documentation on latex-suite suggested...putting them in /.vimrc did not
work for me.

bill lam

unread,
Jun 19, 2009, 10:30:28 PM6/19/09
to vim...@googlegroups.com
On Fri, 19 Jun 2009, A. Torgovitsky wrote:
>
> Thanks...I should clarify. It's not that evince doesn't work in
> particular, I can replace 'evince' with another program and it still
> doesn't work. I put things in tex.vim because that's how the
> documentation on latex-suite suggested...putting them in /.vimrc did not
> work for me.

Did you get the pdf after \ll and open that pdf manually without
problem? You may also confirm evince or other viewer is working
properly by executing in vim's command mode

:!evince /path/to/pdf

Denis-Alexander Engemann

unread,
Jun 19, 2009, 5:47:10 PM6/19/09
to v...@vim.org
Hi!

I had the same issues, but unfortunately my way fixing it was not that systematic...

First of all - sorry if that might be too simple - did you set the compiler rule appropriately in your vim.tex?

let g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'

Another thing that seemed to help was to set evince as the standard viewer for dvi files as well.

let g:Tex_ViewRule_dvi = 'evince'


I hope that helps,

ciao Denis


2009/6/19 A. Torgovitsky <atorgo...@gmail.com>

A. Torgovitsky

unread,
Jun 20, 2009, 2:16:49 PM6/20/09
to vim...@googlegroups.com
thanks I have all those and still the same problem.

Denis-Alexander Engemann wrote:
> Hi!
>
> I had the same issues, but unfortunately my way fixing it was not that
> systematic...
>
> First of all - sorry if that might be too simple - did you set the
> compiler rule appropriately in your vim.tex?
>
> let g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'
>
> Another thing that seemed to help was to set evince as the standard
> viewer for dvi files as well.
>
> let g:Tex_ViewRule_dvi = 'evince'
>
>
> I hope that helps,
>
> ciao Denis
>
>
> 2009/6/19 A. Torgovitsky <atorgo...@gmail.com
> <mailto:atorgo...@gmail.com>>

A. Torgovitsky

unread,
Jun 20, 2009, 2:17:56 PM6/20/09
to vim...@googlegroups.com
yes I \ll does compile the .pdf and I can open it just fine. Also, if I
manually command :!evince ~/sample.pdf then it will open up like its
supposed to.

mysterious....some sort of bug in the viewing function in latex-suite?

Denis-Alexander Engemann

unread,
Jun 19, 2009, 5:47:10 PM6/19/09
to v...@vim.org
Hi!

I had the same issues, but unfortunately my way fixing it was not that systematic...

First of all - sorry if that might be too simple - did you set the compiler rule appropriately in your vim.tex?

let g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'

Another thing that seemed to help was to set evince as the standard viewer for dvi files as well.

let g:Tex_ViewRule_dvi = 'evince'


I hope that helps,

ciao Denis


2009/6/19 A. Torgovitsky <atorgo...@gmail.com>

bill lam

unread,
Jun 20, 2009, 10:23:59 PM6/20/09
to vim...@googlegroups.com
On Sat, 20 Jun 2009, A. Torgovitsky wrote:
>
> yes I \ll does compile the .pdf and I can open it just fine. Also, if I
> manually command :!evince ~/sample.pdf then it will open up like its
> supposed to.
>
> mysterious....some sort of bug in the viewing function in latex-suite?

It just works for me so that I've no idea of what's wrong. May be you
could use a wrapper for evince to log the arguments passed from vim.
Or if everything fails, write a vim macro to open pdf for current
latex file.

A. Torgovitsky

unread,
Jun 21, 2009, 8:31:48 AM6/21/09
to vim...@googlegroups.com
well thanks for the help anyway...I'll contact the developers and see
what they say...

A. Torgovitsky

unread,
Jun 24, 2009, 11:19:24 AM6/24/09
to vim...@googlegroups.com
I found the bug, maybe this can help others.

In the "compiler.vim" file located in ~/.vim/ftplugin/latex-suite on
line 289, change the line
let execString = s:viewer.' $*.'.s:target.' &'
to
let execString = s:viewer.' $*.'.s:target

i.e. remove the ampersand which opens the process in the background.

For some reason on Ubuntu 8.10 using gvim 7.1, the evince (or other
viewers) will not open when there's an ampersand but will open without
it. (Why??)

mayhem

unread,
Apr 2, 2017, 10:54:48 AM4/2/17
to vim_use
I have an update for users using gVim on Windows:
Open "compiler.vim" file found in ~/.vim/ftplugin/latex-suite
Search for all occurrences of start. Add a space between start and opening single quote.

Reason: gVim will not accept parameters when you execute :!start, instead for you to pass an argument, there must be space before start. So, the command will look like :! start <file-name>. We are just adding that space in front of all executable start commands present in the file.

Worked flawlessly for me.
Note: I have also set Tex_defaultTargetFormat and Tex_ViewRule_pdf.
Reply all
Reply to author
Forward
0 new messages