Replace reST roles of subscript and superscript with the MathJax style at math directive block. request #1

This commit is contained in:
IGARASHI Masanao
2014-01-01 20:55:19 +09:00
parent b751f23f0e
commit e32ac2cdf0

View File

@@ -1202,7 +1202,15 @@ holding contextual information."
(org-export-solidify-link-text label)))
"\n"
(when contents
(org-rst--indent-string contents org-rst-quote-margin))))
(if (string= "math" directive)
(let* ((rcontents
(replace-regexp-in-string
"\\\\ :sub:`\\(.+\\)`\\\\ " "_{\\1}" contents))
(rcontents
(replace-regexp-in-string
"\\\\ :sup:`\\(.+\\)`\\\\ " "^{\\1}" rcontents)))
(org-rst--indent-string rcontents org-rst-quote-margin))
(org-rst--indent-string contents org-rst-quote-margin)))))
(t
(concat
(format "::\n")