summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-num.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-12-02 16:13:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-12-02 16:13:00 +0100
commit385d565a79224fddf5b230163e58415038111d3b (patch)
tree811db898685d8b23ff2da3f9dff9cdd4b59703f7 /tex/context/base/strc-num.lua
parentf0515ed4b1a731629538988c70d8309f44391bf2 (diff)
downloadcontext-385d565a79224fddf5b230163e58415038111d3b.tar.gz
beta 2010.12.02 16:13
Diffstat (limited to 'tex/context/base/strc-num.lua')
-rw-r--r--tex/context/base/strc-num.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/tex/context/base/strc-num.lua b/tex/context/base/strc-num.lua
index c2f989070..1fefd864c 100644
--- a/tex/context/base/strc-num.lua
+++ b/tex/context/base/strc-num.lua
@@ -182,9 +182,10 @@ end
function counters.define(name, start, counter, method) -- todo: step
local d = allocate(name,1)
d.start = start
+ d.state = variables.start or ""
if counter ~= "" then
d.counter = counter -- only for special purposes, cannot be false
- d.method = method -- frozen at define time
+ d.method = method -- frozen at define time
end
end
@@ -374,13 +375,13 @@ end
function counters.add(name,n,delta)
local cd = counterdata[name]
- if cd and cd.state == variables.start then
+--~ table.print(cd,name)
+ if cd and (cd.state == variables.start or cd.state == "") then
local data = cd.data
local d = allocate(name,n)
--- table.print(cd)
d.number = (d.number or d.start or 0) + delta*(d.step or 0)
+ -- d.own = nil
local level = cd.level
--- print(name,n,level)
if not level or level == -1 then
-- -1 is signal that we reset manually
elseif level == -2 then