diff options
Diffstat (limited to 'tex/context/base/mkiv/strc-ref.lua')
-rw-r--r-- | tex/context/base/mkiv/strc-ref.lua | 23 |
1 files changed, 18 insertions, 5 deletions
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 |