Re: [Vim-latex-devel] Help with Compile
Brought to you by:
srinathava,
tmaas
From: Alan S. <ala...@po...> - 2003-03-24 14:20:03
|
* Tom Newman (new...@US...) wrote: > Hello, > > I'm trying to figure out why I can't get the compiler to work with > LaTeX-Suite. I had this problem, so I wrote a small patch for compiler.vim. This patch makes the following behavior change: - if a something.latexmain file is present, "\ll" calls latex on that file instead of make - otherwise, if no something.latexmain exists, it either calls make if there is a Makefile, or it calls latex on the current file. Here is the patch (to apply on today's cvs) schmitta@alan-schm1p:/usr/src/latexvim/vimfiles/ftplugin/latex-suite> cvs diff Index: compiler.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/compiler.vim,v retrieving revision 1.22 diff -u -p -r1.22 compiler.vim --- compiler.vim 4 Mar 2003 22:58:13 -0000 1.22 +++ compiler.vim 24 Mar 2003 14:16:29 -0000 @@ -90,17 +90,11 @@ function! RunLaTeX() " close any preview windows left open. pclose! - " If a *.latexmain file is found, then use that file to - " construct a main file. - if Tex_GetMainFileName() != '' - let mainfname = Tex_GetMainFileName() - else - " otherwise just use this file. + " if a makefile and no *.latexmain exists, just use the make utility + " this also sets mainfname for the rest of the function + let mainfname = Tex_GetMainFileName() + if (glob('makefile') != '' || glob('Makefile') != '') && mainfname == '' let mainfname = expand("%:t:r") - endif - - " if a makefile exists, just use the make utility - if glob('makefile') != '' || glob('Makefile') != '' let _makeprg = &l:makeprg let &l:makeprg = 'make $*' if exists('s:target') @@ -110,6 +104,11 @@ function! RunLaTeX() endif let &l:makeprg = _makeprg else + " otherwise, if a *.latexmain file is found, then use that file to + " construct a main file. + if mainfname == '' + let mainfname = expand("%:t:r") + endif exec 'make '.mainfname endif Hope this helps, Alan -- The hacker: someone who figured things out and made something cool happen. |