Open main menu

Changes

no edit summary
<cd:commandgroup name="MPdrawing" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc><!-- a short command summary goes here -->
The command <tt>\MPdrawing</tt> is used for Metapost inline graphics.
</cd:shortdesc>
<cd:variants>
<context source="yes">
\startluacode
context("text before")
context.startMPdrawing()
context("fill fullcircle scaled 2cm withcolor darkyellow;")
context.stopMPdrawing()
context("text before")
context.MPdrawingdonetrue()
context.getMPdrawing()
context("text after")
\stopluacode
</context>
 
Reminder: we call up the drawing with {{cmd|getMPdrawing}}, but first we have to inform the compiler that our METAPOST drawing is completed with {{cmd|MPdrawingdonetrue}}.
 
With {{cmd|MPdrawing}} :
<context source="yes">
\startluacode
context.MPdrawingdonetrue()
context.MPdrawing("fill fullcircle scaled 2cm withcolor darkgreen;")
context("text before")
context.MPdrawingdonetrue()
context.getMPdrawing()
context("text after")
\stopluacode
</context></cd:description>
999

edits