TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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.