Latest news 2021-06-05: New blog post: Dickimaw Books Site Account.

1.1.2 Arara

As mentioned in §1.1. Building Your Document, arara is a Java application that automates the process of building a LaTeX document. In order to use arara, you must have the Java Runtime Environment installed. The latest TeX Live distribution includes arara, so you can install it via the TeX Live package manager.

Alternative, you can install arara manually as follows: fetch the installer arara-3.0-installer.jar (or arara-3.0-installer.exe) from https://github.com/cereda/arara/tree/master/releases. On Windows, run arara-3.0-installer.exe. On other operating systems run arara-3.0-installer.jar in privileged mode. For example, on a Unix-based system:

sudo java -jar arara-3.0-installer.jar
(If you are doing a manual install make sure you check the box to add the predefined rules, as shown in Figure 1.7.)

Figure 1.7: Arara Installer

Once arara has been installed, you can add it to the list of tools in TeXworks. As before, open the TeXwork's Preferences dialog box using EditPreferences and select the “Typesetting” tab (Figure 1.4).

To add a new tool, click on the lower + button next to the list of processing tools. This opens the tool configuration dialog box (Figure 1.8). Type “Arara” in the “Name” box and use the “Browse” button to find the arara application on your computer. Use the + button to add $basename to the list of arguments, as shown in Figure 1.8.

Figure 1.8: Adding Arara in the TeXWorks Tool Configuration Dialog

Unlike latexmk, arara doesn't read the log file to determine what applications need to be run. Instead, you tell arara how to build your document by placing special comments in your source code. For example, if your document contains the following:

% arara: pdflatex: { synctex: on }
% arara: bibtex
% arara: pdflatex: { synctex: on }
% arara: pdflatex: { synctex: on }

Then running arara on the document will run pdflatex, bibtex, pdflatex and pdflatex on your document. Arara knows the rules “pdflatex” and “bibtex”. It also knows the rules “biber”, “makeglossaries” and “makeindex”. So, if your document has a bibliography, an index and glossaries, you need to put the following comments in your source code (replace bibtex with biber if required):

% arara: pdflatex: { synctex: on }
% arara: bibtex
% arara: makeglossaries
% arara: makeindex
% arara: pdflatex: { synctex: on }
% arara: pdflatex: { synctex: on }

Now you just need to select “Arara” from the drop-down list in TeXworks (Figure 1.9) and click the green “Typeset” button, and arara will do all the work for you.


If you don't add these arara comments to your source code, nothing will happen when you run arara on your document! You must remember to provide arara with the rules to build your document.

Figure 1.9: Using Arara in TeXworks

Unfortunately arara (v3.0) doesn't have a rule for texindy, but you can add one by creating a file called texindy.yaml that contains the following:1.4

# TeXindy rule for arara
# requires arara 3.0+
identifier: texindy
name: TeXindy
command: <arara> texindy @{german} @{language} @{codepage} @{module} @{input} @{options} "@{getBasename(file)}.idx"
- identifier: german
  flag: <arara> @{isTrue(parameters.german,"-g")}
- identifier: language
  flag: <arara> -L @{parameters.language}
- identifier: codepage
  flag: <arara> -C @{parameters.codepage}
- identifier: module
  flag: <arara> -M @{parameters.module}
- identifier: input
  flag: <arara> -I @{parameters.input}
- identifier: options
  flag: <arara> @{parameters.options}
This file should be saved in the rules subdirectory of the arara installation directory. (For example, on Unix-like systems /usr/local/arara/rules/texindy.yaml.)

So if you'd rather use texindy instead of makeindex you can replace the

% arara: makeindex
directive with
% arara: texindy: { language: english, codepage: latin1 }
(Change the language and encoding as appropriate.)


... following:1.4
Thanks to Paulo Cereda for supply this.

This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-02-9).

© 2013 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs