I do not really understand what is the relation with macro packages and _ because it is just raw luatex. ``` \def\test{\directlua{tex.set_synctex_line(421)}} \test \directlua{print('421=',tex.get_synctex_line())} \bye ``` This code expectedly prints "421=421" to the console. If we replace line by tag, this does not work ``` \def\test{\directlua{tex.set_synctex_tag(421)}} \test \directlua{print('421=',tex.get_synctex_tag())} \bye ``` This code unexpectedly prints "421=1" to the console. On the contrary ``` \directlua{tex.set_synctex_tag(421)} \directlua{print('421=',tex.get_synctex_tag())} \bye ``` expectedly prints "421=421" to the console. If this is a feature it must definitely be documented because it is really special.
Le 27 mars 2022 à 14:54, Hans Hagen
a écrit : On 3/25/2022 4:51 PM, Jérôme LAURENS wrote:
We can use ``` \directlua{tex.set_synctex_tag(421)} \directlua{print('421=',tex.get_synctex_tag())} \bye ``` To set and read the synctex tag. But if we wrap this into a macro, things get broken and the synctex tag is not changed. ``` \def\test{\directlua{tex.set_synctex_tag(421)}} \test \directlua{print('421=',tex.get_synctex_tag())} \bye ``` For synctex_line there is no such problem. Is this a bug or a feature ? feature ... but mostly macro package related as that is responsible for the catcode of _ which is stored in the macro body
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 -----------------------------------------------------------------