Wow! I checked for missing '%' or some spaces ... I couldn't imagine
that the problem was lying so deep that it needed redefinition of a
primitive.
It works on this simple test case, but I have no idea about the impact
of this to the rest of functionality in TeX. Where should this
definition go? To meta-tex.tex?
> > \starttext
> > \startMPcode
> > picture a; a := \sometxt{\framed{x}};
> > draw a;
> > draw bbox a;
> > \stopMPcode
> > \stoptext
Two additional questions:
- Which parameter is responsible for those additional 3(?) points
around \sometxt{...}? (but it's not so important at the moment)
- I somehow managed to find out how most of things can be implemented
in the way I wanted them to be, but I'm still a bit lost about how to
do some additional high-level definitions for \sometxt:
\startMPcode
\GPsetfont[iwona,ss,7pt]
\GPtext{whatever}
\GPsetfont[] % or \GPresetfont
\GPtext{some_dirty$characters}
\stopMPcode
\GPtext#1 should be able to:
- switch to the last font defined in \GPsetfont and then use
\sometxt{\fontswitching\strut #1}
- many demos have '_', '%' and '$' present in lables. I woud like to
provide a switch (labels=tex|literal or something similar) to make
everything inside \GPtext{...} to behave literally (as if it was
\type-d).
I might figure out how to do the first one after a lot of time and
after extensive playing with meta-tex, but I have no idea where to
start to solve the last problem.
Thanks a lot,
Mojca
Mojca Miklavec wrote:
> It works on this simple test case, but I have no idea about the impact
> of this to the rest of functionality in TeX. Where should this
> definition go? To meta-tex.tex?
Dont use it, we will try to fix this another way, because this
redefinition would potentially break other stuff.
Taco
> It works on this simple test case, but I have no idea about the impact
> of this to the rest of functionality in TeX. Where should this
> definition go? To meta-tex.tex?
>
no, use the patch i sent you, overloading scantokens is tricky; it needs
a real fix
>
>>> \starttext
>>> \startMPcode
>>> picture a; a := \sometxt{\framed{x}};
>>> draw a;
>>> draw bbox a;
>>> \stopMPcode
>>> \stoptext
>>>
>
> Two additional questions:
>
> - Which parameter is responsible for those additional 3(?) points
> around \sometxt{...}? (but it's not so important at the moment)
>
>
\framed[offset=overlay]{x}
> - I somehow managed to find out how most of things can be implemented
> in the way I wanted them to be, but I'm still a bit lost about how to
> do some additional high-level definitions for \sometxt:
>
> \startMPcode
> \GPsetfont[iwona,ss,7pt]
> \GPtext{whatever}
> \GPsetfont[] % or \GPresetfont
> \GPtext{some_dirty$characters}
> \stopMPcode
>
> \GPtext#1 should be able to:
> - switch to the last font defined in \GPsetfont and then use
> \sometxt{\fontswitching\strut #1}
> - many demos have '_', '%' and '$' present in lables. I woud like to
> provide a switch (labels=tex|literal or something similar) to make
> everything inside \GPtext{...} to behave literally (as if it was
> \type-d).
>
> I might figure out how to do the first one after a lot of time and
> after extensive playing with meta-tex, but I have no idea where to
> start to solve the last problem.
>
the savest route is to add some code to gnuplot that escapes those
chars, i.e. \$ \_ etc
moving around arguments and rescanning is tricky
Hans
--
-----------------------------------------------------------------
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
-----------------------------------------------------------------