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

Hans Hagen pragma at wxs.nl
Sun Mar 8 20:04:02 CET 2015


On 3/8/2015 7:07 PM, Wolfgang Schuster wrote:
>
>> Am 08.03.2015 um 18:39 schrieb Hans Hagen <pragma at wxs.nl>:
>>
>> On 3/8/2015 1:04 PM, Wolfgang Schuster wrote:
>>>
>>>> Am 08.03.2015 um 12:55 schrieb Hans Hagen <pragma at wxs.nl
>>>> <mailto:pragma at wxs.nl>>:
>>>>
>>>> On 3/8/2015 12:26 PM, Wolfgang Schuster wrote:
>>>>>
>>>>>> Am 08.03.2015 um 11:11 schrieb Hans Hagen <pragma at wxs.nl
>>>>>> <mailto:pragma at wxs.nl>
>>>>>> <mailto:pragma at wxs.nl>>:
>>>>>>
>>>>>> this should help:
>>>>>>
>>>>>> \unexpanded\def\writeviatex#1#2%
>>>>>> {\ifx\normalwrite\relax\else
>>>>>>   % the \detokenize makes sure we don't expand \noexpanded macros
>>>>>>    \normalwrite#1{\detokenize{#2}}%
>>>>>> \fi}
>>>>>>
>>>>>> (in future version i might replace write completely)
>>>>>
>>>>> Only partially because the saved positions from \pdfsavepos are wrong.
>>>>
>>>> in what sense wrong?
>>>
>>> Content of the external file from MkIV (the entries on the first page show 0
>>> and the values on page 2 and 3 are always the same):
>>>
>>> 1:0:0
>>> 2:0:0
>>> 3:4661756:45255023
>>> 4:4661756:45255023
>>> 5:4661756:45255023
>>> 6:4661756:45255023
>>>
>>> Content of the external file from MkII (different values for the first
>>> and second position on each page):
>>>
>>> 1:6526435:46204089
>>> 2:4661756:45256000
>>> 3:6526435:46204089
>>> 4:4661756:45256000
>>> 5:6526435:46204089
>>> 6:4661756:45256000
>>
>> ypositions can differ a bit because we use different fonts and so does the interlinespace
>
> But the values for both positions should be different which isn’t the case for MkIV
> and the first page saves 0 for the x and y positions.

hm, after some playing with it i think that is a luatex bug (it expands 
the positions in a tex.write which is wrong

so we need to revert to this:

\def\syst_write_execute#1%
   {\ctxcommand{execute(\!!bs#1\!!es)}}

\unexpanded\def\write#1#%
   {\ifnum#1=18
      \expandafter\syst_write_execute
    \else
      \normalwrite#1%
    \fi}

(context itself doesn't suffer from this as it does things differently; 
maybe i should make an api and then nil \pdf*pos)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list