Difference between revisions of "Command/startMPcode"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \startMPcode ... \stopMPcode")
 
Line 34: Line 34:
 
     draw fullcircle scaled 2cm ;
 
     draw fullcircle scaled 2cm ;
 
     dotlabel.bot(textext("(0,0)"),origin) ;
 
     dotlabel.bot(textext("(0,0)"),origin) ;
\stopMPcode  
+
\stopMPcode
 
\startMPcode
 
\startMPcode
 
     draw fullcircle scaled 2cm ;
 
     draw fullcircle scaled 2cm ;
Line 48: Line 48:
 
<cd:commandref name="defineMPinstance"></cd:commandref>
 
<cd:commandref name="defineMPinstance"></cd:commandref>
 
<cd:commandref name="setupMPinstance"></cd:commandref>
 
<cd:commandref name="setupMPinstance"></cd:commandref>
<cd:commandref name="startMPinclusions"></cd:commandref></cd:seealso>
+
<cd:commandref name="startMPinclusions"></cd:commandref>
 +
<cd:commandref name="startuseMPgraphic"></cd:commandref>
 +
<cd:commandref name="startuniqueMPgraphic"></cd:commandref>
 +
<cd:commandref name="startreusableMPgraphic"></cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Revision as of 19:21, 12 September 2023


\startMPcode ... \stopMPcode

Summary

The environment \startMPcode ... \stopMPcode is used for Metapost inline graphics.

Settings

\startMPcode{...} ... \stopMPcode
{...}metafun minifun extrafun lessfun doublefun binaryfun decimalfun mprun metapost nofun doublepost binarypost decimalpost simplefun

Description

\startMPcode simply runs some MetaPost code and immediately inserts the resulting graphic. Optionally, you can specify a MetaPost instance to use; see \defineMPinstance.

Examples

Example 1

This is the origin and radius of a circle:

\startMPcode
    draw fullcircle scaled 2cm ;
    dotlabel.bot(textext("(0,0)"),origin) ;
\stopMPcode
\startMPcode
    draw fullcircle scaled 2cm ;
    drawarrow (0,0)--(1cm,0) ;
    label.bot(textext("$r$"),(5mm,0)) ;
\stopMPcode

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: