diff options
author | Robert Alessi <alessi@robertalessi.net> | 2022-09-08 14:36:46 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2022-09-08 14:36:46 +0200 |
commit | 7e5b8ff0ebd8a5fbe789ea5c80d0be1d3038ec5c (patch) | |
tree | 56e16889d31b7f7a9b3e5ddb0111f192b646b5cc | |
parent | de0d2fc6be9726bd9a6e265fac653e6f8bd3cdcb (diff) | |
download | ekdosis-7e5b8ff0ebd8a5fbe789ea5c80d0be1d3038ec5c.tar.gz |
teiexport: process TeX grouping inside braces
-rw-r--r-- | ekdosis.dtx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index a1c3bb0..fc39141 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -12051,6 +12051,29 @@ local function cmdtotei(str) | |||
12051 | body = cmdtotei(body) | 12051 | body = cmdtotei(body) |
12052 | return string.format("<%s>%s</%s>", cmd, body, cmd) | 12052 | return string.format("<%s>%s</%s>", cmd, body, cmd) |
12053 | end) | 12053 | end) |
12054 | str = string.gsub(str, "\\([%{%}])", function(brace) | ||
12055 | if brace == "{" | ||
12056 | then | ||
12057 | brace = "ekd@ob" | ||
12058 | else | ||
12059 | brace = "ekd@cb" | ||
12060 | end | ||
12061 | return brace | ||
12062 | end) | ||
12063 | str = gsub(str, bcbraces, function(inbraces) | ||
12064 | inbraces = string.sub(inbraces, 2, -2) | ||
12065 | inbraces = cmdtotei(inbraces) | ||
12066 | return inbraces | ||
12067 | end) | ||
12068 | str = string.gsub(str, "ekd@([oc])b", function(oc) | ||
12069 | if oc == "o" | ||
12070 | then | ||
12071 | oc = "{" | ||
12072 | else | ||
12073 | oc = "}" | ||
12074 | end | ||
12075 | return oc | ||
12076 | end) | ||
12054 | str = string.gsub(str, "(%s)(%>)", "%2") | 12077 | str = string.gsub(str, "(%s)(%>)", "%2") |
12055 | return str | 12078 | return str |
12056 | end | 12079 | end |