On 3/9/2016 8:48 PM, Frank Mittelbach wrote:
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"

it helps if you also set some more (either explicit or at the tex level), like:

  looseness=1,
  tolerance=4500,
  pretolerance=100,
  emergencystretch=655360


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------

Reply via email to