> On 16 May 2021, at 16:53, Hans Hagen wrote: > > On 5/16/2021 2:52 PM, Otared Kavian wrote: >> Hi Hans, >> I have been noticing for some time that \setupsynctex does not work properly, at least in TeXShop on MacOS. >> A « filename.synctex » file is created but on most occasions it does not contain many lines, and one cannot go from the PDF file to the right location in the source file. >> Has something changed in the way synctex used to work ? >> Below I am sending you a test file with its PDF and .synctex files, for you to see for yourself. Sorry for the disturbance… > irr texshoip has soem setting for it (you need to check with Dick) which relates to a change in synctex > > anyway, this whole synctex thing is a mess ... it's rather bound to the way latex does things and way to complex due to these heuristics so it could never work well for context > > the reason you see little in the .synctex file is that context doesn't use the synctec library at all: i produce just what is needed directly, so we have a way more compact output (and also better 'real file' > tracking, plus avoiding generated stuff in the otr that makes no sense to sync to because it has no file; we also protect styles from being accessed that way) > > now, in my opinion, the biggest drawback of synctex is that one needs to compile it into the editor/viewer. Far better would have been to let the viewer call out to an external program (configurable) that reports back the file and line ... more flexible, better upward compatibility, no need to have the synctex code on board, hardly any code and no fuzzy heuristics to fight > > but I gave up communicating that because i cannot reason with the guy (different wavelengths .. years ago already) > > now, here is something to think about: > > >mtxrun --script synctex --list > mtx-synctex | invalid synctex log file %a > > >mtxrun --script synctex --list synctex-broken.synctex > mtx-synctex | begin page: 1 > mtx-synctex | end page: 1 > mtx-synctex | begin page: 2 > mtx-synctex | [ 71 135 177 149] : 9 : ./synctex-broken.tex > mtx-synctex | [ 181 135 224 149] : 2 : ./synctex-broken.tex > mtx-synctex | [ 71 163 290 178] : 14 : ./synctex-broken.tex > mtx-synctex | [ 71 178 290 193] : 17 : ./synctex-broken.tex > mtx-synctex | end page: 2 > mtx-synctex | begin page: 3 > mtx-synctex | [ 71 135 496 149] : 21 : ./synctex-broken.tex > mtx-synctex | [ 71 149 496 164] : 21 : ./synctex-broken.tex > mtx-synctex | [ 71 163 496 178] : 21 : ./synctex-broken.tex > mtx-synctex | [ 71 178 496 193] : 21 : ./synctex-broken.tex > mtx-synctex | [ 71 192 496 207] : 21 : ./synctex-broken.tex > mtx-synctex | [ 71 207 496 222] : 21 : ./synctex-broken.tex > mtx-synctex | [ 71 221 462 236] : 21 : ./synctex-broken.tex > mtx-synctex | end page: 3 > > >mtxrun --script synctex --report --page=3 --x=76 --y=140 synctex-broken.synctex --console > "./synctex-broken.tex" 21 > > see? the info is just there, so you can try to convince the texshop creator to support this: > > -- call an external program with these arrguments (the texhop editor knows the positions as it has the viewer built in) > -- go to reported file and line > > afaik synctex works for my collegue and scite/sumatra and actually he uses the fact that in context it also goes to positions in xml files because it tracks files and lines in xml nodes too (it's the reason why i support synctex at all, personally I never use(d) it) > > Hans > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > -----------------------------------------------------------------