1,842 bytes added
, 19:41, 8 May 2012
{{Reference
|name=setupMPinstance
|attributes=
}}
== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
<tr>
<td colspan="2" class="cmd">\setupMPinstance<span class="first" >[...]</span><span class="second" >[...,...=...,...]</span></td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[...]</td>
<td>name </td>
</tr>
<tr valign="top" class="second">
<td class="cmd">textstyle</td>
<td>bold sans mono … </td>
</tr>
<tr valign="top" class="second">
<td class="cmd">textcolor</td>
<td>color spec</td>
</tr>
<tr valign="top" class="second">
<td class="cmd">setups</td>
<td></td>
</tr>
</table>
== Description ==
This command sets up the default MetaPost instance <code>metafun</code> or a custom MetaPost instance previously defined with {{cmd|defineMPinstance}}.
== Usage ==
To print all MetaPost labels in red:
<texcode>
\setupMPinstance [metafun] [textcolor=red]
\starttext
\startMPcode
draw textext("some text") ;
\stopMPcode
\stoptext
</texcode>
Another example using the <code>setups</code> key:
<texcode>
\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
</texcode>
The above code prints:
<pre>
normal text
prefix: red text
</pre>
“normal text” is printed in black, as well as “prefix:”, only “red text” is printed in red.
== See also ==
<!-- something like {{cmd|goto}} -->
{{cmd|defineMPinstance}}, [[Mpgraphic]]
== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|{{SUBPAGENAME}}}}
[[Category:Commands|setupMPinstance]]