\startstaticMPfigure not producing .pdf or .mp.md5 files
Hello colleagues, I’m writing a physics textbook with lots of figures, some quite complex. I’ve been using TikZ, but I’m experimenting with MetaPost. Consulting the ConTeXt wiki, I found that \startstaticMPfigure and friends are designed exactly for this sort of use. However, I’m not seeing the documented behavior. In particular, I’m not seeing .pdf and .mp.md5 files being produced. Perhaps I don’t know where to look. I thought they would be in the same directory as the document. The example from the wiki is this: \startstaticMPfigure{center} draw fullcircle scaled 2cm ; dotlabel.bot(textext("(0,0)"),origin) ; \stopstaticMPfigure \startstaticMPfigure{radius} draw fullcircle scaled 2cm ; drawarrow (0,0)--(1cm,0) ; label.bot(textext("$r$"),(5mm,0)) ; \stopstaticMPfigure \starttext Circle centered \usestaticMPfigure[center][width=1cm] at origin with radius \usestaticMPfigure[radius][width=1cm] $r=1\,\text{cm}$. \stoptext I would expect this to produce files center.pdf, radius.pdf, center.mp.md5, radius.md.mp5, and perhaps other logs, etc. I don’t see them anywhere. I’m running on MacOS with a current LMTX from TeXShop with the script: #!/bin/bash export PATH=/Users/Gavin/context-osx-64/tex/texmf-osx-64/bin:$PATH ~/context-osx-64/tex/texmf-osx-64/bin/mtxrun --autogenerate --script context --directives="system.showerror" --autopdf "$1” I’ve also tried MkIV and the TeXLive 2021 versions with the same results. I don’t actually need the separate pdf, but I do want the diagrams to be redrawn only when something has changed. Without a .mp.md5, I’m not sure what to expect. If the behavior has changed, I can update the wiki. I’m also curious about why \staticMPfigure is not mentioned in the MetaFun manual. Thanks Gavin
It seems \startstarticMPfigure ... \stopstaticMPfigure is now a wrapper for reusable MP graphics, so auxiliary files are no longer generated. I don't think this counts as an answer but you could use \typesetbuffer and \startMPpage ... \stopMPpage instead. Two auxiliary PDF files with funny names are generated. \startbuffer[center] \startMPpage draw fullcircle scaled 2cm ; dotlabel.bot(textext("(0,0)"),origin) ; \stopMPpage \stopbuffer \startbuffer[radius] \startMPpage draw fullcircle scaled 2cm ; drawarrow (0,0)--(1cm,0) ; label.bot(textext("$r$"),(5mm,0)) ; \stopMPpage \stopbuffer \starttext Circle centered \typesetbuffer[center][width=1cm] at origin with radius \typesetbuffer[radius][width=1cm] $r=1\,\text{cm}$. \stoptext Regards, Jairo El dom, 30 de may. de 2021 a la(s) 09:37, Gavin (gavinpublic@comcast.net) escribió:
Hello colleagues,
I’m writing a physics textbook with lots of figures, some quite complex. I’ve been using TikZ, but I’m experimenting with MetaPost. Consulting the ConTeXt wiki, I found that \startstaticMPfigure and friends are designed exactly for this sort of use. However, I’m not seeing the documented behavior. In particular, I’m not seeing .pdf and .mp.md5 files being produced. Perhaps I don’t know where to look. I thought they would be in the same directory as the document.
The example from the wiki is this:
\startstaticMPfigure{center} draw fullcircle scaled 2cm ; dotlabel.bot(textext("(0,0)"),origin) ; \stopstaticMPfigure
\startstaticMPfigure{radius} draw fullcircle scaled 2cm ; drawarrow (0,0)--(1cm,0) ; label.bot(textext("$r$"),(5mm,0)) ; \stopstaticMPfigure
\starttext Circle centered \usestaticMPfigure[center][width=1cm] at origin with radius \usestaticMPfigure[radius][width=1cm] $r=1\,\text{cm}$. \stoptext
I would expect this to produce files center.pdf, radius.pdf, center.mp.md5, radius.md.mp5, and perhaps other logs, etc. I don’t see them anywhere.
I’m running on MacOS with a current LMTX from TeXShop with the script:
#!/bin/bash export PATH=/Users/Gavin/context-osx-64/tex/texmf-osx-64/bin:$PATH ~/context-osx-64/tex/texmf-osx-64/bin/mtxrun --autogenerate --script context --directives="system.showerror" --autopdf "$1”
I’ve also tried MkIV and the TeXLive 2021 versions with the same results.
I don’t actually need the separate pdf, but I do want the diagrams to be redrawn only when something has changed. Without a .mp.md5, I’m not sure what to expect.
If the behavior has changed, I can update the wiki. I’m also curious about why \staticMPfigure is not mentioned in the MetaFun manual.
Thanks Gavin
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
Hello Jairo and Everybody.
It seems \startstarticMPfigure ... \stopstaticMPfigure is now a wrapper for reusable MP graphics, so auxiliary files are no longer generated.
Are reusable MP graphics compiled only once per run, or only when the code is changed – which might not happen for many runs? For the wiki: Are static MP figure commands deprecated, synonyms for reusable MP graphics commands, or wrappers that provide some additional functionality? (Based on the source, it looks like static MP figures might add a scaling option, but I can’t really read the source.)
...you could use \typesetbuffer and \startMPpage ... \stopMPpage instead. Two auxiliary PDF files with funny names are generated.
This indeed works as advertised. I will play with it. Thanks! Gavin
participants (2)
-
Gavin
-
Jairo A. del Rio