Changes

Jump to navigation Jump to search
Add info about MPinstance
--><span class="first">{...}</span><!--
--></td>
</tr>
<tr><td>%% MetaPost code</td></tr>
<tr>
<td colspan="2" class="cmd">\stopuseMPgraphic</td>
</tr>
<tr valign="top" class="first">
</tr>
</table>
 
== Description ==
Define code for a MetaPost graphic. The graphic can be placed in the document with {{cmd|useMPgraphic}}, and will be recompiled every time it it is placed. If a custom MetaPost instance should be used, the name of the MetaPost instance has to be provided as an argument followed by a double-colon and the MPgraphic name.
== Example ==
<context source=yes>
\def\mycolor{.625red}
 
\defineMPinstance
[myinstance]
[metafun]
 
\startuseMPgraphic{myinstance::name}
fill fullcircle scaled 20pt withcolor \mycolor;
\stopuseMPgraphic
\startuseMPgraphic{name}
red: \useMPgraphic{name}
red: \useMPgraphic{myinstance::name}
\def\mycolor{.625blue}
69

edits

Navigation menu