Difference between revisions of "Command/setupMPinstance"

From ConTeXt wiki
Jump to navigationJump to search
(added method=scaled double)
 
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setupMPinstance</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==

Latest revision as of 14:36, 15 November 2019

\setupMPinstance

Syntax (autogenerated)

\setupMPinstance[...,...][...=...,...]
[...,...]name
formatmetafun mpost
initializationsyes no
setupsname
textstylestyle command
textcolorcolor
extensionsyes no
methodbinary decimal double scaled default


Syntax

\setupMPinstance[...][...,...=...,...]
[...] name
format metafun mpost
extensions yes no
initializations yes no
method scaled double
textstyle bold sans mono …
textcolor color spec
setups


Description

This command sets up the default MetaPost instance metafun or a custom MetaPost instance previously defined with \defineMPinstance.

The extensions and initializations keys control whether the content of the \startMPextensions and \startMPinitializations environment is used or ignored in the metapost code.

Note: the textstyle and textcolor keys only work when initializations=yes is set.

Usage

To print all MetaPost labels in red:

\setupMPinstance [metafun] [textcolor=red]

\starttext

\startMPcode
  draw textext("some text") ;
\stopMPcode

\stoptext

Another example using the setups key:

\defineMPinstance
  [mpinstanceprefixed]
  [metafun]
  [setups=mp:instanceprefix:one, textcolor=red]

\startsetups mp:instanceprefix:one
   prefix:\space
\stopsetups

\starttext

\startMPcode
  draw textext("normal text") ;
\stopMPcode

\startMPcode{mpinstanceprefixed}
  draw textext("red text") ;
\stopMPcode

\stoptext

produces

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: