summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/supp-box.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2020-06-12 18:46:32 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2020-06-12 18:46:32 +0200
commit2686f6014d16c6a1d059ebe579894f804a5b3c4c (patch)
tree66a904a7d3c63dcbf3e756796d6ac07b4841bc11 /tex/context/base/mkiv/supp-box.lua
parent8fb5c26bd2f15104a6db9945299d3ca2c75db2d6 (diff)
downloadcontext-2686f6014d16c6a1d059ebe579894f804a5b3c4c.tar.gz
2020-06-12 17:42:00
Diffstat (limited to 'tex/context/base/mkiv/supp-box.lua')
-rw-r--r--tex/context/base/mkiv/supp-box.lua27
1 files changed, 25 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/supp-box.lua b/tex/context/base/mkiv/supp-box.lua
index 353562344..a39bf392f 100644
--- a/tex/context/base/mkiv/supp-box.lua
+++ b/tex/context/base/mkiv/supp-box.lua
@@ -76,6 +76,7 @@ local getdimensions = nuts.dimensions
local hpack = nuts.hpack
local vpack = nuts.vpack
local traverse_id = nuts.traverse_id
+local traverse = nuts.traverse
local free = nuts.free
local findtail = nuts.tail
@@ -835,7 +836,7 @@ implement {
if CONTEXTLMTXMODE > 0 then
- interfaces.implement {
+ implement {
name = "widthuptohere",
public = true,
protected = true,
@@ -855,7 +856,7 @@ if CONTEXTLMTXMODE > 0 then
end
-interfaces.implement {
+implement {
name = "doifelseindented",
public = true,
protected = true,
@@ -882,3 +883,25 @@ interfaces.implement {
commands.doifelse(b)
end,
}
+
+implement {
+ name = "noflinesinbox",
+ public = true,
+ protected = false,
+ arguments = "integer",
+ actions = function(n)
+ local c = 0
+ local b = getbox(n)
+ if b then
+ b = getlist(b)
+ if b then
+ for n, id in traverse(b) do
+ if id == hlist_code or id == vlist_code then
+ c = c + 1
+ end
+ end
+ end
+ end
+ context(c)
+ end,
+}