From c3f271b54f49742caad01663c00d2911c31ed8fc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 17 Sep 2010 12:57:46 +0200 Subject: bullet numbering offset rewritten in the proper ConTeXt way --- rst_context.lua | 20 ++++++-------------- 1 file 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 -- cgit v1.2.3