From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Nick Dokos: Re: Superscripts in LaTeX export Date: Mon, 28 Sep 2009 20:07:43 -0400 Message-ID: <24699.1254182863@gamaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsQGy-0003a7-Go for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 20:08:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsQGt-0003S1-Li for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 20:08:51 -0400 Received: from [199.232.76.173] (port=43377 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsQGt-0003Rt-Bg for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 20:08:47 -0400 Received: from vms173011pub.verizon.net ([206.46.173.11]:42477) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsQGs-0003MA-Np for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 20:08:46 -0400 Received: from gamaville.dokosmarshall.org ([98.110.172.159]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KQP00FEWHNOEV40@vms173011.mailsrvcs.net> for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 19:07:05 -0500 (CDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org [Forgot to copy the list - again. Giovanni, apologies for the duplicate.] ------- Forwarded Message Date: Mon, 28 Sep 2009 20:04:33 -0400 From: Nick Dokos To: Giovanni Ridolfi cc: nicholas.dokos@hp.com Subject: Re: [Orgmode] Superscripts in LaTeX export Giovanni Ridolfi wrote: > --- Lun 28/9/09, Nick Dokos ha scritto: > > Giovanni Ridolfi > > wrote: > > > ** A Brief History of Attempts to Interpret the > > > \( ^{14}\)C Dates > > Did it work for you or are you saying that theoretically it > > *should* work? > > I didn't try. I thought it should have worked. > > > PS. I also tried the standard trick: {}^{14}C. It didn't > > work either. > > The LaTeX code generated precedes all the special > > characters with backslashes. > > > > So it should be something concerning the export > of the heading. > No, it happens in other places as well: ``foo ^{14}C'' is mishandled both in headings and in content, whereas ``foo x^{14}C'' is handled correctly, so as Thomas surmised initially, it seems to be the space preceding the ^ that causes it. The breakage seems to happen in org-export-latex-treat-sub-super-char where the following test fails for string-before when it is a space, but succeeds when it is e.g. ``x'': ,---- | ... | ;; this is part of a math formula | ((and (string-match "\\S-+" string-before) | (string-match "\\S-+" string-after)) `---- The question is what would break if the first string-match were allowed to match a space. E.g. the following "fixes" this problem but I have no idea what it breaks - probably too many things: ,---- | ... | ;; this is part of a math formula | ((and t ;(string-match "\\S-+" string-before) | (string-match "\\S-+" string-after)) `---- Note btw that ``foo ^{14}C'' is exported correctly to HTML (both in headers and in content). Thanks, Nick PS. Here is the org file I've been playing with: ,---- | #+OPTIONS: LaTeX:t ^:t | | * foo ^{14}C | | foo ^{14}C `---- ------- End of Forwarded Message