From 41ab3e046f0a73c1eb9e75cfe7999a3fc24724e1 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 31 May 2018 17:12:28 +0200 Subject: \item needs a special processing. moved it back into brkcmd() function --- arabluatex.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'arabluatex.lua') diff --git a/arabluatex.lua b/arabluatex.lua index acb7b06..a395929 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -62,7 +62,6 @@ local albrkcmds = { "RLfootnote", "LRfootnote", "LRmarginpar", - "item", "Footnote", "Marginpar", "edtext", @@ -105,6 +104,13 @@ local function breakcmd(str) str = gsub(str, dblbkslash * lpeg.Cs(brkcmds[i]) * cmdargs, "}%1%2%3\\arb{") end end + -- process \item[], then \item[] + str = string.gsub(str, "\\(item.?)(%b[])", + function(tag, body) + body = string.sub(body, 2, -2) + return string.format("}\\item[\\arb{%s}] \\arb{", body) + end) + str = string.gsub(str, "(\\item)(%s+)", "%1{}%2") -- \textcolor str = string.gsub(str, "\\(textcolor.?)(%b{})(%b{})", function(tag, bodycolor, bodytext) -- cgit v1.2.3