Difference between revisions of "Command/startMPcode old"

From Wiki
Jump to navigation Jump to search
(Created page with "{{Reference |name=startMPcode |attributes= }} == Syntax == <table cellspacing="4" cellpadding="2" class="cmd"> <tr> <td colspan="2" class="cmd">\startMP...")
 
Line 7: Line 7:
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
   <tr>
 
   <tr>
     <td colspan="2" class="cmd">\startMPcode</td>
+
     <td colspan="2" class="cmd">\startMPcode<!--
 +
      --><span class="first">{...}</span><!--
 +
--></td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">{...}</td>
 +
    <td>(optional) ''name of instance defined with {{cmd|defineMPinstance}}''</td>
 +
  </tr>
 +
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
 
== Description ==  
 
== Description ==  
{{cmd|startMPcode}} simply runs some MetaPost code and immediately inserts the resulting graphic.
+
{{cmd|startMPcode}} simply runs some MetaPost code and immediately inserts the resulting graphic. Optionally, you can specify a MetaPost instance to use; see {{cmd|defineMPinstance}}.
  
 
== Example ==
 
== Example ==

Revision as of 17:25, 26 November 2012

\startMPcode

Syntax

\startMPcode{...}
{...} (optional) name of instance defined with \defineMPinstance

Description

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

Example

\starttext
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
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: