# How to compile glossaries with arara without Perl?

I don't want to install Perl. I am using arara for building. I make use of the glossaries package.

Can I compile my document without the makeglossaries help script (I don't want to install Perl)? I use biblatex as well.

Currently my arara directives look like this:

% arara: xelatex
% arara: biber
% arara: xelatex
% arara: clean: {files ... blah blah


Where would I need to put the glossary compilation command? Does it have to be before or after xelatex compilation?

Thank you very much.

• Should be able to add makeglossaries anywhere between the two xelatex lines. – Mike Renfro Mar 3 '14 at 17:11
• @MikeRenfro If I'm not mistaken, arara doesn't replace any of the programs it fires off—it merely provides a convenient way to do so. OP seems to be asking for a non-Perl makeglossaries, which is unlikely to exist, unfortunately. That said, I really doubt that you don't have Perl installed, OP. So many things use it in TeX distributions—it's often just included. (Just because it isn't in your PATH doesn't mean it's not there :)) – Sean Allred Mar 3 '14 at 17:57
• Hm... I am pretty sure it's not installed (I am using Miktex). But from what I understand makeglossaries is simply a wrapper around makeindex. I guess I want to run that directly. Is this not a standard practice? Thanks. – Andriy Drozdyuk Mar 3 '14 at 18:12
• I don't know if there's anyway of accessing the base file name within an arara directive, but if your file is called, say, test.tex then you can do % arara: makeindex: {style: test.ist, options: "-t test.glg -o test.gls test.glo"} – Nicola Talbot Mar 3 '14 at 18:23
• @Nicola, please post this as an answer. – Andriy Drozdyuk Mar 4 '14 at 18:07

cmhughes's answer is best for general purposes, but you can also just use the makeindex directive however you need to explicitly write the file names. If your LaTeX file is called myDoc.tex then the following will work:

% arara: makeindex: {style: myDoc.ist, options: "-t myDoc.glg -o myDoc.gls myDoc.glo"}


(Avoid spaces in the file names.) That will just create the main glossary. If you've used the acronyms option you will need to have a similar line for the list of acronyms:

% arara: makeindex: {style: myDoc.ist, options: "-t myDoc.alg -o myDoc.acr myDoc.acn"}


Similarly if you have additional glossaries (either created explicitly via \newglossary or via other package options such as index).

If you want to sort by letter order instead of word order you need to add -l to the options list.

(The advantage of the makeglossaries script is that it reads the .aux file to find out which glossaries the document has defined, what their corresponding file extensions are, and whether to use makeindex or xindy. TeX Live comes with its own Perl interpreter. The only inconvenience is for MiKTeX users, but MiKTeX and Perl Scripts (and one Python script) provides instructions for MiKTeX.)

Edit: arara v4.0 has a makeglossarieslite rule which can be used to invoke makeglossaries-lite.lua, the Lua alternative to makeglossaries. Since LuaTeX requires a Lua interpreter, one should already be available with modern TeX systems.

Although makeglossaries-lite.lua doesn't have the full set of functions that makeglossaries has, it still has the advantage of being able to pick up the glossary information from the .aux file that an explicit call to makeindex can't do and so will work with any number of custom glossaries defined within the document.

Following Nicola Talbot's comment, and the output from arara, we know that the makeglossaries rule is really just a short cut for:

makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo


As such, we can make an arara do this for us by using @{getBasename(file)}.

# makeglossariesNP.yaml

!config
# Make glossaries *without perl* rule for arara
# author: Chris Hughes
# last edited by: cmh, March 3rd 2014
# https://tex.stackexchange.com/questions/163474/how-to-compile-glossaries-with-arara-without-perl
# requires arara 3.0+
#
# Sample usage
#
# % arara: makeglossariesNP
#
identifier: makeglossariesNP
name: makeglossariesNP
commands:
- <arara> makeindex -s @{getBasename(file)}.ist -t @{getBasename(file)}.glg -o @{getBasename(file)}.gls @{getBasename(file)}.glo
arguments: []


# myfile.tex

% arara: pdflatex
% !arara: makeglossaries
% arara: makeglossariesNP
% arara: pdflatex
\documentclass{article}
\usepackage{glossaries}
\newglossaryentry{equation}{name=equation,description={an equation usually involves at least one variable, and
has two sides; typically we will try and solve an equation for one of the unknown variables}}
\newglossaryentry{expression}{name=expression,description={an expression usually involves at least one variable--
in contrast to an equation, an expression does not have two sides, and will often need to be simplified (not solved)
in some way}}

\makeglossaries

\begin{document}


• Is there any way of adapting this rule to specify alternate extensions for .glg / .gls / .glo (e.g. .alg / .acr / .acn for the acronym list)? – Nicola Talbot Mar 4 '14 at 9:00
• @drozzy arara rules can be put in different directories and you can specify those directories in a arara-config file. Please refer to arara manual. – user11232 Mar 4 '14 at 22:18