[luatex] A bug in synctex code

user202729 at protonmail.com user202729 at protonmail.com
Sat Sep 28 03:49:30 CEST 2024


Hi,

It looks like there is a bug in the synctex code. Please take a look.

(In particular, the node is a kern node but the macro assumes it's a glue node. This gives incorrect values in the generated synctex file, with the fix it gives correct values.)

```
diff --git a/source/texk/web2c/synctexdir/synctex.c b/source/texk/web2c/synctexdir/synctex.c
index b9b5d8a..c2fe83f 100644
--- a/source/texk/web2c/synctexdir/synctex.c
+++ b/source/texk/web2c/synctexdir/synctex.c
@@ -2060,14 +2060,14 @@ static inline void synctex_record_node_kern(halfword p)
 #   endif
     if (SYNCTEX_SHOULD_COMPRESS_V) {
         len = SYNCTEX_fprintf(SYNCTEX_FILE, "k%i,%i:%i,=:%i\n",
-                              SYNCTEX_TAG_MODEL(p,glue),
-                              SYNCTEX_LINE_MODEL(p,glue),
+                              SYNCTEX_TAG_MODEL(p,kern),
+                              SYNCTEX_LINE_MODEL(p,kern),
                               SYNCTEX_CTXT_CURH UNIT,
                               SYNCTEX_WIDTH(p) UNIT);
     } else {
         len = SYNCTEX_fprintf(SYNCTEX_FILE, "k%i,%i:%i,%i:%i\n",
-                              SYNCTEX_TAG_MODEL(p,glue),
-                              SYNCTEX_LINE_MODEL(p,glue),
+                              SYNCTEX_TAG_MODEL(p,kern),
+                              SYNCTEX_LINE_MODEL(p,kern),
                               SYNCTEX_CTXT_CURH UNIT,
                               SYNCTEX_CTXT_CURV UNIT,
                               SYNCTEX_WIDTH(p) UNIT);
```

Please take a look. Thank you.



More information about the luatex mailing list.