emacs-orgmode
[Top][All Lists]
Advanced

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

Nick Dokos: Re: [Orgmode] Superscripts in LaTeX export


From: Nick Dokos
Subject: Nick Dokos: Re: [Orgmode] Superscripts in LaTeX export
Date: Mon, 28 Sep 2009 20:07:43 -0400

[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 <address@hidden>
To:      Giovanni Ridolfi <address@hidden>
cc:      address@hidden
Subject: Re: [Orgmode] Superscripts in LaTeX export

Giovanni Ridolfi <address@hidden> wrote:

> --- Lun 28/9/09, Nick Dokos <address@hidden> ha scritto:
> > Giovanni Ridolfi <address@hidden>
> > 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





reply via email to

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