diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-pst.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/page-pst.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-pst.lua b/Master/texmf-dist/tex/context/base/page-pst.lua index 8586830cf24..50580ae3316 100644 --- a/Master/texmf-dist/tex/context/base/page-pst.lua +++ b/Master/texmf-dist/tex/context/base/page-pst.lua @@ -8,15 +8,23 @@ if not modules then modules = { } end modules ['page-pst'] = { -- todo: adapt message +local tonumber, next = tonumber, next local format, validstring = string.format, string.valid local sortedkeys = table.sortedkeys +local context = context +local commands = commands + +local texgetcount = tex.getcount +local texsetcount = tex.setcount + local cache = { } local function flush(page) local c = cache[page] if c then for i=1,#c do + -- characters.showstring(c[i]) context.viafile(c[i],format("page.%s",validstring(page,"nopage"))) end cache[page] = nil @@ -32,14 +40,14 @@ local function setnextpage() elseif n > 0 then -- upcoming page (realpageno) end - tex.setcount("global","c_page_postponed_blocks_next_page",n) + texsetcount("global","c_page_postponed_blocks_next_page",n) end function commands.flushpostponedblocks(page) -- we need to flush previously pending pages as well and the zero -- slot is the generic one so that one is always flushed local t = sortedkeys(cache) - local p = tonumber(page) or tex.count.realpageno or 0 + local p = tonumber(page) or texgetcount("realpageno") or 0 for i=1,#t do local ti = t[i] if ti <= p then @@ -54,7 +62,7 @@ end function commands.registerpostponedblock(page) if type(page) == "string" then if string.find(page,"^+") then - page = tex.count.realpageno + (tonumber(page) or 1) -- future delta page + page = texgetcount("realpageno") + (tonumber(page) or 1) -- future delta page else page = tonumber(page) or 0 -- preferred page or otherwise first possible occasion end |