Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am familiar with the creation of multiple indexes using the multind package. One of the required steps is to run the makeindex executable for each generated .idx file. A typical solution would be do do something along the following lines (this is unix; windows users look the other way):

for file in *.idx; do
    makeindex ${file}

A disadvantage of this approach is that it may process too many .idx files. Is there an easy way to determine which .idx files are really required?

share|improve this question
@martin Thanks for the link. I want to have a solution where I don't need to know about the names of the index files. They should be detected automatically. Why do you think the link is relevant? –  Marc van Dongen Jan 2 '12 at 14:58
add comment

2 Answers

up vote 4 down vote accepted

Just use a Makefile (or a utility such as latexmk, latexmake, latex-make).

For example, create a Makefile file: (<TAB> stands for a tabulation character):

indexes := $(patsubst %.idx,%.ind,$(wildcard *.idx))
all: $(indexes) # and other stuff
%.ind: %.idx
<TAB>   makeidx $^

Then, just issue a make command. This can be obviously enhanced, but make is really a good starting point.

share|improve this answer
Dubac Thanks. I'll have a look at the Makefile option. I had tried latexmk but that didn't work (unless I did something wrong). –  Marc van Dongen Jan 2 '12 at 9:56
add comment

multind is not the package of choice for multiple indexes: it's almost featureless and too simplistic. The UK TeX FAQ entry Multiple indexes lists some other possibilities


The last one (of which I'm one of the authors) frees you from the problem, as it executes automatically makeindex.

share|improve this answer
Thanks for that. Unfortunately, I need the information for multind. Does automatically running makeindex require enabling write18? –  Marc van Dongen Jan 2 '12 at 10:50
@MarcvanDongen If you have a recent TeX Live (2010 or later) or MiKTeX 2.9, makeindex is listed in the allowed programs for the "restricted shell-escape" that's enabled by default. –  egreg Jan 2 '12 at 10:55
Yes, I remember I just read that two days ago:) Funny how easy you (well, I) forget things like this. –  Marc van Dongen Jan 2 '12 at 10:57
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.