From: Jacob Lifshay Date: Tue, 6 Sep 2022 10:48:20 +0000 (-0700) Subject: add support for , , and for latex conversion X-Git-Tag: opf_rfc_ls005_v1~656 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17416e444edffd4eccb82c186ca5f3c29db986b2;p=libreriscv.git add support for , , and for latex conversion --- 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__":