arara
was recently included in TeX Live 2012, as seen in the output of
$ tlmgr info arara
package: arara
category: Package
shortdesc: Automation of LaTeX compilation.
...
installed: Yes
revision: 29052
cat-version: 3.0
cat-date: 2013-02-06 08:25:13 +0100
cat-license: bsd
collection: collection-binextra
Did you update your TeX Live distro recently? If not, maybe arara
is missing from the repositories. A quick tlmgr update --self --all
will ensure an update to every single package and tool available in the TL tree to their last revisions.
With arara
deployed in TL, open your terminal and try
$ arara
__ _ _ __ __ _ _ __ __ _
/ _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_| \__,_|_| \__,_|
arara 3.0 - The cool TeX automation tool
Copyright (c) 2012, Paulo Roberto Massa Cereda
All rights reserved.
usage: arara [file [--log] [--verbose] [--timeout N] [--language L] |
--help | --version]
-h,--help print the help message
-L,--language <arg> set the application language
-l,--log generate a log output
-t,--timeout <arg> set the execution timeout (in milliseconds)
-v,--verbose print the command output
-V,--version print the application version
TeX Live takes care of adding a symbolic link to the arara.sh
script which calls arara.jar
with the operating system's Java Virutal Machine (if I recall correctly, Ubuntu comes with at least OpenJDK, which arara
is compliant).
If you cannot get the output, maybe the TeX Live 2012 bin/
folder was not added to the path. Try running which pdflatex
in your terminal and see the full path, it should have mention to the TL2012 install. If not, you might need to include the correct folder. Of course, it depends how you installed TeX Live in the first place.
According to the user manual, go to Preferences,
then go to Typesetting path, and click the + button in the Processing tools.
Now select the path to arara
. Note that in this image, I used the path provided with the standalone installer of arara
, since you are using the TeX Live version, stick with the link available in TL's /bin
folder.
Then arara
is available in the Profiles list.
Hope it helps. :)
Update: If we are talking about the TeX Live 2012 version available through Ubuntu's own repositories and not the TL version from TUG (a.k.a vanilla), arara
is not available.
The best option, in this case, is to use the standalone installer available in the project repository. For more information on how to install arara
with the installer, I kindly suggest Chapter 2 of the manual.
Best Answer
Lasciate ogne speranza, voi ch'intrate.
(La Divina Commedia, Dante Alighieri)
Time for one the most insane answers I ever came up with.
:)
You are right thatarara
does not allow wildcards, and the reason for this is a restriction of the underlying execution library. Wildcard usage might be understood as some sort of subshell expansion and there is no way to (directly) askarara
and its inner mechanisms to make a command likerm *.log
work. Personally, I'd favour a more indulgent execution layer, but so far, the current execution library (namely Apache Commons Exec) works in the general case. There is actually a bug in the library when trying to parse command arguments with spaces (Nicola and I tracked the error down and found out it was an already well-known bug - I'm watching their bugtrackers very closely), but the library itself works fine in most of the cases. In the future, I might write my own execution layer, but time is problematic right now.:)
The
arara
userbase has been growing way out of my expectations and people are using the tool for tasks I've never imagined. For example, I never thought I'd need some sort ofFileSystem
helper methods, but apparently this would be a nice addition for rulewriters.Now, back to your question.
:)
Short answer: No, it's not possible to ask
arara
to perform wildcard expansion in the task execution context.Long answer: As mentioned in the prologue, the underlying execution library does not allow this since it's a form of subshell expansion, and subshells (roughly speaking, calls inside calls) are definitely forbidden.
Insane answer: I can make it work. The most sneaky way ever possible to mankind. Here's how. Beware, the following lines may get really complicated.
In the rule context, we have orb tags that allow an underlying expression language to be interpreted. What I can do is exploiting this feature in order to run an arbitrary method from the Java API that does the task I want. The problem is, the expression language has a lot of restrictions, and I cannot inject code the way I want.
A way to deal with these restrictions is to provide a method chain that returns a set of valid elements in evaluation context. More precisely,
arara
makes use of some interesting libraries, and I can use their methods if I know their full namespaces.Sadly, there is a big problem:
arara
does not have an IO library (at least, version3.0
from CTAN). Then we need to make some magic happen.Disclaimer: in order to make this answer work, we cannot use the CTAN (or installer) version alone, so some sort of new batch command in order to wrap the full line is required (at least, for convenience). I'll do things locally here.
I will use the Apache Commons IO library for this trick. The link will resolve to a file named
commons-io-2.4-bin.zip
. We just need one file from the whole pack:commons-io-2.4.jar
Another way of running
arara
instead of the usualis
in which we provide the main class of the application based on classpath lookup. Now, I will make Commons IO part of the application classpath by doing this:
If I recall correctly, the path separator in Linux is
:
, but in Windows, it's;
, so your mileage may vary. Note that I'm considering both.jar
files to be in the same directory; it might be a good idea to write the full path or, if you prefer, you can add both to theCLASSPATH
variable in your user/system environment variables, then the lookup becomes easier. Anyway.Now that I injected an IO library, let's write a rule:
Beautiful, isn't it?
:)
And it's untested, woohoo! I didn't try it on Windows, so let's see if things get really bad pretty soon.:P
This rule injects Java code inside the expression language context, and it does:
parameters.pattern
which you'll set in your directive)" "
."a" "b" "c"
.Long story short: I did the wildcard expansion instead of asking
arara
to do it (it wouldn't do it anyway). Quite scary and error-prone, but hey, it's funny!:)
Time to test it!
:)
It even works with patterns:
However, there is a problem. By design.
For version
3.0
, rule expansion happens before the execution of all rules (It's worth noting that I want to change this behaviour in later versions). So, if you haveafter running
arara hello.tex
, you will end up withhello.tex
,hello.pdf
andhello.log
! Why? Let's see whatarara
does in this case:pdftex
rule, which will becomepdftex hello.tex
.cleanpattern
rule, which will becomerm -rf
because at this moment, there's nohello.log
yet! After all, this rule depends on the former.Nothing I can do about it, I am afraid. Sorry.
:(
At least with the current version3.0
. I'm working hard on changing this. Note that the original decision was not a bad idea per se, but as I said,arara
grew up to a huge userbase with cases that the tool wasn't originally prepared to cover.Summary: It's possible to get wildcard expansion through a (kinda hackish) code injection, but since the event happens on rule expansion and not on execution, it won't deal with eventual file dependencies generated by previous rule executions.