emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Nick Dokos: Re: Superscripts in LaTeX export
@ 2009-09-29  0:07 Nick Dokos
  0 siblings, 0 replies; only message in thread
From: Nick Dokos @ 2009-09-29  0:07 UTC (permalink / raw)
  To: emacs-orgmode

[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 <nicholas.dokos@hp.com>
To:      Giovanni Ridolfi <giovanni.ridolfi@yahoo.it>
cc:      nicholas.dokos@hp.com
Subject: Re: [Orgmode] Superscripts in LaTeX export

Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> wrote:

> --- Lun 28/9/09, Nick Dokos <nicholas.dokos@hp.com> ha scritto:
> > Giovanni Ridolfi <giovanni.ridolfi@yahoo.it>
> > 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).


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-29  0:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29  0:07 Nick Dokos: Re: Superscripts in LaTeX export Nick Dokos

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


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).