Changes

Jump to navigation Jump to search
660 bytes removed ,  13:49, 26 November 2012
no edit summary
== Using MetaPost in ConTeXt ==
With {{cmd|startuseMPgraphic}}, you define a piece of graphics code that is processed anew every time the graphic is placed with {{cmd|useMPgraphic}}. Further commands are described at [[MetaPost in ConTeXt]].
<context source=yes>
blue: \useMPgraphic{name}
</context>
 
For graphics that are the same every time, it is better to use {{cmd|startreuseableMPgraphic}}: the graphic is compiled only once, and the one resulting picture can be placed at various points with {{cmd|reuseMPgraphic}}.
 
<context source=yes>
\def\mycolor{.625red}
 
\startreusableMPgraphic{name}
fill fullcircle scaled 20pt withcolor \mycolor;
\stopreusableMPgraphic
 
red: \reuseMPgraphic{name}
 
\def\mycolor{.625blue}
blue: \reuseMPgraphic{name}
</context>
 
When reusing a graphic is not important, you can simply use {{cmd|startMPcode}}.
 
<context source=yes>
\startMPcode
fill fullcircle scaled 20pt withcolor .625green;
\stopMPcode
</context>
 
See also section 3.3 of [[manual:metafun-s.pdf|MetaFun manual]].
== Different Packages, Extensions & Applications of Metapost ==

Navigation menu