From 4c6b2057b47961198ade9efc21dea4402538ac2b Mon Sep 17 00:00:00 2001
From: Robert Alessi ")) * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{")
- * lpeg.Cs(envtotags[i].a) * lpeg.P("}")
- * bcbracesii * spcenc^-1,
- "\n<"..envtotags[i].b..envtotags[i].c..">")
+ -- str = gsub(str, lpeg.P("\\par") * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{")
+ -- * lpeg.Cs(envtotags[i].a) * lpeg.P("}")
+ -- * bcbracesii * spcenc^-1,
+ -- "\n<"..envtotags[i].b..envtotags[i].c..">")
-- else
-- str = gsub(str, (lpeg.P("\\par") + lpeg.P(" ")) * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{")
-- * lpeg.Cs(envtotags[i].a) * lpeg.P("}")
-- * bcbracesii * spcenc^-1,
-- "
") + -- str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") + -- * lpeg.Cs(envtotags[i].a) * lpeg.P("}") * spcenc^-1 * lpeg.P("\\par"), + -- ""..envtotags[i].b..">\n") str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}") * bcbracesii * spcenc^-1, - "<"..envtotags[i].b..envtotags[i].c..">") + "\\p@rb <"..envtotags[i].b..envtotags[i].c..">") str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), - ""..envtotags[i].b..">\n
") + ""..envtotags[i].b..">\\p@ra ") else str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}") @@ -1854,13 +1857,21 @@ end local function partotei(str) str = gsub(str, lpeg.P(lpeg.P("\\par") * spcenc^1)^1, "\\par ") + str = gsub(str, ((para + parb) * par^-1)^2, "\\p@r ") + str = string.gsub(str, "\\p@ra%s?", "
") + str = string.gsub(str, "\\p@rb%s?", "
") + str = string.gsub(str, "\\p@r%s?", "") +-- str = gsub(str, lpeg.P(lpeg.P("\\p@r") * spcenc^1)^1, "\\p@r ") +-- str = gsub(str, lpeg.P(lpeg.P("\\p@r") * spcenc^1 * (lpeg.P("\\par") * spcenc^1)^-1)^1, "\\p@r ") str = string.gsub(str, "%s?\\par%s?", "", 1) + --str = string.gsub(str, "(\\par)(%s-)(%<%/?div%d?)", "%3") + str = string.gsub(str, "(%
)(%s-)(%<%/?div%d?)", "%3") str = string.gsub(str, "%s?\\par%s?", "
") str = string.gsub(str, "
%s?
", "") str = string.gsub(str, "(%)%s?(%)$", "%2") str = string.gsub(str, "(%
)%s?$", "") str = string.gsub(str, "(
)%s?(
)%s?(
.-)", "%2%1") + -- str = string.gsub(str, "(%)%s?(
.-)", "%2%1") return str end @@ -1980,7 +1991,7 @@ local function ekddivs_totei(str) if teitype ~= "" then teitype = " type=\""..teitype.."\"" else end if tein ~= "" then tein = " n=\""..tein.."\"" else end if teidepth ~= "" then teidepth = " depth=\""..teidepth.."\"" else end - return string.format("\\par %s", + return string.format("%s", teitype, tein, teidepth, teihead) else return "" @@ -1999,7 +2010,7 @@ local function section_totei(str) else ctr = divdepth[secname] arg = string.sub(arg, 2, -2) - return string.format("\\par