ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* buffers inside startMPpage
@ 2016-10-14  8:12 Jan Willem Flamma
  2016-10-14  8:34 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Willem Flamma @ 2016-10-14  8:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list members,

I create all my MetaFun drawings in a separate environment file where each individual drawing sits inside a start/stopbuffer. This allows me to easily use those drawings in all my documents using \processMPbuffer[name]. Works just fine.

However, I also wish to have all the drawing available in a pdf file (each drawing on a separate page). This allows me to split the pdf and use the drawing elsewhere (e.g. in a Powerpoint) or include page(s) from the pdf in another document.

The below MWE represent my MetaFun drawings file.
The idea is that by uncommenting the \enablemode[makepdf] I can create the pdf file with drawings. It seems however that startMPpage does not accept buffers (I also tried processbuffer and processMPbuffer).

Is it possible to somehow make this work?

Thanks and regards,
Jan Willem Flamma


%\enablemode[makepdf]

\startbuffer[fig1]
  draw fullcircle scaled 2cm withcolor red ;
\stopbuffer

\startbuffer[fig2]
  draw unitsquare scaled 2cm withcolor red ;
\stopbuffer


\startmode[makepdf]
  \starttext
	\startMPpage
	  \getbuffer[fig1]
	\stopMPpage
	
	\startMPpage
	  \getbuffer[fig2]
	\stopMPpage
  \stoptext
\stopmode



___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: buffers inside startMPpage
  2016-10-14  8:12 buffers inside startMPpage Jan Willem Flamma
@ 2016-10-14  8:34 ` Wolfgang Schuster
  2016-10-14  8:48   ` Jan Willem Flamma
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2016-10-14  8:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

> Jan Willem Flamma <mailto:jwfregister@icloud.com>
> 14. Oktober 2016 um 10:12
> Dear list members,
>
> I create all my MetaFun drawings in a separate environment file where 
> each individual drawing sits inside a start/stopbuffer. This allows me 
> to easily use those drawings in all my documents using 
> \processMPbuffer[name]. Works just fine.
>
> However, I also wish to have all the drawing available in a pdf file 
> (each drawing on a separate page). This allows me to split the pdf and 
> use the drawing elsewhere (e.g. in a Powerpoint) or include page(s) 
> from the pdf in another document.
>
> The below MWE represent my MetaFun drawings file.
> The idea is that by uncommenting the \enablemode[makepdf] I can create 
> the pdf file with drawings. It seems however that startMPpage does not 
> accept buffers (I also tried processbuffer and processMPbuffer).
>
> Is it possible to somehow make this work?
You can use

     \startTEXpage
         \processMPbuffer[…]
     \stopTEXpage

but loading a buffer in MPpage doesn’t work because the content of the 
environment
is just passed to MetaPost and buffers can’t be loaded inside MetaPost 
code unless
Hans adds a function for this, e.g.

     \startMPcode
         buffer("mybuffer")
     \stopMPcode

Wolfgang

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

[-- Attachment #2: Type: text/plain, Size: 489 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: buffers inside startMPpage
  2016-10-14  8:34 ` Wolfgang Schuster
@ 2016-10-14  8:48   ` Jan Willem Flamma
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Willem Flamma @ 2016-10-14  8:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thank you Wolfgang.

This suits my needs just fine.

Kind regards,
Jan Willem Flamma

> On 14 okt. 2016, at 10:34, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
>> Jan Willem Flamma <mailto:jwfregister@icloud.com> 14. Oktober 2016 um 10:12
>> Dear list members,
>> 
>> I create all my MetaFun drawings in a separate environment file where each individual drawing sits inside a start/stopbuffer. This allows me to easily use those drawings in all my documents using \processMPbuffer[name]. Works just fine.
>> 
>> However, I also wish to have all the drawing available in a pdf file (each drawing on a separate page). This allows me to split the pdf and use the drawing elsewhere (e.g. in a Powerpoint) or include page(s) from the pdf in another document.
>> 
>> The below MWE represent my MetaFun drawings file.
>> The idea is that by uncommenting the \enablemode[makepdf] I can create the pdf file with drawings. It seems however that startMPpage does not accept buffers (I also tried processbuffer and processMPbuffer).
>> 
>> Is it possible to somehow make this work?
> You can use
> 
>     \startTEXpage
>         \processMPbuffer[…]
>     \stopTEXpage
> 
> but loading a buffer in MPpage doesn’t work because the content of the environment
> is just passed to MetaPost and buffers can’t be loaded inside MetaPost code unless
> Hans adds a function for this, e.g.
> 
>     \startMPcode
>         buffer("mybuffer")
>     \stopMPcode
> 
> Wolfgang
> ___________________________________________________________________________________
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


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

[-- Attachment #2: Type: text/plain, Size: 489 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2016-10-14  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14  8:12 buffers inside startMPpage Jan Willem Flamma
2016-10-14  8:34 ` Wolfgang Schuster
2016-10-14  8:48   ` Jan Willem Flamma

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).