Difference between revisions of "Command/setupMPinstance"
< Command
Jump to navigation
Jump to search
m (Show output of example) |
m (Note about initializations) |
||
Line 45: | Line 45: | ||
The <code>extensions</code> and <code>initializations</code> keys control whether the content of the <code>\startMPextensions</code> and <code>\startMPinitializations</code> environment is used or ignored in the metapost code. | The <code>extensions</code> and <code>initializations</code> keys control whether the content of the <code>\startMPextensions</code> and <code>\startMPinitializations</code> environment is used or ignored in the metapost code. | ||
+ | |||
+ | **Note**: the <code>textstyle</code> and <code>textcolor</code> keys only work when <code>initializations=yes</code> is set. | ||
== Usage == | == Usage == | ||
Line 98: | Line 100: | ||
[[Category:Commands|setupMPinstance]] | [[Category:Commands|setupMPinstance]] | ||
+ | /span> |
Revision as of 21:07, 3 November 2012
\setupMPinstance
Syntax
\setupMPinstance[...][...,...=...,...] | |
[...] | name |
format | metafun mpost |
extensions | yes no |
initializations | yes no |
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
andtextcolor
keys only work wheninitializations=yes
is set.
- Note**: the
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:
- setupMPinstance on the mailing list (all results)
- setupMPinstance on the mailing list (subject only)
- setupMPinstance on stack exchange
- setupMPinstance in ConTeXt's source
/span>