emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] How can I wrap the subscript into a math environment in Org-mode?


From: Lei Zhe
Subject: [O] How can I wrap the subscript into a math environment in Org-mode?
Date: Sun, 22 Nov 2015 17:51:40 +0900

I have some subscripts in my org file like B_25, B_30. These
subscripts can be exported to LaTeX like B_{25}, B_{30}. However, I
want part of the subscripts like B to be exported as italic /B/. As
one solution for this, I can wrap these thing into a math environment
like \(B_{25}\). But since my file contains large numbers of these
subscripts, I would like to implement this in a programmable way.

I found a subscript filter function in org-mode, so I tried to use it
to wrap the subscripts by

(defun wrap-subscript-with-math-environment (contents backend info)
  (when (eq backend 'latex)
   (format "\\(%s\\)" contents)))

(add-to-list 'org-export-filter-subscript-functions
'wrap-subscript-with-math-environment)
However, the results exported are like B\($_{\text{25}}$ \). It seems
like the subscript filter contents only contain _25 part. Does anyone
have some solutions about this?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]