Aditya Mahajan wrote:
Hi,
Does there exist a startstop command (say startMPfigure) for managing figures drawn using MP such that
1. I can use \startMPfigure{label} ...... \stopMPfigure and then use \useexternalMPfigure{label} to include the figure.
grep for \startMPrun .. \stopMPrun
2. The figures are converted into pdf once. If the code inside \startstop MPfigures changes, the pdf for each figure is recreated.
Basically, I want MPfigures to be converted into pdf for faster inclusion in the main document, the figure should be recompiled if necessary and I should be able to include the figure using a label (so that I can separate the figures from the main document).
you can use the figure database mechanism (davids arnold does that) or make individual files, say 'thatfile.tex' \starttext \startMPpage fill fullcircle scaled 10cm; \stopMPpage \stoptext and then in test.tex say: \def\MyMpgraphic[#1]% {\executesystemcommand{texmfstart --ifchanged=#1.tex texexec #1.tex} \externalfigure[#1.pdf]} \starttext \MyMpgraphic[thatfile] \MyMpgraphic[thatfile][width=3cm] \stoptext (you need a version of texmfstart that provided the -ifchanged)
uniqueMPgraphic provides the first functionality, but the figure is converted into pdf on runtime (thereby increasing the processing time of the document).
expect this to be sped up later this year (neglectable)
I can use a separate document with each figure inside a \startMPpage ... \stopMPpage, but (i) I need to remember figure numbers manually, (ii) after making change in one figure, the whole file needs to be recompiled.
so who not filenames like whateverprefix-somelabel
Another possibility is to use one tex file for each figure, compile them separately and then then use figure library to get a "label" for each figure. But this becomes difficult to manage, as soon as I get large number of files.
Is their something basic that I am missing here? How do others manage mpfigures?
To Hans: is it possible to have a \startMPfigure command such that
1. \startMPfigure[label] figure code \stopMPfigure
creates a \jobname-figure-\nofMPfigurefile file with
current MP environment current MP inclusion figure code (from inside \startstop MPfigure)
Convert this into \jobname-figure-\nofMPfigurefile.pdf only if something changes (similar to what is done in m-r module).
see prev example for a starter
2. The resultant pdf can be included using \useMPfigure{label}.
Would such a feature make sense?
would be a different command remind me later this week Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------