Re: [NTG-context] \startstaticMPfigure not producing .pdf or .mp.md5 files
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 ___ 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 ___
Re: [NTG-context] \startstaticMPfigure not producing .pdf or .mp.md5 files
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 (gavinpub...@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 > > ___ > ___ 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 ___
[NTG-context] \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 ___ 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 ___
[NTG-context] \startstaticMPfigure
From the Wiki I learn about \startstaticMPfigure that it creates a separate pdf file containing the graphic. But when I exercise the example given I do not see those staticMPfigure's in sepaarte pdf's. What am I missing? I thought to use this for generating a series of separate pdf's, to be further processed as png/tiff files. \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 By the way, is transparency still working as in the wiki example below, or has transparency vanished? \startreusableMPgraphic{a} fill unitsquare scaled 1cm withcolor yellow; fill unitsquare shifted (0.5,0.5) scaled 1cm withcolor transparent (1,0.5,red); \stopreusableMPgraphic \placefigure[force,none]{}{\reuseMPgraphic{a}} Thanks in advance Hans van der Meer ___ 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 ___
Re: [NTG-context] \startstaticMPfigure
Am 19.09.2011 11:17, schrieb Meer, H. van der: From the Wiki I learn about \startstaticMPfigure that it creates a separate pdf file containing the graphic. But when I exercise the example given I do not see those staticMPfigure's in sepaarte pdf's. What am I missing? I thought to use this for generating a series of separate pdf's, to be further processed as png/tiff files. \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 Use mkii and you will get the files. Probably no need for this kind of runtime optimization in mkiv. By the way, is transparency still working as in the wiki example below, or has transparency vanished? The transparency example works here (slightly outdated version from 05.09.2011). BTW: there are four new transparency modes (hue,saturation,color,luminosity). Best wishes, Peter \startreusableMPgraphic{a} fill unitsquare scaled 1cm withcolor yellow; fill unitsquare shifted (0.5,0.5) scaled 1cm withcolor transparent (1,0.5,red); \stopreusableMPgraphic \placefigure[force,none]{}{\reuseMPgraphic{a}} Thanks in advance Hans van der Meer ___ 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 ___ ___ 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 ___