Ceci est une ancienne révision du document !
Comment générer plusieurs index?
Les capacités d'indexation usuelles de (fournies par l'extension makeidx) ne permettent d'obtenir qu'un seul index dans votre document. Cependant, même des documents assez modestes peuvent être améliorés par la présence d'index pour des sujets distincts.
Avec l'extension multind
L'extension multind permet de générer facilement plusieurs index. Il modifie légèrement les commandes d'indexation afin que l'utilisateur puisse spécifier, pour chaque entrée, l'index concerné.
Traduction à poursuivre.
You tag each \makeindex
, \index
and \printindex
command with a file name, and indexing commands are written to (or read from) the name with the appropriate (idx
or ind
) extension appended. The \printindex
command is modified from an old version of the LaTeX 2.09 standard so that it doesn't create its own chapter or section heading; you therefore decide what names (or sectioning level, even) to use for the indexes, and ''\indexname'' is completely ignored.
To create a “fruits” and an “legumes” index, one might write:
\usepackage{multind} \makeindex{fruits} \makeindex{legumes} ... \index{fruits}{poire} \index{legumes}{haricot} \index{fruits}{pomme} ... \printindex{fruits}{Index des fruits} \printindex{legumes}{Index des légumes} ...
To complete the job, run LaTeX on your file enough times that labels, etc., are stable, and then execute the commands
makeindex fruits makeindex legumes
before running LaTeX again. Note that the names of the index files to process are not necessarily related to the name of the LaTeX file you're processing, at all. (There's no documentation that comes with the package: what you see above is as good as you will get…)
The multind package doesn't work with the AMSLaTeX classes, but the AMS provide a substitute, the amsmidx package. You use the amsmidx package pretty much the same as you would multind, but if things aren't clear, there is documentation (unlike multind).
Avec l'extension index
The index package provides a comprehensive set of indexing facilities, including a \newindex
command that allows the definition of new styles of index. \newindex
takes a “tag” (for use in indexing commands), replacements for the idx
and ind
file extensions, and a title for the index when it's finally printed; it can also change the item that's being indexed against (for example, one might have an index of artists referenced by the figure number where their work is shown).
Using index, to create an author index together with a “normal” index, one would start with preamble commands:
\usepackage{index">index} \makeindex \newindex{aut}{adx}{and}{Name Index}
which load the package, define a “main” (original-style) index, and then define an author index. Then, in the body of the document, we might find commands like:
\index[aut]{Another Idiot} ... \index{FAQs}
Which place an entry in the author index, and then one in the main index. At the end of the document, we have two commands:
\printindex \printindex[aut]
Which will print the main index and then the author index. Supposing this lot to be in myfile.tex
, after enough runs through LaTeX that labels are stable, execute the following commands (Unix-style shell commands shown here, but the principle is the same whatever system you're using) :
makeindex myfile makeindex myfile.adx -o myfile.and
and rerun LaTeX. The makeindex
commands process myfile.idx
to myfile.ind
(the default action), and then myfile.adx
to myfile.and
, the two files needed as input by the two \printindex
commands in myfile.tex
.
Avec l'extension splitidx
The splitidx package can operate in the same way as the others: load the package with the split
option, and declare each index with a \newindex
command:
''\newindex[<index name>]{<shortcut>}''
and splitidx will generate a file \jobname.<shortcut>
to receive index entries generated by commands like \sindex[<shortcut>]{<item>}
. As with the other packages, this method is limited by TeX's total number of output files. However, splitindex also comes with a small executable splitindex
(available for a variety of operating systems); if you use this auxiliary program (and don't use split
), there's no limit to the number of indexes. Apart from this trick, splitidx supports the same sorts of things as does index. An example of use appears in the documentation.
Avec l'extension imakeidx
The imakeidx package can do a wide range of things (in particular, it can run an index-builder — via ''\write18'' commands — so as to simplify business of making the final copy of a document). The package can also make multiple indexes; it can do the job in the conventional (multind) way, or by using the external splitindex
script provided with the splitindex package. (This arrangement allows efficient operation with small numbers of indexes, while retaining the flexibility of permitting large numbers of indexes without hitting the restriction of numbers of active output streams.)
Avec la classe memoir
The memoir class has its own multiple-index functionality (as well as its own index layout options, which other packages delegate to the index style used by makeindex
).
Source: Multiple indexes