From b751f23f0eef64bd270fb5ebe607180c35820cd1 Mon Sep 17 00:00:00 2001 From: IGARASHI Masanao Date: Tue, 24 Dec 2013 14:04:25 +0900 Subject: [PATCH] use interpreted text role to export subscript and superscript (fix #1) --- README.org | 14 ++++++++++++++ ox-rst.el | 8 ++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index 03f51dc..af210ed 100644 --- a/README.org +++ b/README.org @@ -340,6 +340,20 @@ ,**bold** *italic* underlined ``code`` ``verbatim`` strike-through #+END_SRC +** Subscript and superscript + + Org: +#+BEGIN_EXAMPLE + H_{2}O + E = mc^2 +#+END_EXAMPLE + + reStructuredText: +#+BEGIN_SRC rst + H\ :sub:`2`\ O + E = mc\ :sup:`2`\ +#+END_SRC + ** Horizontal rules Org: diff --git a/ox-rst.el b/ox-rst.el index 1a8f6d0..a853a1f 100644 --- a/ox-rst.el +++ b/ox-rst.el @@ -1317,9 +1317,7 @@ holding contextual information." "Transcode a SUBSCRIPT object from Org to reStructuredText. CONTENTS is the contents of the object. INFO is a plist holding contextual information." - (if (org-element-property :use-brackets-p subscript) - (format "_{%s}" contents) - (format "_%s" contents))) + (format "\\ :sub:`%s`\\ " contents)) ;;;; Superscript @@ -1328,9 +1326,7 @@ contextual information." "Transcode a SUPERSCRIPT object from Org to reStructuredText. CONTENTS is the contents of the object. INFO is a plist holding contextual information." - (if (org-element-property :use-brackets-p superscript) - (format "_{%s}" contents) - (format "_%s" contents))) + (format "\\ :sup:`%s`\\ " contents)) ;;;; Table