[NTG-context] Using MPgraphics as externalfigures?

Marco Patzer homerow at lavabit.com
Thu Aug 2 10:34:41 CEST 2012


On 2012-08-02 Mari Voipio <mari.voipio at iki.fi> wrote:

Hi Mari,

> I'm being a bit clueless about the MPgraphics again...

Read http://wiki.contextgarden.net/Metapost and 3.3 Integrated
Graphics in the MetaFun Manual.

> Any ideas of how to do this in a smart way? Preferably without having
> to go into the bowels of ConTeXt to get it done...

\defineframed
  [graphicframe]
  [frame=on,offset=none]

\define[1]\MPframed
  {\graphicframe{\useMPgraphic{#1}}}

\startuseMPgraphic{first}
  fill fullcircle scaled 2cm withcolor red;
\stopuseMPgraphic

\startreusableMPgraphic{second}
  fill fullsquare rotated 45 scaled 2cm withcolor blue;
\stopreusableMPgraphic

\startbuffer [third]
  fill fullsquare scaled 1cm withcolor green;
\stopbuffer

\starttext
  \useMPgraphic{first}
  \reuseMPgraphic{second}
  \processMPbuffer [third]
  \MPframed{second}
\stoptext


Marco



More information about the ntg-context mailing list