arara 🦜
Nota
Tutto il materiale qui presentato si basa sulle informazioni presenti nel manuale versione 7.1.5 di arara.
Introduzione
arara is a TeX automation tool based on rules and directives. It gives you a way to enhance your TeX experience. The tool is an effort to provide a concise way to automate the daily TeX workflow for users. The key part of arara is the automation of the process of interlacing TeX, running tools, and generating the output. The tool is a standalone application written in Java, and it is available for all major operating systems.
arara aims at explicit instructions in the source code (in the form of comments) in order to determine what to do.
A very important concept
That is the major difference of arara when compared to other tools: it is not an automatic process and the tool does not employ any guesswork on its own. You are in control of your documents; arara will not do anything unless you teach it how to do a task and explicitly tell it to execute the task.
Now, how does one tell arara to do a task? That is actually the easy part.
You just need to add a comment in your source code. The comment is a directive that tells arara what to do. The directive is a special comment that starts with % arara: followed by the task name. The task name is a reference to a rule that arara knows how to execute.
An arara directive is usually defined in a line of its own.
% arara: pdflatex
\documentclass{article}
\begin{document}
Hello world!
\end{document}Attenzione
Our example has one directive, referencing pdflatex. It is important to observe that the pdflatex identifier does not represent the command to be executed, but the name of the rule associated with that directive.
Once arara finds a directive, it will look for the associated rule. it will look for a rule named pdflatex which will evidently run the pdflatex command line application. Rules are YAML files named according to their identifiers followed by the yaml extension and follow a strict structure.
Rules and directives are the core concepts of arara: the first dictates how a task is done, and the latter is the proper instance of the associated rule on the current document, i.e, when and where the commands must be executed.
That is pretty much how arara works: directives in the source code are mapped to rules.
Regole che vale la pena conoscere
| Rule | Description |
|---|---|
pdflatex | Runs the pdflatex engine on the document. It is a common rule in arara. |
lualatex | Runs the lualatex engine on the document. It is a common rule in arara. |
biber | Runs the biber application on the document. It is a common rule in arara. |
makeglossaries | Runs the makeglossaries application on the document. It is a common rule in arara. |
makeindex | Runs the makeindex application on the document. It is a common rule in arara. |
clean | Removes all auxiliary files generated by the compilation process. It is a good practice to run this rule before sharing your source code with others. |
Configurazione
Per configurare arara bisogna creare un file araraconfig.yaml nella directory di lavoro. Questo file contiene le configurazioni di arara e le regole personalizzate.
!config
...Ciclo di compilazione
% Template per Elaborato di Laurea
% DISI - Dipartimento di Ingegneria e Scienza dell’Informazione
%
% update 2015-09-10
%
% Per la generazione corretta del
% pdflatex nome_file.tex
% bibtex nome_file.aux
% pdflatex nome_file.tex
% pdflatex nome_file.tex