Changes

Jump to navigation Jump to search
m
Taco moved page Environment/uniqueMPgraphic to Command/startuniqueMPgraphic over a redirect without leaving a redirect
|attributes=
}}
 
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>startuniqueMPgraphic</syntax>
== [[Help:Reference|Syntax]] ==
== Description ==
Define code for a MetaPost graphic. The graphic can be placed in the document with {{cmd|uniqueMPgraphic}}. Every time any of the following variables changes, and will be the graphic is recompiled every time it it is placed.: * {{cmd|overlaywidth}}* {{cmd|overlayheight}}* {{cmd|overlaydepth}}* {{cmd|overlaycolor}}* {{cmd|overlaylinecolor}}
== Example ==
\def\mycolor{.625blue}
blue: \uniqueMPgraphic{name}
</context>
 
This illustrates the fact that graphic is reused if the dimensions don't change.
 
<context source=yes>
\startuniqueMPgraphic{randomcolor}
fill unitsquare
xyscaled (\overlaywidth, \overlayheight)
% `uniformdeviate 1` produces a random number between 0 and 1
withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopuniqueMPgraphic
 
\defineoverlay
[beta]
[\uniqueMPgraphic{randomcolor}]
 
\dontleavehmode
\framed[background=beta]{narrow}
\framed[background=beta]{narrow}
\framed[background=beta]{rather wide}
</context>

Navigation menu