diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-09-10 21:16:35 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-09-10 21:16:35 +0200 |
commit | 58c7c9288160407c874930aac789ef6ef3faa6b5 (patch) | |
tree | 9cc1d4be11cd66b4e4f77209bac07d41c8d949ee /tex/context/base/mkiv/strc-ref.lua | |
parent | 438b065a2337ee587442f25ddc587c4762f4d0b0 (diff) | |
download | context-58c7c9288160407c874930aac789ef6ef3faa6b5.tar.gz |
2019-09-10 20:11:00
Diffstat (limited to 'tex/context/base/mkiv/strc-ref.lua')
-rw-r--r-- | tex/context/base/mkiv/strc-ref.lua | 38 |
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 |