ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MPcode inserts page
@ 2023-07-06  9:23 Henning Hraban Ramm
  2023-07-06 10:02 ` Alan Braslau via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm @ 2023-07-06  9:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi, if I use \startMPcode to declare variables etc. that I need in 
several MP graphics, it always inserts an empty page. How can I avoid that?
(Actually, I load an external mp file, and for random value reasons I 
must load it only once. But the MWE already shows the problem.)


"""
\startMPcode
numeric something;
something := 1;
\stopMPcode

\starttext
\chapter{Something}

Anything.

\stoptext
"""


Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________


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

* Re: MPcode inserts page
  2023-07-06  9:23 MPcode inserts page Henning Hraban Ramm
@ 2023-07-06 10:02 ` Alan Braslau via ntg-context
  2023-07-06 10:38   ` Henning Hraban Ramm
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Braslau via ntg-context @ 2023-07-06 10:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm; +Cc: Alan Braslau

On 06/07/23 06/07/23, 11:23, Henning Hraban Ramm wrote:
> Hi, if I use \startMPcode to declare variables etc. that I need in 
> several MP graphics, it always inserts an empty page. How can I avoid that?
> (Actually, I load an external mp file, and for random value reasons I 
> must load it only once. But the MWE already shows the problem.)
> 
> 
> """
> \startMPcode
> numeric something;
> something := 1;
> \stopMPcode
> 
> \starttext
> \chapter{Something}
> 
> Anything.
> 
> \stoptext
> """

\startMPinitializations % used by ALL MP instances
% also called repeatedly
\stopMPinitializations

\startMPdefinitions
\stopMPdefinitions

This is what you want.

-- 
Alan

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________


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

* Re: MPcode inserts page
  2023-07-06 10:02 ` Alan Braslau via ntg-context
@ 2023-07-06 10:38   ` Henning Hraban Ramm
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Hraban Ramm @ 2023-07-06 10:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 06.07.23 um 12:02 schrieb Alan Braslau:
> On 06/07/23 06/07/23, 11:23, Henning Hraban Ramm wrote:
>> Hi, if I use \startMPcode to declare variables etc. that I need in 
>> several MP graphics, it always inserts an empty page. How can I avoid 
>> that?
>> (Actually, I load an external mp file, and for random value reasons I 
>> must load it only once. But the MWE already shows the problem.)
>>
>>
>> """
>> \startMPcode
>> numeric something;
>> something := 1;
>> \stopMPcode
>>
>> \starttext
>> \chapter{Something}
>>
>> Anything.
>>
>> \stoptext
>> """
> 
> \startMPinitializations % used by ALL MP instances
> % also called repeatedly
> \stopMPinitializations
> 
> \startMPdefinitions
> \stopMPdefinitions
> 
> This is what you want.

Exactly, the latter.
Thank you, these two environments were missing in my book.

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2023-07-06 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06  9:23 MPcode inserts page Henning Hraban Ramm
2023-07-06 10:02 ` Alan Braslau via ntg-context
2023-07-06 10:38   ` Henning Hraban Ramm

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