[NTG-context] MetaPost with Multiple Variable Sections

Jeroen contextntg at gmail.com
Wed Sep 18 09:35:55 CEST 2019


I have been working with MetaPost as following, which worked fine with one
startMPcode section with variables, but with 2 startMPcode Metapost
sections, it keeps telling me the numbers dont add up:


\definefloat      [floatright][figure]
\setupfloat       [floatright][default={right,none}]
\setuplayout      [backspace=20mm,width=170mm,topspace=20mm,height=250mm]

\starttext

\placefloatright{}{
\startMPcode
pair a, b;
a := (0,0);
b := (50,50);
draw a -- b;
\stopMPcode}

\placefloatright{}{
\startMPcode
pair a;
a := 2cm;
draw fullcircle scaled (2*a);
\stopMPcode}

\stoptext


I also have tried with the startbuffer combination as below, but this gave
the same error codes. Is there any other way of working with multiple
MetaPost sections with variables in a single document?


\definefloat      [floatright][figure]
\setupfloat       [floatright][default={right,none}]
\setuplayout      [backspace=20mm,width=170mm,topspace=20mm,height=250mm]

\starttext

\startbuffer
\startMPcode
pair a, b;
a := (0,0);
b := (50,50);
draw a -- b;
\stopMPcode
\stopbuffer

\floatright{}{\getbuffer}

\startbuffer
\startMPcode
pair a;
a := 2cm;
draw fullcircle scaled (2*a);
\stopMPcode
\stopbuffer

\floatright{}{\getbuffer}

\stoptext
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20190918/82fc3cc5/attachment.html>


More information about the ntg-context mailing list