jlaurens / synctex

Synchronization for TeX
MIT License
57 stars 19 forks source link

syntex bug in connection with \pdfrefxform #3

Closed u-fischer closed 7 years ago

u-fischer commented 7 years ago

I reported this issue already through the texlive list but thought it useful to add an entry here too.

syntex has a bug in connection with \pdfrefxform (and the similar command of luatex).

The problem has already been reported in 2009 http://tug.org/pipermail/pdftex/2009-May/008027.html

The bug affects synchronisation if the clip-Option of \includegraphics is used (which is implemented with \pdfrefxform)

e.g. http://tex.stackexchange.com/questions/263105/synctex-fails-for-input-files-related-to-fancyhdr-graphicx

and is also imho the source of this problem https://sourceforge.net/p/pgf/bugs/333/

The minimal example from the report in 2009 is

\output={}
\setbox0=\hbox{FORM CONTENTS}
\pdfxform 0
AAA \pdfrefxform\pdflastxform\ BBB
\vfill\eject
\end

which leads to the synctex file with wrong nesting:

SyncTeX Version:1
Input:1:mini.tex
Output:pdf
Magnification:1000
Unit:1
X Offset:0
Y Offset:0
Content:
!103
{1
[1,5:4736286,46889208:30785863,42152922,0
(1,5:4736286,5391646:30785863,447828,0
h1,4:4736286,5391646:1310720,0,0
x1,4:7521569,5391646
g1,4:7740022,5391646
g1,4:13902237,5391646
x1,4:15294882,5391646
k1,5:35522149,5391646:20227267
g1,5:35522149,5391646
)
]
!265
{2
(1,2:0,447828:5943762,447828,0
x1,2:427806,447828
x1,2:2002493,447828
g1,2:2220946,447828
x1,2:5943762,447828
)
!120
}1
!8
}1
!6
Postamble:
Count:20
!23
Post scriptum:
jlaurens commented 7 years ago

This should have been fixed in TeXLive 2017 Changes must be done in the GUI frontends

With the above minimal example, the synctex file no longer has nested sheets

SyncTeX Version:1
Input:1:...................................................................tex
Output:pdf
Magnification:1000
Unit:1
X Offset:0
Y Offset:0
Content:
!166
{1
[1,5:4736286,46889208:30785863,42152922,0
(1,5:4736286,5391646:30785863,447828,0
h1,4:4736286,5391646:1310720,0,0
x1,4:7521569,5391646
g1,4:7740022,5391646
f1:7740022,5391646
g1,4:13902237,5391646
x1,4:15294882,5391646
k1,5:35522149,5391646:20227267
g1,5:35522149,5391646
)
]
x1,5:427806,447828
k1,2:4736286,46889208:-18205
x1,2:2002493,447828
g1,2:2220946,447828
x1,2:5943762,447828
!392
!5
}1
!6
Postamble:
Count:18
!23
Post scriptum: