diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-09-09 23:45:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-09-09 23:45:00 +0200 |
commit | cf3f5ed936ab0e84942af2e69862db6941c58d0f (patch) | |
tree | 195b942015faff3d0c03d0d1627185320e002548 /tex/context/base/strc-num.lua | |
parent | 536e4dd4fe2e98c3cefdb9741507c20f4489e2c0 (diff) | |
download | context-cf3f5ed936ab0e84942af2e69862db6941c58d0f.tar.gz |
beta 2010.09.09 23:45
Diffstat (limited to 'tex/context/base/strc-num.lua')
-rw-r--r-- | tex/context/base/strc-num.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tex/context/base/strc-num.lua b/tex/context/base/strc-num.lua index 1b26a4a7a..f42b11b32 100644 --- a/tex/context/base/strc-num.lua +++ b/tex/context/base/strc-num.lua @@ -161,9 +161,17 @@ local function savevalue(name,i) local cd = counterdata[name].data[i] local cs = tobesaved[name][i] local cc = collected[name] + if trace_counters then + report_counters("saving value %s of counter named %s",cd.number,name) + end local cr = cd.range local old = (cc and cc[i] and cc[i][cr]) or 0 - cs[cr] = cd.number + local number = cd.number + if cd.method == variables.page then + -- we can be one page ahead + number = number - 1 + end + cs[cr] = (number >= 0) and number or 0 cd.range = cr + 1 return old else @@ -171,11 +179,12 @@ local function savevalue(name,i) end end -function counters.define(name, start, counter) -- todo: step +function counters.define(name, start, counter, method) -- todo: step local d = allocate(name,1) d.start = start if counter ~= "" then d.counter = counter -- only for special purposes, cannot be false + d.method = method -- frozen at define time end end |