Others(g)vim - close viewer automatically

Information and discussion about other LaTeX editors not listed above
Post Reply
terp
Posts: 1
Joined: Wed Aug 25, 2010 8:04 pm

(g)vim - close viewer automatically

Post by terp »

Information:
Editor: (G)vim 7.3 + latex-suite for vim
OS: Windows XP sp3
tex distribution: Miktex 2.8
Viewer: Adobe Reader 9

Hi,

Does anyone know how to force gvim or miktex? to close the pdf viewer (Adobe Reader) automatically when a latex file is compiled? At the moment I have to close the viewer manually before compilation.

Kind regards,
Terp

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

(g)vim - close viewer automatically

Post by frabjous »

Have you considered switching to SumatraPDF for viewing, which not only doesn't lock the PDF, but would support SyncTeX forward/reverse search with gVim? (I.e., clicking a part of the PDF would bring you to the corresponding part of the code and vice-versa)? (Some info on this, and a patch for vim-latex to support this can be found here.)

If you're really intent on using Adobe Reader (which I think is a horrendous piece of software), I can think of only two ways to make this work: (1) an AutoHotKey script, which when called from Vim, switches to Adobe reader and kills it, then compiles the source, then reopens Adobe reader, or (2) have vim call the DDE command recognized by Adobe Reader to do the same (some details here). I'd investigate further myself, but I don't use Windows.
Post Reply