From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: latex export of \ce question Date: Mon, 21 Apr 2014 21:14:41 -0700 Message-ID: <874n1m9f0u.fsf@berkeley.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcS8N-0002Jn-4Z for emacs-orgmode@gnu.org; Tue, 22 Apr 2014 00:16:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcS89-0004p7-5y for emacs-orgmode@gnu.org; Tue, 22 Apr 2014 00:16:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:55163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcS88-0004ni-VD for emacs-orgmode@gnu.org; Tue, 22 Apr 2014 00:16:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WcS88-0003Hb-7q for emacs-orgmode@gnu.org; Tue, 22 Apr 2014 06:16:24 +0200 Received: from c-67-164-45-159.hsd1.ca.comcast.net ([67.164.45.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Apr 2014 06:16:24 +0200 Received: from richard.lawrence by c-67-164-45-159.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Apr 2014 06:16:24 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: John Kitchin Hi John, John Kitchin writes: > If I have this in an org file: > > \ce{ABO_3} > \ce{ABO_{3-\delta}} > > this exports as > \ce{ABO_3} > \ce\{ABO$_{\text{3-}\delta}$\} > > The first one is fine, but the second one is not. The nested {} seems to > mess it up. Is there a way to get this to export correctly? Hmm. I've played around with this a little, and the best solution I've got is to use an explicit fallback to LaTeX, like: #+LATEX: \ce{ABO_{3-\delta}} ...or whatever literal LaTeX is the right output for your situation. (What is the correct export output in this case? In particular, should the contents of the subscript be in math mode?) The problem does indeed seem to be the embedded braces...I'm guessing this is an inherent limitation, resulting form the fact that Org uses regular expressions to recognize LaTeX expressions. If this is something you need to do all the time, and the #+LATEX syntax doesn't work for you (e.g. if you also need HTML export), you could look into an Org macro or an export filter. Best, Richard (If possible, please encrypt your reply to me using my PGP key: Key ID: CF6FA646 Fingerprint: 9969 43E1 CF6F A646. See http://www.ocf.berkeley.edu/~rwl/encryption.html for more information.)