diff options
Diffstat (limited to 'tex/context/base/supp-box.lua')
-rw-r--r-- | tex/context/base/supp-box.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tex/context/base/supp-box.lua b/tex/context/base/supp-box.lua index 7ba349a6b..d3a4f57e5 100644 --- a/tex/context/base/supp-box.lua +++ b/tex/context/base/supp-box.lua @@ -394,3 +394,27 @@ interfaces.implement { context.lastnaturalboxwd(false) end } + +local function firstdirinbox(n) + local b = getbox(n) + if b then + local l = getlist(b) + if l then + for h in traverse_id(hlist_code,l) do + return getfield(h,"dir") + end + end + end +end + +nodes.firstdirinbox = firstdirinbox + +local doifelse = commands.doifelse + +interfaces.implement { + name = "doifelserighttoleftinbox", + arguments = "integer", + actions = function(n) + doifelse(firstdirinbox(n) == "TRT") + end +} |