[luatex] Bug in tex.linebreak ?

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Mar 9 20:48:35 CET 2016


I think I found a bug in tex.linebreak.

Consider the following code


function prelinebreak (head, groupnode)  --- for pre_linebreak_filter
                                          --- for example
   local n,t

   n, t = tex.linebreak(node.copy_list(head), {looseness = -1})
   print("looseness=" .. t.looseness)
   n, t = tex.linebreak(node.copy_list(head), {looseness = 0})
   print("looseness=" .. t.looseness)

   return true

end

and pass it in head a long enough hlist so that looseness -1 actually 
works. The second line breaking with looseness=0 reports the previous 
looseness ... same happens if you have looseness=+2 or +1 or so

it seems that tex.linebreak always reports the looseness of the previous 
linebreak action in case you pass it a "0"

regards
frank


More information about the luatex mailing list