summaryrefslogtreecommitdiff
path: root/tex/context/base/pack-rul.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-10-20 01:21:09 +0300
committerMarius <mariausol@gmail.com>2013-10-20 01:21:09 +0300
commitb8ac6d7b7fdb16293c28034c349efd5b0b7b20b3 (patch)
tree0e9051dbe21b4e9cfc72fe594df5b0fe7bc511f3 /tex/context/base/pack-rul.lua
parent965214d981e6129b782c67adcaf3a81aedcb0bac (diff)
downloadcontext-b8ac6d7b7fdb16293c28034c349efd5b0b7b20b3.tar.gz
beta 2013.10.20 07:09
Diffstat (limited to 'tex/context/base/pack-rul.lua')
-rw-r--r--tex/context/base/pack-rul.lua37
1 files changed, 20 insertions, 17 deletions
diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua
index a990936e7..909c0c168 100644
--- a/tex/context/base/pack-rul.lua
+++ b/tex/context/base/pack-rul.lua
@@ -10,16 +10,21 @@ if not modules then modules = { } end modules ['pack-rul'] = {
<p>An explanation is given in the history document <t>mk</t>.</p>
--ldx]]--
-local texsetdimen, texsetcount, texbox = tex.setdimen, tex.setcount, tex.box
-local hpack, free, copy, traverse_id = node.hpack, node.free, node.copy_list, node.traverse_id
-local texdimen, texcount = tex.dimen, tex.count
+local hpack = node.hpack
+local free = node.free
+local copy = node.copy_list
+local traverse_id = node.traverse_id
+local node_dimensions = node.dimensions
local hlist_code = nodes.nodecodes.hlist
local box_code = nodes.listcodes.box
-local node_dimensions = node.dimensions
+
+local texsetdimen = tex.setdimen
+local texsetcount = tex.setcount
+local texgetbox = tex.getbox
function commands.doreshapeframedbox(n)
- local box = texbox[n]
+ local box = texgetbox(n)
local noflines = 0
local firstheight = nil
local lastdepth = nil
@@ -76,17 +81,16 @@ function commands.doreshapeframedbox(n)
end
end
end
- -- print("reshape", noflines, firstheight or 0, lastdepth or 0)
- texsetcount("global","framednoflines", noflines)
- texsetdimen("global","framedfirstheight", firstheight or 0)
- texsetdimen("global","framedlastdepth", lastdepth or 0)
- texsetdimen("global","framedminwidth", minwidth)
- texsetdimen("global","framedmaxwidth", maxwidth)
- texsetdimen("global","framedaveragewidth", noflines > 0 and totalwidth/noflines or 0)
+ texsetcount("global","framednoflines",noflines)
+ texsetdimen("global","framedfirstheight",firstheight or 0)
+ texsetdimen("global","framedlastdepth",lastdepth or 0)
+ texsetdimen("global","framedminwidth",minwidth)
+ texsetdimen("global","framedmaxwidth",maxwidth)
+ texsetdimen("global","framedaveragewidth",noflines > 0 and totalwidth/noflines or 0)
end
function commands.doanalyzeframedbox(n)
- local box = texbox[n]
+ local box = texgetbox(n)
local noflines = 0
local firstheight = nil
local lastdepth = nil
@@ -102,8 +106,7 @@ function commands.doanalyzeframedbox(n)
end
end
end
- -- print("analyze", noflines, firstheight or 0, lastdepth or 0)
- texsetcount("global","framednoflines", noflines)
- texsetdimen("global","framedfirstheight", firstheight or 0)
- texsetdimen("global","framedlastdepth", lastdepth or 0)
+ texsetcount("global","framednoflines",noflines)
+ texsetdimen("global","framedfirstheight",firstheight or 0)
+ texsetdimen("global","framedlastdepth",lastdepth or 0)
end