MacVim, LaTeX and Skim: a summary

2,567 views
Skip to first unread message

Daniele Avitabile

unread,
Mar 2, 2008, 9:01:35 AM3/2/08
to vim...@googlegroups.com
Hi everybody,

my configuartion: Mac OS 10.5.2, MacVim snapshot 22, visualising with Skim 1.0.3. I've already read all the other topics about this matter, especially the contributions from Ted Pavlic. Here is my report

Compiling in LaTeX: the shorcut \ll for compilation does not work when the .tex file MacVim is dragged/dropped from a MacVim.app instance or when it's double-clicked. The same command does work when MacVim is launched from the command line mvim. Ted Pavlic proposed an alternative mvim.app that, once substituded to MacVim.app works fine. Any chance to make mvim.app to substitute MacVim.app in the next snapshot? This is where to download mvim.app 

 
Inverse search: I've followed the instructions given by Ted at 
  1. write a line \usepackage{pdfsync} in the latex file
  2. in Skim under Preferences>Sync choose Custom Preset, and then set Command to mvim and Arguments to --remote-tab-silent +":%line;foldo!" "%file" 
  3. Shift+Command+Click in Skim and it will jump back to the corresponding line in the source file. 
This doesn't work at all for me. Any ideas why?

Forward search: Ted seems to have a patch for this as well, which I haven't tried yet. 

As Ted precious informations are scattered in many different places (and in my case, I didn't manage to get them to work for inverse search), my proposal is to gather as many informations as possible in one single place about MacVim, Vim-LaTeX and Skim. I will be happy to write a post or whatever else to facilitate LaTeX MacVim Leopard users. 

Does any of the previous things (Compilation, Forward Search, Inverse Search) work for you? 

Best.

Daniele

Robin

unread,
Mar 2, 2008, 9:33:03 AM3/2/08
to vim...@googlegroups.com

I don't know how much help it is, but everything works for me!
I've never noticed any problems with \ll (make sure "Launch vim
processes in a login shell" is selected in preferences). This should
be all that's necessary - I don't think a modified .app is required to
make this work.

For forward search, I patched compiler.vim with
VIM-LaTeX-osx-inverse-search-compiler.patch from:
http://phaseportrait.blogspot.com/2007/07/vim-latex-modification-forward.html

Then in my .vimrc I have:
let g:Tex_ViewRule_pdf = 'Skim'

and forward searching seems to work fine with Skim (It's not perfect,
the red dot doesn't always end up in exactly the right place but its
normally the right paragraph).

Reverse searching also works fine. I have:
mvim
--remote-silent +":%line;foldo!" "%file"

as my options in skim (I used remote-silent since I don't like tabs).
When I shift-command-click in Skim, the cursor is sent the appropriate
position in macvim (but it doesn't grab focus, I think it used to but
I lost my settings on a Skim upgrade and can't remember what I had
before). Also it can get a bit confused and sometimes opens a new
window on the file if there are lots of macvim windows open, but if
you close it and launch it from Skim (by forward searching) then
backwards/forwards seems to work without any trouble.

Hope this is some help...

Cheers

Robin

d.avi...@gmail.com

unread,
Mar 2, 2008, 10:34:36 AM3/2/08
to vim_mac
Robin,

I didn't know about the "Launch vim processes in a login shell" in
the preferences. I selected and now everything works fine by me.
Thanks!

On Mar 2, 2:33 pm, Robin <robi...@gmail.com> wrote:
> On Sun, Mar 2, 2008 at 2:01 PM, Daniele Avitabile <d.avitab...@gmail.com> wrote:
> > Hi everybody,
>
> > my configuartion: Mac OS 10.5.2, MacVim snapshot 22, visualising with Skim
> > 1.0.3. I've already read all the other topics about this matter, especially
> > the contributions from Ted Pavlic. Here is my report
>
> > Compiling in LaTeX: the shorcut \ll for compilation does not work when the
> > .tex file MacVim is dragged/dropped from a MacVim.app instance or when it's
> > double-clicked. The same command does work when MacVim is launched from the
> > command line mvim. Ted Pavlic proposed an alternative mvim.app that, once
> > substituded to MacVim.app works fine. Any chance to make mvim.app to
> > substitute MacVim.app in the next snapshot? This is where to download
> > mvim.app
>
> >http://links.tedpavlic.com/zip/
>
> > Inverse search: I've followed the instructions given by Ted at
> >http://phaseportrait.blogspot.com/2007/12/pdfsync-inverse-searches-in...
> > In summary:
>
> > write a line \usepackage{pdfsync} in the latex file
> > in Skim under Preferences>Sync choose Custom Preset, and then set Command to
> > mvim and Arguments to --remote-tab-silent +":%line;foldo!" "%file"
> > Shift+Command+Click in Skim and it will jump back to the corresponding line
> > in the source file.
> > This doesn't work at all for me. Any ideas why?
>
> >  Forward search: Ted seems to have a patch for this as well, which I haven't
> > tried yet.
>
> > As Ted precious informations are scattered in many different places (and in
> > my case, I didn't manage to get them to work for inverse search), my
> > proposal is to gather as many informations as possible in one single place
> > about MacVim, Vim-LaTeX and Skim. I will be happy to write a post or
> > whatever else to facilitate LaTeX MacVim Leopard users.
>
> > Does any of the previous things (Compilation, Forward Search, Inverse
> > Search) work for you?
>
> > Best.
>
> > Daniele
>
> I don't know how much help it is, but everything works for me!
> I've never noticed any problems with \ll (make sure "Launch vim
> processes in a login shell" is selected in preferences). This should
> be all that's necessary - I don't think a modified .app is required to
> make this work.
>
> For forward search, I patched compiler.vim with
> VIM-LaTeX-osx-inverse-search-compiler.patch from:http://phaseportrait.blogspot.com/2007/07/vim-latex-modification-forw...

Ted Pavlic

unread,
Mar 3, 2008, 9:11:30 AM3/3/08
to vim_mac
> and forward searching seems to work fine with Skim (It's not perfect,
> the red dot doesn't always end up in exactly the right place but its
> normally the right paragraph).

Note that this has less to do with Skim as it does with pdfsync.

Pdfsync is meant to mirror the source specials that you get with DVI's.
You can encode much more information with DVI source specials than you
can with pdfsync (it's a fundamental difference between DVI's and
PDF's). So, the positioning isn't going to be "ideal," but it at least
gets you close.

--Ted


--
Ted Pavlic <t...@tedpavlic.com>

Ted Pavlic

unread,
Mar 3, 2008, 9:15:45 AM3/3/08
to vim_mac
> As Ted precious informations are scattered in many different places
> (and in my case, I didn't manage to get them to work for inverse
> search), my proposal is to gather as many informations as possible in
> one single place about MacVim, Vim-LaTeX and Skim. I will be happy to
> write a post or whatever else to facilitate LaTeX MacVim Leopard
> users.

This may help:

http://phaseportrait.blogspot.com/search/label/MacVim

Ted Pavlic

unread,
Mar 3, 2008, 9:14:16 AM3/3/08
to vim_mac
> I didn't know about the "Launch vim processes in a login shell" in
> the preferences. I selected and now everything works fine by me.
> Thanks!

Did that fix your inverse searching problems (from Skim) too?

If shift+command+click wasn't bringing you back into MacVim, I can't
think of a reason why the "Launch processes" preference would have fixed
that. Maybe there was a typo in your Skim prefs?

d.avi...@gmail.com

unread,
Mar 3, 2008, 9:52:22 AM3/3/08
to vim_mac
Hi Ted,

yes, that fixed everything, and I haven't modified my skim preferences
at all. Don't know what to say. Thanks also for the link. Now
everything seems to work fine.

Cheers.

Daniele

brettc

unread,
Mar 4, 2008, 7:59:50 AM3/4/08
to vim_mac
Hi all,

Slightly off-topic, but I find latexmk (rather than the build in Vim-
LaTeX) very nice to use with MacVim and Skim. It has an option to
watch all relevant files (bib files too!) and rebuilds whenever they
change.

I set Skim as my default viewer and put this in my ~/.latexmkrc
$pdf_previewer = "open" ;
$clean_ext = "paux lox pdfsync out" ;

I start a shell with and issue:
latexmk -pdf -pvc mydocument.tex in MacVim.

Then I start editing mydocument.tex. Every time I save it, latexmk
rebuilds it. So when I switch to it, it is already up to date...

Look here for latexmk:
http://www.phys.psu.edu/~collins/software/latexmk-jcc/

Brett



http://www.phys.psu.edu/~collins/software/latexmk-jcc/

Daniele Avitabile wrote:
> Hi everybody,
> my configuartion: Mac OS 10.5.2, MacVim snapshot 22, visualising with Skim
> 1.0.3. I've already read all the other topics about this matter, especially
> the contributions from Ted Pavlic. Here is my report
>
> Compiling in LaTeX: the shorcut \ll for compilation does not work when the
> .tex file MacVim is dragged/dropped from a MacVim.app instance or when it's
> double-clicked. The same command does work when MacVim is launched from the
> command line mvim. Ted Pavlic proposed an alternative mvim.app that, once
> substituded to MacVim.app works fine. Any chance to make mvim.app to
> substitute MacVim.app in the next snapshot? This is where to download
> mvim.app <http://links.tedpavlic.com/zip/>
>
> http://links.tedpavlic.com/zip/
>
> Inverse search: I've followed the instructions given by Ted at
> http://phaseportrait.blogspot.com/2007/12/pdfsync-inverse-searches-in-macvim.htmlIn
> summary:
>
> 1. write a line \usepackage{pdfsync} in the latex file
> 2. in Skim under Preferences>Sync choose Custom Preset, and then set
> Command to mvim and Arguments to --remote-tab-silent +":%line;foldo!"
> "%file"
> 3. Shift+Command+Click in Skim and it will jump back to the

Ted Pavlic

unread,
Mar 4, 2008, 4:54:22 PM3/4/08
to vim_mac
Decent point (if you want to build *every* time).

That being said, also note that Vim-LaTeX's build will run bibtex as
needed. In fact, I *believe* that with the patches mentioned in the
links below, it will even rebuild with makeindex/makeglossary/etc.
(though that may just be in my personal copy).

--Ted

--
Ted Pavlic <t...@tedpavlic.com>

Ted Pavlic

unread,
Mar 5, 2008, 5:09:36 PM3/5/08
to vim_mac
I want to add two additional important notes about using Vim-LaTeX (and
Vim 7):

http://phaseportrait.blogspot.com/2008/03/vim-latex-vim-70-and-filetype-plugin.html

http://phaseportrait.blogspot.com/2008/03/fixing-vim-latex-compiler-error.html

If your Vim-LaTeX is not activating when you open .tex files, see the
first link. If compiler errors keep opening the WRONG file, see the
second link.

--Ted

Daniele Avitabile wrote:
> Hi everybody,
>
> my configuartion: Mac OS 10.5.2, MacVim snapshot 22, visualising with
> Skim 1.0.3. I've already read all the other topics about this
> matter, especially the contributions from Ted Pavlic. Here is my
> report
>
> Compiling in LaTeX: the shorcut \ll for compilation does not work
> when the .tex file MacVim is dragged/dropped from a MacVim.app
> instance or when it's double-clicked. The same command does work when
> MacVim is launched from the command line mvim. Ted Pavlic proposed an
> alternative mvim.app that, once substituded to MacVim.app works fine.
> Any chance to make mvim.app to substitute MacVim.app in the next
> snapshot? This is where to download mvim.app
> <http://links.tedpavlic.com/zip/>
>
> http://links.tedpavlic.com/zip/
>
> Inverse search: I've followed the instructions given by Ted at
> http://phaseportrait.blogspot.com/2007/12/pdfsync-inverse-searches-in-macvim.html
> In summary:
>

> 1. write a line \usepackage{pdfsync} in the latex file 2. in Skim


> under Preferences>Sync choose Custom Preset, and then set Command to

> mvim and Arguments to --remote-tab-silent +":%line;foldo!" "%file" 3.


> Shift+Command+Click in Skim and it will jump back to the
> corresponding line in the source file.
>
> This doesn't work at all for me. Any ideas why?
>
> Forward search: Ted seems to have a patch for this as well, which I
> haven't tried yet.
>
> As Ted precious informations are scattered in many different places
> (and in my case, I didn't manage to get them to work for inverse
> search), my proposal is to gather as many informations as possible in
> one single place about MacVim, Vim-LaTeX and Skim. I will be happy to
> write a post or whatever else to facilitate LaTeX MacVim Leopard
> users.
>
> Does any of the previous things (Compilation, Forward Search, Inverse
> Search) work for you?
>
> Best.
>
> Daniele
>
>
> >

--
Ted Pavlic <t...@tedpavlic.com>

d.avi...@gmail.com

unread,
Mar 6, 2008, 8:28:24 AM3/6/08
to vim_mac
Great! Thanks

On Mar 5, 10:09 pm, Ted Pavlic <t...@tedpavlic.com> wrote:
> I want to add two additional important notes about using Vim-LaTeX (and
> Vim 7):
>
> http://phaseportrait.blogspot.com/2008/03/vim-latex-vim-70-and-filety...
>
> http://phaseportrait.blogspot.com/2008/03/fixing-vim-latex-compiler-e...
>
> If your Vim-LaTeX is not activating when you open .tex files, see the
> first link. If compiler errors keep opening the WRONG file, see the
> second link.
>
> --Ted
>
>
>
> Daniele Avitabile wrote:
> > Hi everybody,
>
> > my configuartion: Mac OS 10.5.2, MacVim snapshot 22, visualising with
> >  Skim 1.0.3. I've already read all the other topics about this
> > matter, especially the contributions from Ted Pavlic. Here is my
> > report
>
> > Compiling in LaTeX: the shorcut \ll for compilation does not work
> > when the .tex file MacVim is dragged/dropped from a MacVim.app
> > instance or when it's double-clicked. The same command does work when
> > MacVim is launched from the command line mvim. Ted Pavlic proposed an
> > alternative mvim.app that, once substituded to MacVim.app works fine.
> > Any chance to make mvim.app to substitute MacVim.app in the next
> > snapshot? This is where to download mvim.app
> > <http://links.tedpavlic.com/zip/>
>
> >http://links.tedpavlic.com/zip/
>
> > Inverse search: I've followed the instructions given by Ted at
> >http://phaseportrait.blogspot.com/2007/12/pdfsync-inverse-searches-in...

d.avi...@gmail.com

unread,
Mar 11, 2008, 5:42:04 AM3/11/08
to vim_mac
Hi everybody,

my configuration of Vim+Vim-LaTeX+Skim on Leopard doesn't seem to be
particularly robust. As reported previously, I managed for one day to
obtain forward and inverse search, but now both features seem to be
inactive again. I honestly do not know what's wrong. Here is a
summary:

MacVim 7.1(23): yes, I have the new snapshot installed, but the
forward/inverse search wouldn't work with snapshot 22 either. I have
"Launch Vim processes in a login shell" enabled in my preferences.

Vim-LaTeX suite: it is installed in my .vim folder, as instructed on
Vim-LaTeX website. I write my Vim-LaTeX related settings in .vim/
ftplugin/tex.vim, as stated in the documentation. Here is my tex.vim
file

---------------------------------------------------------------------------------------------------
let g:Tex_DefaultTargetFormat = 'pdf'

let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
let g:Tex_CompileRule_ps = 'dvips -Pwww -o $*.ps $*.dvi'
let g:Tex_CompileRule_pspdf = 'ps2pdf $*.ps'
let g:Tex_CompileRule_dvipdf = 'dvipdfm $*.dvi'
let g:Tex_CompileRule_pdf = 'pdflatex $*'

let g:Tex_ViewRule_dvi = 'texniscope'
let g:Tex_ViewRule_ps = 'Preview'
let g:Tex_ViewRule_pdf = 'Skim'

let g:Tex_FormatDependency_ps = 'dvi,ps'
let g:Tex_FormatDependency_pspdf = 'dvi,ps,pspdf'
let g:Tex_FormatDependency_dvipdf = 'dvi,dvipdf'

let g:Tex_IgnoredWarnings ='
\"Underfull\n".
\"Overfull\n".
\"specifier changed to\n".
\"You have requested\n".
\"Missing number, treated as zero.\n".
\"There were undefined references\n".
\"Citation %.%# undefined\n".
\"\oval, \circle, or \line size unavailable\n"'
---------------------------------------------------------------------------------------------------

Skim: in preferences>sync I have
Preset: custom
Command: mvim
Arguments: --remote-silent +":%line;foldo!" "%file"

When I Shift+Command+Click from Skim nothing happens. When I \ls from
MacVim, I can see a :call Tex_ForwardSearchLaTeX appear, but nothing
more. No red spots, nothing.

Can you spot something I've done wrong? If you have a successfull
forward/inverse search from skim, can you please tell me where you
install vim-latex and your setttings? Also, do you need any further
informations from me? So far I have seen the search tool working only
for one moment on my computer...

Best.

Daniele

On Mar 6, 1:28 pm, "d.avitab...@gmail.com" <d.avitab...@gmail.com>
wrote:
> Great! Thanks
>
> On Mar 5, 10:09 pm, Ted Pavlic <t...@tedpavlic.com> wrote:
>
> > I want to add two additional important notes about using Vim-LaTeX (and
> > Vim 7):
>
> >http://phaseportrait.blogspot.com/2008/03/vim-latex-vim-70-and-filety...
>
> >http://phaseportrait.blogspot.com/2008/03/fixing-vim-latex-compiler-e...
>
> > If your Vim-LaTeX is not activating when you open .tex files, see the
> > first link. If compiler errors keep opening the WRONG file, see the
> > second link.
>
> > --Ted
>
> > Daniele Avitabile wrote:
> > > Hi everybody,
>
> > > my configuartion: Mac OS 10.5.2, MacVim snapshot 22, visualising with
> > >  Skim1.0.3. I've already read all the other topics about this
> > > matter, especially the contributions from Ted Pavlic. Here is my
> > > report
>
> > > Compiling in LaTeX: the shorcut \ll for compilation does not work
> > > when the .tex file MacVim is dragged/dropped from a MacVim.app
> > > instance or when it's double-clicked. The same command does work when
> > > MacVim is launched from the command line mvim. Ted Pavlic proposed an
> > > alternative mvim.app that, once substituded to MacVim.app works fine.
> > > Any chance to make mvim.app to substitute MacVim.app in the next
> > > snapshot? This is where to download mvim.app
> > > <http://links.tedpavlic.com/zip/>
>
> > >http://links.tedpavlic.com/zip/
>
> > > Inverse search: I've followed the instructions given by Ted at
> > >http://phaseportrait.blogspot.com/2007/12/pdfsync-inverse-searches-in...
> > >  In summary:
>
> > > 1. write a line \usepackage{pdfsync} in the latex file 2. inSkim
> > > under Preferences>Sync choose Custom Preset, and then set Command to
> > > mvim and Arguments to --remote-tab-silent +":%line;foldo!" "%file" 3.
> > > Shift+Command+Click inSkimand it will jump back to the
> > > corresponding line in the source file.
>
> > > This doesn't work at all for me. Any ideas why?
>
> > > Forward search: Ted seems to have a patch for this as well, which I
> > > haven't tried yet.
>
> > > As Ted precious informations are scattered in many different places
> > > (and in my case, I didn't manage to get them to work for inverse
> > > search), my proposal is to gather as many informations as possible in
> > > one single place about MacVim, Vim-LaTeX andSkim. I will be happy to

d.avi...@gmail.com

unread,
Mar 11, 2008, 10:19:49 AM3/11/08
to vim_mac
I am really sorry to have bothered with such a stupid thing. In my new
document I had indeed forgotten to load pdfsync.

Everything works fine with the settings I have posted above.

Sorry again.

Daniele

On Mar 11, 9:42 am, "d.avitab...@gmail.com" <d.avitab...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages