From 0c75a2acf592eb4360685375904440f5e6b8125a Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 12 Nov 2019 19:54:50 +0100 Subject: 2019-11-12 18:53:00 --- tex/context/base/mkiv/strc-ref.lua | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'tex/context/base/mkiv/strc-ref.lua') diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua index a4f31ec0c..da2d50120 100644 --- a/tex/context/base/mkiv/strc-ref.lua +++ b/tex/context/base/mkiv/strc-ref.lua @@ -2615,8 +2615,8 @@ implement { -- } implement { - name = "referencerealpage", - actions = function() + name = "referencerealpage", + actions = function() local actions = references.currentset context(not actions and 0 or actions.realpage or setreferencerealpage(actions)) end @@ -2632,11 +2632,24 @@ local function referencepos(key) v = a[key] or 0 end end - context("%p",v) + return v end -implement { name = "referenceposx", actions = function() referencepos("x") end } -implement { name = "referenceposy", actions = function() referencepos("y") end } +implement { name = "referenceposx", actions = function() context("%p",referencepos("x")) end } +implement { name = "referenceposy", actions = function() context("%p",referencepos("y")) end } + + +implement { + name = "referencecolumn", + actions = function() + local actions = references.currentset + local column = 1 + if actions then + column = jobpositions.columnofpos(actions.realpage or setreferencerealpage(actions),referencepos("x")) + end + context(column or 1) + end +} local plist, nofrealpages -- cgit v1.2.3