Thanks for the hints. I was able to adapt compiler.vim and texrc. I'm sending the diff, in case anyone else might need it.


 Felipe G. Nievinski wrote:
Re: [Vim-latex-devel] calling makeindex during compilation
From: Ted Pavlic <[EMAIL PROTECTED]> - 2008-04-11 13:06
 > I guess you could do something similar with latex-suites compiler
 > dependency stuff (see :help compiler-dependency), setting the chain
 > to nlo,nls,dvi and setting compilation rules for .nls and .nlo. That
 > would be your homework.

A few things...

*) As with makeindex, bibtex, etc., you'll often have to run latex twice
after the makeindex call:


In fact, there are some (ALMOST pathological) times when latex will need
to be run yet again (and possibly makeindex again). Writing a Makefile
to do all of this isn't trivial (though it's been done -- it's easy to
find lots of very complete latex Makefile solutions on-line).

*) If you build all of this logic into your Makefile, you should
probably turn it off within Vim-LaTeX, or it may try to run LaTeX more
than it needs to.

*) I've actually modified my ~/.vim/ftplugin/latex-suite/compiler.vim
file so that it runs makeindex not only if it sees idx files, but also
if it sees other files for makeindex (like glo for glossaries or acr for
acronyms). I'm not comfortable with distributing my own compiler.vim
(for fear that I'll forget to tell you to also change something in
texrc), but it may be a good idea to try hacking your own compiler.vim
so that it responds to new .nlo files. Open up compiler.vim and search
for "makeindex". You'll find the section. The flow isn't hard to follow.

Best --

 > Happy hacking (and vimming)
 > Martin
 > On Thu, Apr 10, 2008 at 05:28:26PM -0300, Felipe G. Nievinski wrote:
 >> Hi.
 >> I'm using the "nomenclature" latex package [1].
 >> It requires the following command
 >> makeindex mydoc.nlo -s -o mydoc.nls
 >> in between latex runs.
 >> Could you give me a hint on how I could use the Vim-Latex suite to
 >> automatize that intermediary call to makeindex, please? I'd like to
 >> keep doing simply \ll, then.
 >> I've tried searching at the mailing list archive, to no avail.
 >> Thanks, Felipe.
 >> [1]
 >> <> A
 >> snippet: The creation of the nomenclature list is very similar to
 >> the creation of an index [6, App. A]. You need to: o Put
 >> \usepackage[hoptionsi]{nomencl} in the preamble of your document. o
 >> Put \makenomenclature in the preamble of your document. o Issue
 >> the \nomenclature command (see Section 2.2) for each symbol you
 >> want to have included in the nomenclature list. o Put
 >> \printnomenclature at the place you want to have your nomenclature
 >> list.
 >> Now put your file through LATEX. The command \makenomenclature will
 >> instruct LATEX to open the nomenclature file <filename>.nlo
 >> corresponding to your LATEX file <filename>.tex and to write the
 >> information from your \nomenclature commands to this file.
 >> The next step is to invoke MakeIndex. You should instruct MakeIndex
 >> to use <filename>.nlo as your input file, use as your
 >> style file, and write output to the file <filename>.nls. How to do
 >> this depends on your implementation of MakeIndex. For most UNIX
 >> implementations you should write something like makeindex
 >> <filename>.nlo -s -o <filename>.nls
 >> Now you have the file <filename>.nls that contains your
 >> nomenclature list properly ordered. The last step is to invoke
 >> LATEX on your master file <filename>.tex once more. It will input
 >> your .nls file and process it accordingly to the current options.
 >> That’s all!
>       let nloFileName = mainFileName_root.'.nlo'
>               let nlolinesBefore = Tex_CatFile(nloFileName)
<                       exec 'silent! make '.mainFileName_root
>                       exec 'silent! make '.mainFileName_root.'.idx'
>                       let &mp = temp_mp
>                       let needToRerun = 1
>               endif
>               let nlolinesAfter = Tex_CatFile(nloFileName)
>               " If .nlo file changed, then run makeindex to generate the new 
> .nls
>               " file and remember to rerun latex.
>               if runCount == 0 && glob(nloFileName) != '' && nlolinesBefore 
> != nlolinesAfter
>                       echomsg "Running makeindex nomenclature..."
>                       let temp_mp = &mp | let &mp = 
> Tex_GetVarValue('Tex_MakeIndexFlavor')
>                       exec 'silent! make '.mainFileName_root.'.nlo -s 
> -o '.mainFileName_root.'.nls'
< " specifies the MakeIndedx flavor and if necessary options. $* will be
< " replaced by the *root* of the main file name. See above.
< TexLet g:Tex_MakeIndexFlavor = 'makeindex $*.idx'
> " specifies the MakeIndedx flavor and if necessary options. 
> TexLet g:Tex_MakeIndexFlavor = 'makeindex'
This email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2.;198757673;13503038;p?
Vim-latex-devel mailing list

Reply via email to