[luatex] kerning/ligature callback problem with ltluatex

Werner LEMBERG wl at gnu.org
Fri Jul 28 10:38:34 CEST 2023


Consider the following lua file `latex.lua`

```
function test(head, tail)
  node.ligaturing(head)
  io.write('\nafter ligaturing callback\n')
end

luatexbase.add_to_callback('ligaturing', test, 'test')
```

together with this simple LaTeX input file

```
\documentclass{article}

\directlua{dofile('latex.lua')}

\begin{document}
ffi
\end{document}
```

If I run this with `lualatex latex.tex`, I see 'after ligaturing
callback' in the logfile and a proper `ffi` ligature in the PDF.

However, if I comment out the `node.ligaturing(head)` line and run
this command, I *also* get the `ffi` ligature, which seems wrong to me
– I'm replacing the 'ligaturing' callback with something of my own, so
why is `node.ligaturing` (or rather its internal luatex version) still
executed?

What am I missing?  BTW, if I do something similar with plain TeX and
`callback.register`, everything works as expected.


    Werner



More information about the luatex mailing list.