automake package option uses the shell escape to generate the external files. This is analogous to
imakeidx's automatic feature.
Addressing your comments:
You write that it probably does not work for xindy. Why that?
automake option can work with
xindy if you have the unrestricted shell escape on, but not if the restricted mode is on (which is usually the default for most TeX distributions).
makeindex is considered a trusted application and may be run through the shell escape in restricted mode, but
xindy isn't on the trusted list so it requires the unrestricted shell escape. (This also applies to
If you look at the
texmf.cnf file, you should find the following comment:
% we'd like to allow:
% dvips - but external commands can be executed, need at least -R1.
% epspdf, ps2pdf, pstopdf - need to respect openout_any,
% and gs -dSAFER must be used and check for shell injection with filenames.
% pygmentize - but is the filter feature insecure?
% ps4pdf - but it calls an unrestricted latex.
% rpdfcrop - maybe ok, but let's get experience with repstopdf first.
% texindy,xindy - but is the module feature insecure?
xindy has been considered for inclusion on the trusted list, but there's a security query which has prevented its addition.
The other problem is that you must make sure you set the language and code page exactly as required by
makeglossaries script maps known
babel language labels to the appropriate label expected by
xindy. For example if you have
makeglossaries picks up the language label
ngerman from the
.aux file, but knows that it needs to map this to
-L german. The
makeglossaries script can pick up the
uft8 encoding, but it will additionally add
din5007 since no codepage has been specified in the document that includes
automake option doesn't have this level of sophistication and will simply try
-L ngerman -C utf8, which won't work.
So if you want the above
ngerman example to work with
automake, it must be written as:
If run in restricted mode this doesn't create the glossary file and the log file contains:
runsystem(xindy -I xindy -L german -M test -C din5007-utf8 -t test.glg
-o test.gls test.glo)...disabled (restricted).
(where the document was called
test.tex.) The shell escape must be enabled:
pdflatex -shell-escape test
automake option is considered a last resort because it lacks the sophistication of the
the LaTeX code doesn't map
babel language labels to
the LaTeX code doesn't know about special cases for particular languages (such as the requirement of the
german module to include one of
makeglossaries script analyses the transcript files if something goes wrong and will try to give a more intelligible message since some of the messages (especially from
xindy) are quite cryptic;
makeglossaries script can correct some problems. In particular it detects
makeindex's "multiple encaps" warning and will try to fix the problem.
These kinds of tasks are far easier and far more efficient to do with a scripting language, such as Perl, than attempting it with TeX.
How can i find out whether I have to rerun latex after the makeindex
You will always need to run LaTeX after
makeindex as it's
makeindex that creates the files read by
\printglossaries). This is the same as for
You may need an extra
xindy run if the page numbers change between builds. For example, the inclusion of a table of contents where the page numbering isn't reset at the start of the front matter, can cause the indexed page numbers to change. This problem also occurs with
Another case that requires the glossary files to be rebuilt is if an entry is only referenced by another entry in the glossary. The most common case is when the
see key is used.
latex only include the
foo entry can't be indexed until it's processed when the glossary file is read. This means that another
latex run are required.
Alternatively, if you use the extension package
glossaries-extra, it will search for the
see key of all used entries at the end of the document and automatically index them if they haven't been used.
This means that only
latex are required.