> Yes, I think that is the standard behaviour.  It annoyed me a bit, so I 
> added in
> ~/vimfiles/ftplugin/latex-suite/compiler.vim the function:
> function! Tex_SaveCompileView()
>     silent! update
>     call Tex_RunLaTeX()
>     call Tex_ViewLaTeX()
> endfunction
> And inside "function! <SID>Tex_SetCompilerMaps()" I added
> call Tex_MakeMap(s:ml."lz", "<Plug>Tex_SaveCompileView", 'n', '<buffer>')
> so that now "\lz" saves the tex file, compiles, and opens the viewer.

Wouldn't (in .vimrc):

:map \lz \ll\lv<CR>

be simpler than modifying Vim-LaTeX?


A few other points:

1. Many Vim-LaTeX users have PDF (or DVI) viewers that do autorefreshing 
(Skim and TeXniscope in OS/X are terrific examples; Yap in Windows works 
too). In that case, \lv and \ll are all that's needed. Every time an \ll 
completes, the PDF viewer autorefreshes. On Linux, I *believe* kpdf 
autorefreshes (or did at one point).

2. If you really do need to call your PDF viewer EVERY TIME you build, 
you could add an "&& viewer" line in your CompileRule. That should be 
roughly equivalent to adding an "\lz" command (I understand that the 
viewer will get called more than is necessary when Vim-LaTeX runs latex 
several times, but it's a start).

3. Remember that Vim-LaTeX will pass your build target to "make" if it 
finds a Makefile in the current directory (additionally, if you have 
multiple TeX files, you can create a dummy file ending in ".latexmain" 
with the same root name as your main TeX file. That lets Vim-LaTeX know 
what to do when you call \lv (or \lz)). In that case, your makefile can 
do some of the heavy loading (e.g., running the viewer).

4. I've modded my own Vim-LaTeX so that if a flag is set and the target 
is DVI, it runs a dvi-to-pdf command *after* all of the latex runs 
(rather than creating a PDF on each latex run). A similar fix could be 
applied here. That is, if a flag is set, after everything in an "\ll" is 
done, run the viewer.

In the end, I think this problem is solved for most people by either:

*) having an auto-refreshing PDF viewer,

*) adding a ":map" command to their .vimrc that implements an "\lz"


HTH --
--Ted









> 
> Hope that helps,
> Simon
> 
> On Wed, Jun 18, 2008 at 11:21 AM, Simon Friedberger 
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
> 
>      > Iirc it should be enough to set it to 'evince' on UNIX/Linux
>     systems, the
>      > filename and ampersand are added by default.
>     It does not work without.
> 
>      > But it is not ViewRuleComplete but ViewRule that you need to
>     change to 'evince'.
>     I think you misunderstood me. The command works I just wondered if it
>     should be executed automatically after compilation.
> 
>     Bye
>            Simon
> 
>     -------------------------------------------------------------------------
>     Check out the new SourceForge.net Marketplace.
>     It's the best place to buy or sell services for
>     just about anything Open Source.
>     http://sourceforge.net/services/buy/index.php
>     _______________________________________________
>     Vim-latex-devel mailing list
>     Vim-latex-devel@lists.sourceforge.net
>     <mailto:Vim-latex-devel@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/vim-latex-devel
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Vim-latex-devel mailing list
> Vim-latex-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

-- 
Ted Pavlic <[EMAIL PROTECTED]>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to