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 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.

share|improve this question
    
Should be able to add makeglossaries anywhere between the two xelatex lines. –  Mike Renfro Mar 3 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 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. –  drozzy Mar 3 at 18:12
1  
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 at 18:23
    
@Nicola, please post this as an answer. –  drozzy Mar 4 at 18:07

2 Answers 2

up vote 5 down vote accepted

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.)

share|improve this answer

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
# http://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}

\glsaddall
\printglossary
\end{document}
share|improve this answer
    
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 at 9:00
    
Is there any way to specify this directly in .tex file without the additional yaml file? –  drozzy Mar 4 at 17:44
    
Sadly, this solution is rather cumbersome, as it requires me to add my project location to the search path for the rules. The original comment by Nicola is, while admittedly less general, is much simpler and convenient. –  drozzy Mar 4 at 18:06
    
whoever down voted, please detail why –  cmhughes Mar 4 at 18:08
    
@cmhughes Sorry, I downvoted not because the answer is bad, but because the approach is currently not viable because arara has o way of discovering rules in the local directory. I prefer the other approach of hard-coded inline directives. I shouldn't have downvoted in retrospect --- I was only doing so comparative to the other possibility. –  drozzy Mar 4 at 18:46

Your Answer

 
discard

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.