Hi all,

Currently I am preparing a series of figures. I use the approach given in Metafun:

\startuseMPgraphic{test}
...
code
...
\stopuseMPgraphic

\starttext
   \startMPpage
         \includeMPgraphic{test}
   \stopMPpage
% \useMPgraphic
\stoptext

The appended code does compile if the MPpage lines are commented. and useMPgraphic is uncommented.
Otherwise the following error is given:


! Missing `,' has been inserted.
<to be read again>
:
gluedraw->...me_stripe(height,width,linewidth,\@@:
linecolor,angle,\@@:gap,sh...
l.248 gluedraw(sq)
;
I use currently: ConTeXt ver: 2003.12.18 fmt: 2004.1.13


Could some metafun-literate try the code in both versions and see what happens?

Thanks Willi


\setupoutput[pdftex]
\setupcolors[state=start]

\def\PICT{Test}

\startMPenvironment
  \setupbodyfont[ss,8pt]
\stopMPenvironment

\setupMPvariables
   [\PICT]
   [linecolor=blue,
    gap=.2\bodyfontsize]

\startuseMPgraphic{\PICT}{linecolor,gap}

% the following definition is taken from mp-back.mp and adapted
% in order to be able to fill a given path with a pattern
def some_stripe (expr awidth    ,
                     aheight    ,
                     alinewidth ,
                     alinecolor ,
                     aangle     ,
                     agap       ,
                     ashape_path ) =

  stripe_gap := agap ;
  stripe_angle := aangle ;
  drawoptions (withpen pencircle scaled alinewidth
               withcolor alinecolor) ;
  path p ; p := ashape_path ;
  stripe_path_a () (draw) p ;
enddef;

def gluedraw(expr gluepath)=
       path shape_path; shape_path := gluepath;
       some_stripe
         (height,
          width,
          linewidth,
          \MPvar{linecolor},
          angle,
          \MPvar{gap},
          shape_path);
enddef ;

numeric u; u := 5mm;
numeric width; width := 100u;
numeric height; height := 50u;
numeric angle; angle := 45 ;
numeric linewidth; linewidth :=.5pt;

path sq; sq = (0,0)--(10u,0)--(12u,5u)--(10u,10u)--(0,10u) --cycle ;
fill sq withcolor \MPcolor{red} ;

gluedraw(sq);
\stopuseMPgraphic

\starttext
%     \startMPpage
%         \includeMPgraphic{\PICT}
%     \stopMPpage
\useMPgraphic{\PICT}
\stoptext

Reply via email to