summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-17 12:57:46 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-17 12:57:46 +0200
commitc3f271b54f49742caad01663c00d2911c31ed8fc (patch)
tree1e32dfae8b2327839438d562b5b11541485a6e63
parenteba2c4f2e152ffcf75a571ece2b08915e073db89 (diff)
downloadcontext-rst-c3f271b54f49742caad01663c00d2911c31ed8fc.tar.gz
bullet numbering offset rewritten in the proper ConTeXt way
-rw-r--r--rst_context.lua20
1 files changed, 6 insertions, 14 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 80bbd3b..f0fae72 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -594,41 +594,33 @@ local function parse_itemstring(str)
if str:match("%.$") then
setup = setup .. [[stopper={.\\space}]]
end
+ if str:match("^%d") then
+ -- http://thread.gmane.org/gmane.comp.tex.context/61728/focus=61729
+ setup = setup .. ",start=" .. tonumber(str:match("^%d+")) - 1
+ str = "n"
+ end
setup = setup
str = itemstripper:match(str)
str = enumeration_types[str] or str
- if str:match("^%d") then
- offset = tonumber(str:match("^%d+")) - 1
- str = "n"
- end
- return {setup = setup, str = str, offset = offset}
+ return {setup = setup, str = str}
end
function rst_context.startitemize(str)
local setup = ""
local result = ""
- local offset
str = string.strip(str)
local listtype = enumeration_types[str] or parse_itemstring(str)
if type(listtype) == "table" then
- --print(type(listtype), listtype[2])
setup = listtype.setup
- offset = listtype.offset
listtype = listtype.str
end
result = [[
\\startitemize[]] .. listtype .. setup .. [[]
]]
- if offset then
- result = result .. [[
-
-\\setnumber[itemgroup:itemize]{]] .. offset .. [[}
-]]
- end
return result
end