29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

There are a few more low level switches and features, but these go beyond the purpose of this<br />

manual. Some of these features, like the option to add tokens to \everyMPgraphic are for experts<br />

only, and fooling around with them can interfere with existing features.<br />

3.8 One page graphics<br />

An advantage of using CONTEXT to make your METAPOST graphics is you don't have to bother about<br />

specials, font inclusion and all those nasty things that can spoil a good day. An example of such a<br />

graphic is the file mfun-888 that resides on the computer of the author.<br />

% output=pdftex<br />

%<br />

% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa<br />

\setupcolors<br />

[state=start]<br />

\setupMPpage<br />

[offset=1pt,<br />

background=color,<br />

backgroundcolor=gray]<br />

\definecolor [gray] [s=.625]<br />

\definecolor [red] [r=.625]<br />

\definecolor [yellow] [r=.625,g=.625]<br />

\startuseMPgraphic{test}<br />

fill fullsquare rotated 45 scaled 4cm withcolor \MPcolor{yellow} ;<br />

\stopuseMPgraphic<br />

\starttext<br />

\startMPpage<br />

\includeMPgraphic{test}<br />

fill fullcircle scaled 3cm withcolor \MPcolor{red} ;<br />

\stopMPpage<br />

\stoptext<br />

Given that CONTEXT is present on your system, you can process this file with:<br />

context mfun-888<br />

You can define many graphics in one file. Later you can include individual pages from the resulting<br />

PDF file in your document:<br />

\placefigure<br />

{A silly figure, demonstrating that stand||alone||graphics<br />

can be made.}<br />

{\externalfigure[mfun-888][page=1]}<br />

One page graphics Embedded graphics<br />

123

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!