I wanted to automate conversion from pdf to animated gif with animate rule provided by cmhughes in answer to plotting the sequence x_n using tikz.

I'm using arara+texworks+miktex on windows. I also have imagemagick installed and working from command line.

I've saved cmhughes code as animate.yaml in my \rules folder. I add

% arara: pdflatex
% arara: animate

to my tex file (as example, this pgfplots code) and compile it with arara. The result is a correct pdf file but when starts animate it shows a message with

Running animate ...

Parámetro no válido: 10

Parámetro no válido means non valid parameter and I don't know which program (arara, convert) shows it.

I'm using arara from TeXworks with options --log and --verbose. After compiling a tex file, arara.log contains:

05 Jun 2013 15:52:58.687 INFO  Arara - Welcome to arara!
05 Jun 2013 15:52:58.687 INFO  Arara - Processing file '117309.tex', please wait.
05 Jun 2013 15:52:58.703 INFO  DirectiveExtractor - Reading directives from 117309.tex.
05 Jun 2013 15:52:58.703 TRACE DirectiveExtractor - Directive found in line 1 with animate: {density: 200, delay: 10}.
05 Jun 2013 15:52:58.812 INFO  DirectiveParser - Parsing directives.
05 Jun 2013 15:52:58.812 INFO  TaskDeployer - Deploying tasks into commands.
05 Jun 2013 15:52:58.812 TRACE TaskDeployer - Task 'animate' found in 'D:\Archivos de programa\arara\rules'.
05 Jun 2013 15:52:59.125 INFO  CommandTrigger - Ready to run commands.
05 Jun 2013 15:52:59.125 INFO  CommandTrigger - Running 'animate'.
05 Jun 2013 15:52:59.125 TRACE CommandTrigger - Command: convert -delay 10 -loop 0 -density 200 "117309.pdf" "117309.gif"
05 Jun 2013 15:52:59.265 TRACE CommandTrigger - Output logging:
05 Jun 2013 15:52:59.265 TRACE CommandTrigger - Par metro no v lido: 10

05 Jun 2013 15:52:59.265 WARN  CommandTrigger - 'animate' returned an error status.
05 Jun 2013 15:52:59.265 INFO  Arara - Done.

(empty line is original, not my mistake editing it)

In any case, running command

convert -delay 10 -loop 0 -density 300 myfile.pdf myfile.gif

from command window works and creates a gif file. This command is what it's trying to do arara: animate.

Do you know what's wrong?

  • Did you try to add the flags -v -l to the compilation of arara. Then you have a verbosed arara log file. Jun 5, 2013 at 11:06
  • @MarcoDaniel Nothing changes. I've added arara.log results.
    – Ignasi
    Jun 5, 2013 at 13:59
  • Please add the option -debug All to convert. Then you get an output of the log of convert Jun 5, 2013 at 14:06
  • @MarcoDaniel If I add -debug All to convert on command line I can see a lot of information but conversion still works. If I the option to yaml file: - <arara> convert -debug All -delay @{delay} -loop @{loop} -density @{density} "@{getBasename(file)}.pdf" "@{getBasename(file)}.gif" > test.log 2>&1. Still nothing changes. The error is the same, process stops in same place and nothing is written in test.log.
    – Ignasi
    Jun 5, 2013 at 16:26
  • 1
    @Ignasi: I suspect the "wrong" convert is being called (Windows has also a tool named convert, so there's a name clash). I have no Windows machine near me right now, so I cannot say for sure which PATH arara is assuming (either user or system, I suspect system). As a workaround, replace - <arara> convert in Chris' animate rule by the full path to ImageMagick's convert, say, - <arara> "C:\Program Files\ImageMagick\bin\convert.exe" (I don't know the exact path) and try running arara again. Please tell me if this works, otherwise we have to come up with another solution. :) Jun 5, 2013 at 17:26

1 Answer 1


arara version 4.0 answer

arara version 4.0 ships with animate.yaml, and Windows users might use the following, for example:

% arara: animate: {program: magick.exe}

old answer, out of date

The answer below is out of date

I apologize for not making my rule robust enough :)

As noted in the comments, the problem with my original answer is that Windows might not get the path correct. You can fix it by using

- <arara> @{ isWindows( "cmd /c convert", "convert" ) } -delay @{delay} -loop @{loop} -density @{density} "@{ getBasename(file) }.pdf" "@{ getBasename(file) }.gif"

Here's a complete, cross-platform, version

# Make animated .gif file from .pdf
# author: Chris Hughes
# last edited by: cmh, June 6th 2013
# requires arara 3.0+
# Sample usage: 
# % arara: animate
# % arara: animate: {density: 200}
# % arara: animate: {density: 200, delay: 20}
# This rule is really just a shortcut for commands like the following
#  convert -delay 10 -loop 0 -density 300 myfile.pdf myfile.gif
# which will output myfile.gif
identifier: animate
name: animate
- <arara> @{ isWindows( "cmd /c convert", "convert" ) } -delay @{delay} -loop @{loop} -density @{density} "@{ getBasename(file) }.pdf" "@{ getBasename(file) }.gif"
- identifier: delay
  flag: <arara> @{parameters.delay}
  default: 10
- identifier: loop
  flag: <arara> @{parameters.loop}
  default: 0
- identifier: density
  flag: <arara> @{parameters.density}
  default: 300
  • Oh a Windows user ;-) Jun 6, 2013 at 17:29
  • Thank you for animate.yaml. Now it will be easier (at least for me) to submit animated gif's to TeX.SX. :-)
    – Ignasi
    Jun 7, 2013 at 10:45
  • @Ignasi no problem, glad it helped :) isWindows is pretty darned useful :)
    – cmhughes
    Jun 7, 2013 at 15:04
  • I'm using your animate.yaml with arara on Windows 10 and all works well except for the loop parameter: even if I set it to 1, I always get an infinite loop. It is not a problem of your rule because also the command convert -delay 10 -loop 1 -density 300 myfile.pdf myfile.gif has the same problem. Could you help me? I know this is not TEX.SE related, where should I ask it?
    – CarLaTeX
    Nov 5, 2016 at 18:16
  • @CarLaTeX perhaps Stack overflow, such as stackoverflow.com/questions/tagged/imagemagick-convert (note the tags)....?
    – cmhughes
    Nov 5, 2016 at 18:24

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.