Open main menu

Changes

Created page with "Documentation for \MPdrawing"
<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>
<cd:command category="graphics" file="meta-ini.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-metapost.xml" keywords="metapost" level="document" name="MPdrawing" variantnumber="1">
<cd:arguments>
<cd:content ordinal="1"></cd:content>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description><!-- the long description of the command goes here -->

Similar to the environment {{cmd|startMPdrawing}}.

It was introduced in 2010 to reduce needed calls with lua.
Source: https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/AIAWMGBFQQ5QPKNPOPDKFE4U3P4DZJDY/


With {{cmd|startMPdrawing}} :

<context source="yes">
\startluacode
context("text before")
context.startMPdrawing()
context("fill fullcircle scaled 2cm withcolor darkyellow;")
context.stopMPdrawing()
context("text after")
\stopluacode
</context>

With {{cmd|MPdrawing}} :
<context source="yes">
\startluacode
context.MPdrawingdonetrue()
context.MPdrawing("fill fullcircle scaled 2cm withcolor darkgreen;")
context("text before")
context.getMPdrawing()
context("text after")
\stopluacode
</context></cd:description>
<cd:examples></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="meta-ini.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Graphics"></cd:wikipage>
<cd:wikipage originator="system" page="Keywords:Metapost"></cd:wikipage></cd:seealso>
</cd:commandgroup>
1,005

edits