ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \startstaticMPfigure not producing .pdf or .mp.md5 files
@ 2021-05-30 14:36 Gavin
  2021-05-30 15:03 ` Jairo A. del Rio
  0 siblings, 1 reply; 3+ messages in thread
From: Gavin @ 2021-05-30 14:36 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \startstaticMPfigure not producing .pdf or .mp.md5 files
  2021-05-30 14:36 \startstaticMPfigure not producing .pdf or .mp.md5 files Gavin
@ 2021-05-30 15:03 ` Jairo A. del Rio
  2021-05-30 17:46   ` Gavin
  0 siblings, 1 reply; 3+ messages in thread
From: Jairo A. del Rio @ 2021-05-30 15:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3361 bytes --]

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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 5735 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \startstaticMPfigure not producing .pdf or .mp.md5 files
  2021-05-30 15:03 ` Jairo A. del Rio
@ 2021-05-30 17:46   ` Gavin
  0 siblings, 0 replies; 3+ messages in thread
From: Gavin @ 2021-05-30 17:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-30 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30 14:36 \startstaticMPfigure not producing .pdf or .mp.md5 files Gavin
2021-05-30 15:03 ` Jairo A. del Rio
2021-05-30 17:46   ` Gavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).