> On 15 Sep 2024, at 22:11, Florent Michel <florent....@gmail.com> wrote:
> 
> Thanks Bruce for your very helpful reply! 
> 
> The reason for my question was indeed consistency, e.g. ensuring figure 
> captions stay up to date with what the figures show when changing parameters. 
> Thinking more about it, the second solution you mention seems to be a better 
> option, though - I can simply define the parameters in an external file and 
> read it from both the PDF solver and ConTeXt to ensure consistency. Thanks 
> for mentioning it!  
> 
> Thank you also for mentioning \executesystemcommand, which I was not aware 
> of! 

Another option might be to use a marker such as

% DE_figure_here param1 param2 param3

in your ConTeXt source and then use 'awk' or another Unix text pre-processor to 
scan through for these, run the appropriate DE calculation, plot the graph and 
generate the appropriate \placefigure command to go in its place.

Bonus marks if it can automatically generate the caption based on the 
parameters! But if not, the marker can always follow the \placefigure macro e.g.

\placefigure
  {This is a DE showing something and something else}
  % DE_figure_here param1 param2 param3

so the awk code only needs to insert the image file name.

Note I’ve deliberately omitted the braces from the bit to be substituted so 
that you need to generate them in the awk. That way, if you forget to process, 
you’ll get an error not a missing image.

HTH
—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to