There are situations where synctex info is not available: consider ``` \immediate\openin 0 {subfile.tex} \immediate\read 0 to \My \immediate\closein 0 \My \bye ``` Synctex does not see `subfile.tex` at all, which forbids any kind of synchronization between subfile.tex and main.pdf.
It would be very cool if the \openin could create a new tag and the \read could use that tag while parsing subfile.tex. A synctex information about the line number would be very nice as well, a default of 1 is far better than nothing.
A tex.get_synctex_tag_for_name(‘foo') would be extremely handy.
Finally, raw setters and getters should be provided for synctex tag and line, to control exactly what tag and line is written to the .synctex file. No save stack for them, no mode. Simply raw.
Some global synctex state stack would help: save_synctex_state/restore_synctex_state…
BTW that would be great to deactivate set_synctex_tag for mode 0 just like set_synctex_line is.
On 3/30/2022 9:18 PM, Jérôme LAURENS wrote: the 'forced' tag and line always win and opening files is under callback control so basically one can (only) use those in combination with synctex mode set from the lua end; it has never been the intention to provide interfaces to synctex beyond forcing tag and line numbers that end up in nodes; the only reason that there is that little bit of (lua) alternative interfacing is that in context we had to get around some limitations (afaiwn synctex works ok with plain latex but not that well with context so we had to hack around a bit) .. basically synctex support is just a black box as in the other tex engines and not really part of 'opening up the internals' (also because in the end the output should be useable by the synctex file interpretation code) 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 -----------------------------------------------------------------