summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/page-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-07-20 21:48:33 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-07-20 21:48:33 +0200
commitdeab0bfe7f4be57121779e93bf291e518fda7cf3 (patch)
treed206a8e495944e2f6ce1d3dea688309012904825 /tex/context/base/mkiv/page-ini.lua
parente09328e5e3230ee408f6af2cd454848c4d056702 (diff)
downloadcontext-deab0bfe7f4be57121779e93bf291e518fda7cf3.tar.gz
2018-07-20 21:28:00
Diffstat (limited to 'tex/context/base/mkiv/page-ini.lua')
-rw-r--r--tex/context/base/mkiv/page-ini.lua43
1 files changed, 29 insertions, 14 deletions
diff --git a/tex/context/base/mkiv/page-ini.lua b/tex/context/base/mkiv/page-ini.lua
index 5b73c9729..3d5534128 100644
--- a/tex/context/base/mkiv/page-ini.lua
+++ b/tex/context/base/mkiv/page-ini.lua
@@ -41,23 +41,39 @@ function pages.mark(name,list)
local page = list[i]
local sign = false
if type(page) == "string" then
- local s, p = match(page,"([%+%-])(%d+)")
- if s then
- sign, page = s, p
+ local f, t = match(page,"(%d+)[:%-](%d+)")
+ if f and t then
+ f, t = tonumber(f), tonumber(t)
+ if f and t and f <= t then
+ if trace then
+ report("marking page %i upto %i as %a",f,t,name)
+ end
+ for page=f,t do
+ data[page][name] = true
+ end
+ end
+ page = false
+ else
+ local s, p = match(page,"([%+%-])(%d+)")
+ if s then
+ sign, page = s, p
+ end
end
end
- page = tonumber(page)
if page then
- if sign == "+" then
- page = realpage + page
- end
- if sign == "-" then
- report("negative page numbers are not supported")
- else
- if trace then
- report("marking page %i as %a",page,name)
+ page = tonumber(page)
+ if page then
+ if sign == "+" then
+ page = realpage + page
+ end
+ if sign == "-" then
+ report("negative page numbers are not supported")
+ else
+ if trace then
+ report("marking page %i as %a",page,name)
+ end
+ data[page][name] = true
end
- data[page][name] = true
end
end
end
@@ -75,7 +91,6 @@ local function marked(name)
rawset(data,i,nil)
end
local pagedata = rawget(data,realpage)
- print(pagedata and pagedata[name] and true or false)
return pagedata and pagedata[name] and true or false
end