summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/strc-ref.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/strc-ref.lua')
-rw-r--r--tex/context/base/mkiv/strc-ref.lua38
1 files changed, 31 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index e01bacaac..ec5ed5e03 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -2603,16 +2603,40 @@ implement {
arguments = { "string", "boolean", "boolean" }
}
-local function referencerealpage()
+-- local function referencerealpage()
+-- local actions = references.currentset
+-- return not actions and 0 or actions.realpage or setreferencerealpage(actions)
+-- end
+--
+-- implement {
+-- name = "referencerealpage",
+-- actions = { referencerealpage, context },
+-- -- arguments = "string" -- hm, weird
+-- }
+--
+-- implement {
+-- name = "referencerealpage",
+-- actions = function()
+-- local actions = references.currentset
+-- context(not actions and 0 or actions.realpage or setreferencerealpage(actions))
+-- end
+-- }
+
+local function referencepos(key)
local actions = references.currentset
- return not actions and 0 or actions.realpage or setreferencerealpage(actions)
+ local i = actions[1].i -- brrr
+ local v = 0
+ if i then
+ local a = i.references
+ if a then
+ v = a[key] or 0
+ end
+ end
+ context("%p",v)
end
-implement {
- name = "referencerealpage",
- actions = { referencerealpage, context },
- arguments = "string"
-}
+implement { name = "referenceposx", actions = function() referencepos("x") end }
+implement { name = "referenceposy", actions = function() referencepos("y") end }
local plist, nofrealpages