summaryrefslogtreecommitdiff
path: root/tex/context/base/spac-ver.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2013-08-01 01:31:00 +0200
committerHans Hagen <pragma@wxs.nl>2013-08-01 01:31:00 +0200
commita67b2ca32562c280f4d291292e735d5c43515f58 (patch)
treeb8297f4afc27c474a4703c85ccc1e0ca45f05c1b /tex/context/base/spac-ver.lua
parentbcad533e9ab26e0b6cf2fe84af11ba012d8dd76c (diff)
downloadcontext-a67b2ca32562c280f4d291292e735d5c43515f58.tar.gz
beta 2013.08.01 01:31
Diffstat (limited to 'tex/context/base/spac-ver.lua')
-rw-r--r--tex/context/base/spac-ver.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua
index de3a1f1e8..7bca7e8a1 100644
--- a/tex/context/base/spac-ver.lua
+++ b/tex/context/base/spac-ver.lua
@@ -95,6 +95,7 @@ local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local whatsit_code = nodecodes.whatsit
+local texnest = tex.nest
local vspacing = builders.vspacing or { }
builders.vspacing = vspacing
@@ -785,8 +786,17 @@ function vspacing.snapbox(n,how)
end
end
+-- I need to figure out how to deal with the prevdepth that crosses pages. In fact,
+-- prevdepth is often quite interfering (even over a next paragraph) so I need to
+-- figure out a trick.
+
local function forced_skip(head,current,width,where,trace)
- if where == "after" then
+ if head == current and head.subtype == baselineskip_code then
+ width = width - head.spec.width
+ end
+ if width == 0 then
+ -- do nothing
+ elseif where == "after" then
head, current = insert_node_after(head,current,new_rule(0,0,0))
head, current = insert_node_after(head,current,new_kern(width))
head, current = insert_node_after(head,current,new_rule(0,0,0))
@@ -1176,6 +1186,7 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also
else
head, tail = insert_node_after(head,tail,glue_data)
end
+texnest[texnest.ptr].prevdepth = 0 -- appending to the list bypasses tex's prevdepth handler
end
if trace then
if glue_data or penalty_data then
@@ -1282,6 +1293,15 @@ function vspacing.collapsevbox(n) -- for boxes but using global a_snapmethod
end
end
+-- This one is needed to prevent bleeding of prevdepth to the next page
+-- which doesn't work well with forced skips.
+
+local outer = texnest[0]
+
+function vspacing.resetprevdepth()
+ outer.prevdepth = 0
+end
+
-- interface
commands.vspacing = vspacing.analyze
@@ -1289,3 +1309,4 @@ commands.vspacingsetamount = vspacing.setskip
commands.vspacingdefine = vspacing.setmap
commands.vspacingcollapse = vspacing.collapsevbox
commands.vspacingsnap = vspacing.snapbox
+commands.resetprevdepth = vspacing.resetprevdepth