emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Rafael Calsaverini <rafael.calsaverini@gmail.com>
Cc: nicholas.dokos@hp.com, Lista - org-mode <emacs-orgmode@gnu.org>
Subject: Re: Again problems with latex inside footnotes.
Date: Tue, 12 Jul 2011 02:37:52 -0400	[thread overview]
Message-ID: <11544.1310452672@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Rafael Calsaverini <rafael.calsaverini@gmail.com> of "Tue\, 12 Jul 2011 00\:02\:36 -0300." <CANWCfq+Ntsb9xp1q2ajYJ5ChmHKZH6qS2VN5WzRQsZ0R603PmQ@mail.gmail.com>

Rafael Calsaverini <rafael.calsaverini@gmail.com> wrote:

> Also, I have problems with equations even when I use \(...\) instead of $...$. 
> 
> This, for example:
> --8<--
> * example
> Example[fn:note].
> [fn:note]An equation: \(\bar{a}\).
> ---8<--
> 
> becomes this:
> 
> ---8<---
> Example\footnote{An equation: \(\bar\{a\}\). }.
> ---8<---
> 

Unfortunately, the LaTeX exporter does have a lot of weaknesses in this
area: it tends to escape special characters willy-nilly - sometimes
that's the right thing to do, sometimes not.

This particular escaping is done by org-export-latex-special-chars: this
basically loops over four (horrendous-looking) regexps and tries to find
all matches in the buffer for that regexp. It then proceeds to transform
the matched text (and matched pieces of text *around* the main match) in
some (hopefully meaningful) way. In this case, it fails.

The only way I know around this problem is a mechanism that Tom Dye
describes in his (excellent) LaTeX exporting tutorial on Worg. He
credits Lawrence Mitchell for the case that he describes in the tutorial.

Evaluate this expression

--8<---------------cut here---------------start------------->8---
(setq org-entities-user '(("l" "{" nil "" "" "" "")
                          ("r" "}" nil "" "" "" "")))
--8<---------------cut here---------------end--------------->8---

and then export the following:

--8<---------------cut here---------------start------------->8---

* example
Example[fn:note].
[fn:note] An equation:  \(\bar \l a\r \).


blablabla [fn:bla]
[fn:bla] this is what \cite\l she\r said.
--8<---------------cut here---------------end--------------->8---

The trick fools the exporter but there are added spaces - I know no
way to get rid of those.


> I'm not really sure, but I suspect this worked before I instaled the
> latest version of org-mode.

I doubt that. Although patches have been applied to deal with a host of
such problems, it is a long-standing problem that is unlikely to be
completely solved - ever[fn:1].

Nick

Footnotes:

[fn:1] ... although I would love to be proved wrong.

  reply	other threads:[~2011-07-12  6:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12  2:34 Again problems with latex inside footnotes Rafael Calsaverini
2011-07-12  3:02 ` Rafael Calsaverini
2011-07-12  6:37   ` Nick Dokos [this message]
2011-07-13  8:40     ` Bastien
2011-07-13 17:33       ` Rafael Calsaverini
2011-07-12 10:05 ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11544.1310452672@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rafael.calsaverini@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).