emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How can I wrap the subscript into a math environment in Org-mode?
@ 2015-11-22  8:51 Lei Zhe
  2015-11-22 13:54 ` John Kitchin
  0 siblings, 1 reply; 2+ messages in thread
From: Lei Zhe @ 2015-11-22  8:51 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-22 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-22  8:51 How can I wrap the subscript into a math environment in Org-mode? Lei Zhe
2015-11-22 13:54 ` John Kitchin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).