diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-04-25 14:10:48 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-04-25 14:10:48 +0200 |
commit | 4668b7323a6bc1b01e72418fb646b697d68bbcb7 (patch) | |
tree | 926785b550bed158e0489d209edbab366c6997c2 /tex/context/base/mkiv/strc-pag.lua | |
parent | 55666205c2c1a7287105e23f58e2047c1e0dbc5a (diff) | |
download | context-4668b7323a6bc1b01e72418fb646b697d68bbcb7.tar.gz |
2016-04-25 13:34:00
Diffstat (limited to 'tex/context/base/mkiv/strc-pag.lua')
-rw-r--r-- | tex/context/base/mkiv/strc-pag.lua | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/strc-pag.lua b/tex/context/base/mkiv/strc-pag.lua index 96d26e6f6..dcd35fc20 100644 --- a/tex/context/base/mkiv/strc-pag.lua +++ b/tex/context/base/mkiv/strc-pag.lua @@ -263,12 +263,23 @@ function helpers.prefix(data,prefixspec) end end +function helpers.pageofinternal(n,prefixspec,pagespec) + local data = structures.references.internals[n] + if not data then + -- error + elseif prefixspec then + helpers.prefixpage(data,prefixspec,pagespec) + else + helpers.prefix(data,pagespec) + end +end + function pages.is_odd(n) n = n or texgetcount("realpageno") if texgetcount("pagenoshift") % 2 == 0 then - return n % 2 == 0 - else return n % 2 ~= 0 + else + return n % 2 == 0 end end @@ -277,9 +288,9 @@ function pages.on_right(n) if pagemode == 2 or pagemode == 1 then n = n or texgetcount("realpageno") if texgetcount("pagenoshift") % 2 == 0 then - return n % 2 == 0 - else return n % 2 ~= 0 + else + return n % 2 == 0 end else return true @@ -399,3 +410,9 @@ implement { -- weird place } } } + +interfaces.implement { + name = "pageofinternal", + arguments = { "integer" }, + actions = helpers.pageofinternal, +} |