[NTG-context] Problem with MkIV and TikZ picture remembering

Aditya Mahajan adityam at umich.edu
Tue Mar 3 20:28:57 CET 2015


On Tue, 3 Mar 2015, Hans Hagen wrote:

> On 3/3/2015 6:12 PM, Aditya Mahajan wrote:
>> 2. The metafun alternative is a bit inconvenient. Suppose you want to
>> draw a bunch of such graphics (words connected by arrows). Then, you
>> will need to ensure that node names are unique. (Is there a way to get
>> around that?)
>>
> \newcounter\connectedwordcounter
>
> \starttexdefinition unexpanded fromword [#1]#2
>     \expandafter\pushmacro\csname cwc>#1\endcsname % nesting hack
>     \doglobal\increment\connectedwordcounter
>     \setxvalue{cwc>#1}{\connectedwordcounter}%
>     \startpositionoverlay{highlightoverlay}
>         \setMPpositiongraphic
>           {\getvalue{cwc>#1}>f}
>           {highlightgraphic}
>           {from=\getvalue{cwc>#1}>f,to=\getvalue{cwc>#1}>t}
>     \stoppositionoverlay
>     \hpos{\getvalue{cwc>#1}>f}{#2}%
> \stoptexdefinition
>
> \starttexdefinition unexpanded toword [#1]#2
>     \hpos{\getvalue{cwc>#1}>t}{#2}
>     \expandafter\popmacro\csname cwc>#1\endcsname % nesting hack
> \stoptexdefinition

Thanks.

Aditya


More information about the ntg-context mailing list