Next Previous Contents

2. xindy Usage

2.1 I don't want to write style files. How can I proceed?

You can use the wrapper program makeindex4. It tries to do it's very best to make xindy behave as makeindex does. But if you ever need to use some of the features of xindy you should learn how to write an index style. Its easy!

2.2 How do I use makeindex4?

Process your document as usual. Then run makeindex4 on the index file. It produces an index that should equal the one you would get with an ordinary makeindex run. As far as you are satisfied with the default behaviour of makeindex, makeindex4 will produce comparable results.

Some of the command-line options of makeindex are accepted by makeindex4, others aren't. This may change in future releases, but we recommend using plain xindy after a phase of investigation, since one cannot use all of its features with makeindex4. You will be informed about unsupported command-line arguments when running makeindex4.

If you have written special style files for makeindex they will no longer work with makeindex4. Go ahead and write a new style file for xindy.

2.3 How works makeindex4?

This job is now done automatically by makeindex4. It calls tex2xindy to transform the raw-index into the format suitable for xindy. tex2xindy emits some information about the attributes (aka. encapsulators in makeindex) and the usage of cross-references into a file, which has the extension `.sta'. The makeindex4 program, written in perl, parses this statistics-file and generates the above presented indexstyle commands for you automatically including the required declaration of all attributes in the whole index and their markup.

Another problem is the automatic detection of cross-references. As noted above, makeindex handles cross-references with its encapsulation mechanism, a scheme which has been dropped in xindy and replaced by a more powerful mechanism. To implement a simple plug-in mechanism we have extended the syntax of the tex2xindy filter to identify encapsulators of the form

\indexentry{...|encap{...}}{...}

as a cross-reference, whereas encapsulators of the form

\indexentry{...|encap}{...}

are treated as ordinary attributes. This is standard practice defining cross-references in makeindex. Thus, tex2xindy distinguishes these two forms of encapsulators as opposed to makeindex and our plug-in makeindex4 generates the appropriate definitions of the cross-reference classes as well.


Next Previous Contents