Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When calling a function with a post_linebreak_filter callback, the nodelist only contains nodes of type 0 (hlist), 10 (glue) and 12 (penalty), whereas when using a pre_linebreak_filter callback, type 37 (glyph) nodes are also sent.

Is there a way to analyze glyph nodes of a paragraph after the paragraph has been rendered (in order to insert PDF annotations)?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

This is not really the whole story. See the LuaTeX wiki and there you'll see that the boxes 0 (hlists) that you find are in fact the lines and these lines contain the glyphs. So what you have to do is: if you find a hlist (id 0), go through the node list where the entry "head" points to. See my answer to the overfull rule question where I call magentabox again with head.head. And for analyzing the nodelist: to get a graphical representation to use with graphviz (gv) see this github gist.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.