From Wiki
< Command
Revision as of 14:37, 15 November 2019 by Usonianhorizon (talk | contribs)
Jump to navigation Jump to search


Syntax (autogenerated)

\startuseMPgraphic{...}{...,...} ... \stopuseMPgraphic


%% MetaPost code
{...} name under which the graphic will be known


Define code for a MetaPost graphic. The graphic can be placed in the document with \useMPgraphic, and will be recompiled every time it is placed.

If a custom MetaPost instance (defined with \defineMPinstance) should be used, the name of the graphic has to be preceded by the name of the MetaPost instance, with a double colon in between: \startuseMPgraphic{instancename::graphicname}.




  fill fullcircle scaled 20pt withcolor \mycolor;

  fill fullcircle scaled 20pt withcolor \mycolor;

red: \useMPgraphic{name}
red: \useMPgraphic{myinstance::name}

blue: \useMPgraphic{name}

The command is very nice for defining overlays that vary randomly:

	fill unitsquare
		xyscaled (\overlaywidth, \overlayheight)
                % `uniformdeviate 1` produces a random number between 0 and 1
		withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);


\framed[background=beta]{rather wide}

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: