Does anyone have a rule which allows to call Pythontex
from Arara? I'd like to run the following set of commands for example:
%!TEX TS-program = Arara
% arara: pdflatex
% arara: pythontex
% arara: pdflatex
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityBased on an example from http://texwelt.de/wissen/fragen/4944/wie-kann-ich-arara-auf-das-nomentbl-paket-anwenden-um-ein-formelzeichenverzeichnis-zu-erstellen I managed to create a working version:
!config
# pythontex rule for arara
# author: Uwe Ziegenhagen
# requires arara 3.0+
identifier: pythontex
name: pythontex
command: <arara> pythontex @{options} "@{getBasename(file)}.pytxcode"
arguments:
- identifier: style
flag: <arara> @{parameters.style}
default: pythontex
- identifier: options
flag: <arara> @{parameters.options}
I have saved it under the name pythontex.yaml
under <Drive>:\texlive\2016\texmf-dist\scripts\arara\rules
, it seems to work as desired.
It proved actually to be not-so-hard to create basic working rule for PythonTeX
in arara 5.1
pythontex.yaml
!config
# pythontex rule for arara
# author: Uwe Ziegenhagen, Tomas Krulis
# requires arara 5.0+
# According to: https://tex.stackexchange.com/questions/357881/arara-rule-for-pythontex
identifier: pythontex
name: pythontex
commands:
- name: PythonTeX and now for something completely different
command: >
@{
return getCommand('pythontex', options, getBasename(reference))
}
arguments:
- identifier: options
flag: >
@{
if (isList(parameters.options)) {
return parameters.options;
}
else {
throwError('I was expecting a list of options.');
}
}
arara
developers about uppgrading/making the rule more confirmant among other officially supported. But they agreed to add them among other officially supported ruesl, so, yay! If result would be "better" rule, Ill edit post. But, this just plainly "works."
Apr 15, 2020 at 5:38
For Arara 4.x the following rule should work like the one given for Arara 3.x
!config
# pythontex rule for arara
# author: Uwe Ziegenhagen
# requires arara 4.0+
identifier: pythontex
name: pythontex
commands:
- command: <arara> pythontex @{options} "@{getBasename(file)}.pytxcode"
arguments:
- identifier: style
flag: <arara> @{parameters.style}
default: pythontex
- identifier: options
flag: <arara> @{parameters.options}
arara
rules modeled after the existing ones (which can be found in/usr/local/texlive/2016/texmf-dist/scripts/arara/rules
in TeXLive).