[dev-context] new mp feature
Hans Hagen
pragma at wxs.nl
Mon Jun 19 11:21:31 CEST 2006
Mojca Miklavec wrote:
> Question, questions and questions again ...
>
> The question from yestarday wasn't a serious one. But this one might
> get closer. After I've rewritten the context.trm to try the new
> \sometxt out, I struggled against the following problem:
>
> \startMPcode
> picture p;
>
> vardef rotateme(expr m) =
> (m rotated 90)
> enddef;
>
> % this works
> p := \sometxt{sin (x)};
> draw rotateme(p);
>
> % this doesn't
> draw rotateme( \sometxt{sin (x)} );
> \stopMPcode
>
> Is handling the second situation too complext for the existing
> mechanism? The solution on "my side" is trivial - I can split the
> behaviour in the gnuplot module to work in two steps instead in a
> single one, but perhaps this can be easility fixed as well.
it works ok if we remove the ; from the \sometxt macro
\starttext
\long\def\sometxt#1{sometxt(nexttxt)} % to be used in mp definitions
\startMPcode
vardef rotateme(expr m) =
(m rotated 90)
enddef;
picture p;
p := \sometxt{$\sin(x)$};
draw rotateme(p);
draw rotateme(\sometxt{$\cos(x)$});
\stopMPcode
\stoptext
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
More information about the dev-context
mailing list