summaryrefslogtreecommitdiff
path: root/tex/context/base/tabl-xtb.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-02-08 21:04:00 +0100
committerHans Hagen <pragma@wxs.nl>2012-02-08 21:04:00 +0100
commitc5de3b109d06dbee374f754a7c86d7aac2c4ec3f (patch)
treef931e06e45076cd7f0c8c6232ff593fa8f464d54 /tex/context/base/tabl-xtb.lua
parent586e8f786598e3f3447e3dbe3589a54c9e6bb696 (diff)
downloadcontext-c5de3b109d06dbee374f754a7c86d7aac2c4ec3f.tar.gz
beta 2012.02.08 21:04
Diffstat (limited to 'tex/context/base/tabl-xtb.lua')
-rw-r--r--tex/context/base/tabl-xtb.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/tex/context/base/tabl-xtb.lua b/tex/context/base/tabl-xtb.lua
index 2f422578e..6ac5e1835 100644
--- a/tex/context/base/tabl-xtb.lua
+++ b/tex/context/base/tabl-xtb.lua
@@ -59,6 +59,7 @@ local new_penalty = nodepool.penalty
local v_stretch = variables.stretch
local v_normal = variables.normal
local v_width = variables.width
+local v_height = variables.height
local v_repeat = variables["repeat"]
local v_max = variables.max
@@ -516,6 +517,28 @@ end
function xtables.reflow_height()
data.currentrow = 0
data.currentcolumn = 0
+ local settings = data.settings
+ if settings.options[v_height] then
+ local heights = data.heights
+ local depths = data.depths
+ local nofrows = data.nofrows
+ local totalheight = 0
+ local totaldepth = 0
+ for i=1,nofrows do
+ totalheight = totalheight + heights[i]
+ totalheight = totalheight + depths [i]
+ end
+ local total = totalheight + totaldepth
+ local leftover = settings.textheight - total
+ if leftover > 0 then
+ local leftheight = (totalheight / total ) * leftover / #heights
+ local leftdepth = (totaldepth / total ) * leftover / #depths
+ for i=1,nofrows do
+ heights[i] = heights[i] + leftheight
+ depths [i] = depths [i] + leftdepth
+ end
+ end
+ end
end
local function showspans(data)