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.

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
FAILURE

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?

share|improve this question
    
Did you try to add the flags -v -l to the compilation of arara. Then you have a verbosed arara log file. –  Marco Daniel Jun 5 '13 at 11:06
    
@MarcoDaniel Nothing changes. I've added arara.log results. –  Ignasi Jun 5 '13 at 13:59
    
Please add the option -debug All to convert. Then you get an output of the log of convert –  Marco Daniel Jun 5 '13 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 '13 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. :) –  Paulo Cereda Jun 5 '13 at 17:26

1 Answer 1

up vote 3 down vote accepted

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

!config
# 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
commands: 
- <arara> @{ isWindows( "cmd /c convert", "convert" ) } -delay @{delay} -loop @{loop} -density @{density} "@{ getBasename(file) }.pdf" "@{ getBasename(file) }.gif"
arguments:
- identifier: delay
  flag: <arara> @{parameters.delay}
  default: 10
- identifier: loop
  flag: <arara> @{parameters.loop}
  default: 0
- identifier: density
  flag: <arara> @{parameters.density}
  default: 300
share|improve this answer
    
Oh a Windows user ;-) –  Marco Daniel Jun 6 '13 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 '13 at 10:45
    
@Ignasi no problem, glad it helped :) isWindows is pretty darned useful :) –  cmhughes Jun 7 '13 at 15:04

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.