pkamenarsky / formulae

Mirror of ftp://ftp.cs.uni-sb.de/formulae - "A Functional Description of TeX's Formula Layout"
13 stars 8 forks source link

makeVBox seems to contract the TeXBook #1

Open kevinbarabash opened 6 years ago

kevinbarabash commented 6 years ago

Page 82/83 in the TeXBook provide a detailed explanation of how vboxes are constructed:

  1. If the vertical list contains no boxes, the depth is zero.
  2. If there’s at least one box, but if the final box is followed by kerning or glue, possibly with intervening penalties or other things, the depth is zero.
  3. If there’s at least one box, and if the final box is not followed by kerning or glue, raise lower the depth is the depth of that box.
  4. However, if the depth computed by rules (1), (2), or (3) exceeds \boxmaxdepth, the depth will be the current value of \boxmaxdepth.

(Plain TEX sets \boxmaxdepth to the largest possible dimension; therefore rule (4) won’t apply unless you specify a smaller value. When rule (4) does decrease the depth, TEX adds the excess depth to the box’s natural height, essentially moving the reference point down until the depth has been reduced to the stated maximum.)

makeVBox includes the vsize of all items in the dnList plus the depth of the reference node. I was wondering why this changes was made?

pkamenarsky commented 6 years ago

Unfortunately I have no idea - I just uploaded the code to Github in case the original source disappears.

kevinbarabash commented 6 years ago

Thanks for the response. Do you know who wrote the code?

pkamenarsky commented 6 years ago

From the README:

This directory contains a re-implementation of TeX's formula layout written in Standard ML of New Jersey, version 109.2 by Reinhold Heckmann, Universitaet des Saarlandes, following suggestions by Reinhard Wilhelm, Universitaet des Saarlandes.