diff options
author | Marius <mariausol@gmail.com> | 2013-12-31 00:00:25 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-12-31 00:00:25 +0200 |
commit | 386844fcee1ab9452cea887e4b5fba9001368026 (patch) | |
tree | 24c41eb2ce4a5cb83a6dc3faef7791a718f1ce21 /tex | |
parent | 07affb8dd8042a83c7d54d7c0bb7137ce04f987f (diff) | |
download | context-386844fcee1ab9452cea887e4b5fba9001368026.tar.gz |
beta 2013.12.30 22:40
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4126 -> 4128 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/l-package.lua | 2 | ||||
-rw-r--r-- | tex/context/base/pack-rul.lua | 73 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24634 -> 24540 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 228351 -> 228351 bytes | |||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
8 files changed, 47 insertions, 34 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 7049cf8d1..60cb19079 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.12.29 19:28} +\newcontextversion{2013.12.30 22:40} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex ad5b023ef..95266774e 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 95123348d..be68a3eb1 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.12.29 19:28} +\edef\contextversion{2013.12.30 22:40} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/l-package.lua b/tex/context/base/l-package.lua index 0dbff7c57..075fcde25 100644 --- a/tex/context/base/l-package.lua +++ b/tex/context/base/l-package.lua @@ -274,7 +274,7 @@ methods["qualified path"]=function(name) end methods["lua extra list"] = function(name) - return loadedbypath(addsuffix(lualibfile(name),"lua" ),name,getextraluapaths(),false,"lua") + return loadedbypath(addsuffix(lualibfile(name),"lua"),name,getextraluapaths(),false,"lua") end methods["lib extra list"] = function(name) diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua index fc6295018..1f41b505a 100644 --- a/tex/context/base/pack-rul.lua +++ b/tex/context/base/pack-rul.lua @@ -10,19 +10,23 @@ if not modules then modules = { } end modules ['pack-rul'] = { <p>An explanation is given in the history document <t>mk</t>.</p> --ldx]]-- -local hpack = node.hpack -local free = node.free -local copy = node.copy_list -local traverse_id = node.traverse_id -local node_dimensions = node.dimensions +-- we need to be careful with display math as it uses shifts +-- challenge: adapt glue_set +-- setfield(h,"glue_set", getfield(h,"glue_set") * getfield(h,"width")/maxwidth -- interesting ... doesn't matter much local hlist_code = nodes.nodecodes.hlist local vlist_code = nodes.nodecodes.vlist local box_code = nodes.listcodes.box +local line_code = nodes.listcodes.line local texsetdimen = tex.setdimen local texsetcount = tex.setcount local texgetbox = tex.getbox +local hpack = nodes.hpack +local free = nodes.free +local copy = nodes.copy_list +local traverse_id = nodes.traverse_id +local node_dimensions = nodes.dimensions function commands.doreshapeframedbox(n) local box = texgetbox(n) @@ -38,7 +42,7 @@ function commands.doreshapeframedbox(n) if boxwidth ~= 0 then -- and h.subtype == vlist_code local list = box.list if list then - local function check(n,usewidth) + local function check(n,repack) if not firstheight then firstheight = n.height end @@ -46,10 +50,15 @@ function commands.doreshapeframedbox(n) noflines = noflines + 1 local l = n.list if l then - if usewidth or n.subtype == box_code then -- maybe more - lastlinelength = n.width + if repack then + local subtype = n.subtype + if subtype == box_code or subtype == line_code then + lastlinelength = node_dimensions(l,l.dir) -- used to be: hpack(copy(l)).width + else + lastlinelength = n.width + end else - lastlinelength = node_dimensions(l) -- used to be: hpack(copy(l)).width + lastlinelength = n.width end if lastlinelength > maxwidth then maxwidth = lastlinelength @@ -61,39 +70,43 @@ function commands.doreshapeframedbox(n) end end local hdone = false - -- local vdone = false for h in traverse_id(hlist_code,list) do -- no dir etc needed - check(h) + check(h,true) hdone = true end + -- local vdone = false for v in traverse_id(vlist_code,list) do -- no dir etc needed - check(v) + check(v,false) -- vdone = true end - if firstheight then - if maxwidth ~= 0 then - if hdone then - for h in traverse_id(hlist_code,list) do - local l = h.list - if l then - if h.subtype == box_code then - -- explicit box, no 'line' - else - -- if h.width ~= maxwidth then -- else no display math handling (uses shift) - -- challenge: adapt glue_set - -- h.glue_set = h.glue_set * h.width/maxwidth -- interesting ... doesn't matter much - -- h.width = maxwidth - h.list = hpack(l,maxwidth,'exactly',h.dir) - h.shift = 0 -- needed for display math - h.width = maxwidth - -- end - end + if not firstheight then + -- done + elseif maxwidth ~= 0 then + if hdone then + for h in traverse_id(hlist_code,list) do + local l = h.list + if l then + local subtype = h.subtype + if subtype == box_code or subtype == line_code then + h.list = hpack(l,maxwidth,'exactly',h.dir) + h.shift = 0 -- needed for display math end + h.width = maxwidth end end box.width = maxwidth -- moved averagewidth = noflines > 0 and totalwidth/noflines or 0 end + -- if vdone then + -- for v in traverse_id(vlist_code,list) do + -- local width = n.width + -- if width > maxwidth then + -- v.width = maxwidth + -- end + -- end + -- end + box.width = maxwidth + averagewidth = noflines > 0 and totalwidth/noflines or 0 end end end diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 74315adf7..c0b423c4e 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 04c498a7d..f836ffa32 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index c0748c698..1e9c82e04 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 12/29/13 19:28:51 +-- merge date : 12/30/13 22:40:58 do -- begin closure to overcome local limits and interference |