From e32ac2cdf0c79a237d21e0547284975c99e27f16 Mon Sep 17 00:00:00 2001 From: IGARASHI Masanao Date: Wed, 1 Jan 2014 20:55:19 +0900 Subject: [PATCH] Replace reST roles of subscript and superscript with the MathJax style at math directive block. request #1 --- ox-rst.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ox-rst.el b/ox-rst.el index a853a1f..ad1325a 100644 --- a/ox-rst.el +++ b/ox-rst.el @@ -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")