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.)
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 Edit→Preferences 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.
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:
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: bibtex
% arara: makeglossaries
% arara: makeindex
% arara: pdflatex: { synctex: on }
% arara: pdflatex: { synctex: on }
\documentclass
{scrbook}
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.
Note:
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"
arguments:
- 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}
So if you'd rather use texindy instead of makeindex you can replace the
% arara: makeindexdirective with
% arara: texindy: { language: english, codepage: latin1 }(Change the language and encoding as appropriate.)
Footnotes
- ... 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).