[luatex] rounding errors with node.dimensions?

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Apr 13 13:22:45 CEST 2016


Am 13.04.16 um 12:22 schrieb Hans Hagen:
>
> i guess float calculations like these will never be roundtrip (and
> opening up the engine exposes some of these phenomena)

quite possible (or at least probably difficult to avoid without a lot of 
overhead)

> so, a next release will be a bit more accurate but still not exact
> roundtrip

well, if it would be explitily known that one can be off by X sp as a 
maximum or even if it would be known that one can be off and that the 
resulting value is not necessarily the same that you would get from the 
real packer that would be extremely helpful --- ie explicitly stating 
that in the manual and adjusting the example given there:

------------

This calling method takes glue settings into account and is especially 
useful for finding the actual width of a sublist of nodes that are 
already boxed, for example in code like this, which prints the width of 
the space in between the a and b as it would be if \box0 was used as-is:
\setbox0 = \hbox to 20pt {a b}
\directlua{print (node.dimensions(
     tex.box[0].glue_set,
     tex.box[0].glue_sign,
     tex.box[0].glue_order,
     tex.box[0].head.next,
     node.tail(tex.box[0].head)
)) }

-------------

as written now, it really claims "actual width" ... and that isn't true

frank


More information about the luatex mailing list