2

Motivation: I would like to copy a file foo.bar to \jobname.bar before every pdflatex run. So I thought, I could modify an existing arara rule.

I wanted to try the hello.yaml rule for arara from this answer: https://tex.stackexchange.com/a/119246/36296

!config
# Hello world
# author: Chris Hughes, Paulo Cereda
# last edited by: cmh, June 14th 2013
# requires arara 3.0+
#
# Sample usage: 
#
# % arara: hello
# % arara: hello: {name: A.Ellett}
#
# This rule is really just a shortcut for commands like the following
#
#   hello
# or
#   hello A.Ellett
#
identifier: hello
name: hello
commands: 
- <arara> bash -i -c hello @{name}
arguments: 
- identifier: name
  flag: <arara> @{parameters.name}
  default: "world"

But if I try to run this rule with

% arara: hello

in my .tex file, I get the following error message:

I have spotted an error in rule 'hello' located at
'<path to arara>/rules'. I could not parse the rule,
something bad happened. Apparently, the provided YAML file is
invalid. I will do my best to help you in any way I can. There
are more details available on this exception:

DETAILS ---------------------------------------------------------
Cannot create property=commands for
JavaBean=com.github.cereda.arara.model.Rule@55a1c291
 in
'reader', line 1, column 1:
    !config
    ^
No single argument
constructor found for class
com.github.cereda.arara.model.RuleCommand
 in 'reader', line 21,
column 1:
    -   <arara> bash -i -c hello @{name}
    ^

(I replaced <path to arara> in the above message, as the original one contained my user name; I have other custom .yaml files for arara in the same location which work flawlessly)

The bash function itself seems to work. If I do

bash -i -c hello sam

within a terminal, I get

Hello, sam!

as expected.

I am using arara 4.0. Any ideas what might be wrong?

  • I am sorry, but can you give me a link to arara v4 installation file for download? – Diaa Aug 12 '17 at 20:07
  • 1
    @DiaaAbidou You can get the source code from github.com/cereda/arara and build it yourself from source. You can find some instructions in the readme file. – user36296 Aug 12 '17 at 20:14
4

I think you actually want something like this:

!config
# Hello world
# author: Chris Hughes, Paulo Cereda
# last edited by: cmh, June 14th 2013
# requires arara 3.0+
#
# Sample usage: 
#
# % arara: hello
# % arara: hello: {name: A.Ellett}
#
# This rule is really just a shortcut for commands like the following
#
#   hello
# or
#   hello A.Ellett
#
identifier: hello
name: hello
commands: 
- command: <arara> bash -i -c hello @{name}
arguments: 
- identifier: name
  flag: <arara> @{parameters.name}
  default: "world"
3

Don't you want something like this?

!config
# Hello world
# author: Chris Hughes, Paulo Cereda
# last edited by: cmh, June 14th 2013
# requires arara 3.0+
#
# Sample usage: 
#
# % arara: hello
# % arara: hello: {name: A.Ellett}
#
# This rule is really just a shortcut for commands like the following
#
#   hello
# or
#   hello A.Ellett
#
identifier: hello
name: hello
command: <arara> bash -i -c hello @{name}
arguments:
- identifier: name
  flag: <arara> @{parameters.name}
  default: "world"
# vim: set nospell:
  • Thanks a lot for your answer! As far as I can see, your solution works perfectly with arara 3.0, but unfortunately I do get the same error as above with arara 4.0, which I need for my workflow :( – user36296 Nov 29 '16 at 9:32
  • @samcarter Oh, sorry. I missed that. Where do you get 4.0 from? – cfr Nov 29 '16 at 17:26
  • 1
    Sorry for hiding this information on the bottom of my question. I compiled version 4.0 from its source: github.com/cereda/arara . It has all kinds of fantastic new features, see github.com/cereda/arara/wiki/New-feature-highlights-in-4.0. Personally I love the ability to check if some files have changed or if the log contains specific strings to trigger compilations. – user36296 Nov 29 '16 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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