With the current version of arara
which is available via CTAN, it's quite difficult. However Paulo provides a new arara
version at GitHub which won't be uploaded to CTAN in a short time.
The new version has some nice gimmicks which are well explained in the Wiki.
If you are using arara 4RC3
you can use the following header:
% arara: pdflatex: { shell: true } if missing ('use.pstricks.true')
% arara: pstricks if exists ('use.pstricks.true')
The rule pstricks
could be:
!config
# pstricks rule for arara
# author: Marco Daniel
# requires arara 4.0+
identifier: pstricks
name: LATEX-DVIPS-PS2PDF
commands:
- <arara> latex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}"
- <arara> dvips "@{getBasename(file)}.dvi" -o "@{getBasename(file)}.ps" @{dvipsoptions}
- <arara> ps2pdf @{ps2pdfoptions} "@{getBasename(file)}.ps" "@{output}.pdf"
arguments:
#arguments for convertion
- identifier: output
flag: <arara> @{parameters.output}
default: <arara> @{getBasename(file)}
- identifier: dvipsoptions
flag: <arara> @{parameters.options}
- identifier: ps2pdfoptions
flag: <arara> @{parameters.options}
#arguments for latex
- identifier: action
flag: <arara> --interaction=@{parameters.action}
- identifier: shell
flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")}
- identifier: synctex
flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")}
- identifier: draft
flag: <arara> @{isTrue(parameters.draft,"--draftmode")}
- identifier: options
flag: <arara> @{parameters.options}
pdflatex
directive. I've written a rule for compiling vialatex->dvips->ps2pdf
. Generally, I compile withpdflatex
so I sometimes forget that I need to use the other route when working withpstricks
. So I'd like to build an arara rule which checks for the existence of a file.design/use.pstricks.true
and if present arara will call thelatex->dvips->ps2pdf
rule, otherwise it will invoke thepdflatex
directive. – A.Ellett Jan 4 '14 at 17:28