Show the hyphenation points

From LuaTeXWiki

Jump to: navigation, search

This LaTeX example adds a function to the post_linebreak_filter callback. The function iterates through all the nodes in the paragraph (and descends into the vlist and hlist nodes) and inserts a small rule where the discretionary nodes are.

show_hyph = function(head)
  while head do
    if == 0 or == 1 then % hlist, vlist
      show_hyph(head.list) % should be head.head in a newer luatex than 0.64
    elseif == 7 then             % disc
      local n ="whatsit","pdf_literal")
      n.mode = 0 = "q 0.3 w 0 2 m 0 7 l S Q" =
      n.prev = head = n
      head = n
  head =
  return true


Personal tools