⇤ ← Revision 1 as of 20050516 18:17:56
2706
Comment:

← Revision 2 as of 20090920 23:52:17 ⇥
2706
converted to 1.6 markup

No differences found! 
Derivation of the stepping algorithm
The stepping algorithm was devised by Luca Furini, and is described on the page TableLayout/KnuthElementsForTables. On this page we show how the algorithm can be derived.
We step through the table from one possible breakpoint to the next. This algorithm specifies how to assign Knuth elements at each possible breakpoint.
We define the following quantities:
noBreakHeight is the height without page breaks
stepHeighti is the height before the page break at step i
maxRemainingHeighti is the height after the page break at step i
penaltyHeighti is the height of the penalty at step i
boxHeighti is the height of the box at step i
totalBoxHeighti = Sum(j=1 .. i) boxHeightj
prevTotalBoxHeighti = totalBoxHeight(i1)
prevMaxRemainingHeighti = maxRemainingHeight(i1)
Note that maxRemainingHeight0 = noBreakHeight.
The assigned Knuth boxes and penalties together make up the step height:
totalBoxHeighti + penaltyHeighti = stepHeighti
The strategy of the algorithm is to split the step height between the boxes and a penalty as follows: the penalty is equal to the extra height that is caused by this page break. That is:
penaltyHeighti = stepHeighti + maxRemainingHeighti  noBreakHeight
Therefore:
totalBoxHeighti = noBreakHeight  maxRemainingHeighti
This means that the total box height is that part of the nobreak height that at this step definitely appears before the page break.
The penalty height at each step can be calculated from the above formula. The box height at each step can be calculated as follows:
boxHeighti = totalBoxHeighti  totalBoxHeight(i1) = noBreakHeight  maxRemainingHeighti  (noBreakHeight  maxRemainingHeight(i1)) = maxRemainingHeight(i1)  maxRemainingHeighti = prevMaxRemainingHeighti  maxRemainingHeighti
or as follows:
boxHeighti + totalBoxHeight(i1) = noBreakHeight  maxRemainingHeighti => boxHeighti = noBreakHeight  maxRemainingHeighti  totalBoxHeight(i1) = noBreakHeight  maxRemainingHeighti  prevTotalBoxHeighti
The algorithm can also be derived by reverting the logic of the derivation: The strategy of the algorithm is to split the step height between the boxes and a penalty as follows: The total box height is equal to that part of the height that definitively appears before the page break. That is:
totalBoxHeighti = noBreakHeight  maxRemainingHeighti
Therefore:
penaltyHeighti = stepHeighti + maxRemainingHeighti  noBreakHeight