Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible to create an arara rule which possibly invokes other arara rules?

I've managed to write an arara rule which conditionally executes a command.

!config
# open rule for arara
# author: AEllett
# requires arara 3.0+
identifier: open
name: PREVIEW
commands:
  - <arara>  @{isTrue ( isFile ("./.design/open.pdf.true"), 
                        "open ".concat(getBasename(file)).concat('".pdf"')
                        ""
                      )}
arguments: []

what I would like to do is write a similar rule which would conditionally invoke another arara rule.

share|improve this question
    
What's your aim? –  Marco Daniel Jan 4 at 16:40
2  
@MarcoDaniel arara already comes with a pdflatex directive. I've written a rule for compiling via latex->dvips->ps2pdf. Generally, I compile with pdflatex so I sometimes forget that I need to use the other route when working with pstricks. 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 the latex->dvips->ps2pdf rule, otherwise it will invoke the pdflatex directive. –  A.Ellett Jan 4 at 17:28
    
This can be achieved inside the tex file with arara 4 which is only available via github: github.com/cereda/arara/wiki/Features-in-arara-4.0 –  Marco Daniel Jan 4 at 20:07

1 Answer 1

up vote 8 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.