starting batch file after first of at least two runs
Hi, In the first run I collect several ImageMagick commands in a common batch file, which should be executed afterwards. A second run is also needed to include the created graphics. I tried \appendtoks\mycommand\to\everygoodbye but that does not work properly, if only one run is needed otherwise. So I need to tell ConTeXt somehow, that an additional run is needed (adding the number of runs to the command line is no option). Currently I use if tex.modes["*first"] then ... end to detect the first run. My first try was to add an 'else' condition to call the batch file once, but sadly this is also not triggered in case of a single run... What is the official way (mkiv) to add a call at the end of the first run (or the beginning of the second run)? And how can I ensure, that a second run is forced? Peter
Am 10.04.2012 16:53, schrieb Peter Rolf:
Hi,
In the first run I collect several ImageMagick commands in a common batch file, which should be executed afterwards. A second run is also needed to include the created graphics.
I tried
\appendtoks\mycommand\to\everygoodbye
but that does not work properly, if only one run is needed otherwise. So I need to tell ConTeXt somehow, that an additional run is needed (adding the number of runs to the command line is no option).
Currently I use
if tex.modes["*first"] then ... end
to detect the first run. My first try was to add an 'else' condition to call the batch file once, but sadly this is also not triggered in case of a single run...
What is the official way (mkiv) to add a call at the end of the first run (or the beginning of the second run)? And how can I ensure, that a second run is forced?
Sorry, no need to force a second run. I forgot to delete the *.tuc file, so I missed that the initial compilation has three runs. Should be more than enough for me, but the call of the batch file at the end of the last run (\everygoodbye) is definitely too late. This reduces my question to "how to add a call at the beginning of the second run?"
Peter ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On 10-4-2012 18:43, Peter Rolf wrote:
Am 10.04.2012 16:53, schrieb Peter Rolf:
Hi,
In the first run I collect several ImageMagick commands in a common batch file, which should be executed afterwards. A second run is also needed to include the created graphics.
Isn't it easier to plug into the converter? Anyhow, \ifnum\directsystemparameter{n}=2 do-this-or-that \fi ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 10.04.2012 19:09, schrieb Hans Hagen:
On 10-4-2012 18:43, Peter Rolf wrote:
Am 10.04.2012 16:53, schrieb Peter Rolf:
Hi,
In the first run I collect several ImageMagick commands in a common batch file, which should be executed afterwards. A second run is also needed to include the created graphics.
Isn't it easier to plug into the converter? Anyhow,
donno, will have a look at it :-) Thanks Hans!
\ifnum\directsystemparameter{n}=2 do-this-or-that \fi
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Peter Rolf