From 17416e444edffd4eccb82c186ca5f3c29db986b2 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 6 Sep 2022 03:48:20 -0700 Subject: [PATCH] add support for , , and for latex conversion --- openpower/pandoc_img.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/openpower/pandoc_img.py b/openpower/pandoc_img.py index 0b135e081..7ecedaee2 100755 --- a/openpower/pandoc_img.py +++ b/openpower/pandoc_img.py @@ -110,9 +110,21 @@ def inlinenotes(k, v, f, meta): if k == 'Link': out.write(" link type %s\n" % (type(v[1][0]))) - if k == 'RawInline' and v[0] == 'html' \ - and re.fullmatch(r"< *br */? *>", v[1]): - return [RawInline('latex', r'\\')] + if k == 'RawInline' and v[0] == 'html': + if re.fullmatch(r"< *br */? *>", v[1]): + return [RawInline('latex', r'\\')] + if re.fullmatch(r"< *sup *>", v[1]): + return [RawInline('latex', r'\textsuperscript{')] + if re.fullmatch(r"< */ *sup *>", v[1]): + return [RawInline('latex', '}')] + if re.fullmatch(r"< *sub *>", v[1]): + return [RawInline('latex', r'\textsubscript{')] + if re.fullmatch(r"< */ *sub *>", v[1]): + return [RawInline('latex', '}')] + if re.fullmatch(r"< *small *>", v[1]): + return [RawInline('latex', r'{\small ')] + if re.fullmatch(r"< */ *small *>", v[1]): + return [RawInline('latex', '}')] if __name__ == "__main__": -- 2.30.2