emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Again problems with latex inside footnotes.
@ 2011-07-12  2:34 Rafael Calsaverini
  2011-07-12  3:02 ` Rafael Calsaverini
  2011-07-12 10:05 ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: Rafael Calsaverini @ 2011-07-12  2:34 UTC (permalink / raw)
  To: Lista - org-mode

[-- Attachment #1: Type: text/plain, Size: 814 bytes --]

Hi,
sorry for bothering you again with it, but I'm having a problem with latex
inside footnotes and I couldn't find the answer in the manual.

When I try something like:

----8<---
blablabla [fn:bla]
[fn:bla] this is what \cite{she} said.
----8<---

this gets exported as:

---8<---
blablabla \footnote{ this is what \cite\{she\} said.
---8<---

I believe I'm missing something very basic.
I believe that if I put a "#+Latex:xxx" the xxx part would be exported
verbatim to the latex file. But this would break the footnote. Is there a
way to insert inline latex snippets?

---
Rafael Calsaverini
Dep. de Física Geral, Sala 336
Instituto de Física - Universidade de São Paulo

rafael.calsaverini@gmail.com
http://stoa.usp.br/calsaverini/weblog
CEL: (11) 7525-6222
USP: (11) 3091-6803

[-- Attachment #2: Type: text/html, Size: 1191 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Again problems with latex inside footnotes.
  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
  2011-07-12 10:05 ` Nicolas Goaziou
  1 sibling, 1 reply; 6+ messages in thread
From: Rafael Calsaverini @ 2011-07-12  3:02 UTC (permalink / raw)
  To: Lista - org-mode

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

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

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

Sorry for any inconvenience.
--
Rafael Calsaverini
Dep. de Física Geral, Sala 336
Instituto de Física - Universidade de São Paulo

rafael.calsaverini@gmail.com
http://stoa.usp.br/calsaverini/weblog
CEL: (11) 7525-6222
USP: (11) 3091-6803

[-- Attachment #2: Type: text/html, Size: 1024 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Again problems with latex inside footnotes.
  2011-07-12  3:02 ` Rafael Calsaverini
@ 2011-07-12  6:37   ` Nick Dokos
  2011-07-13  8:40     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2011-07-12  6:37 UTC (permalink / raw)
  To: Rafael Calsaverini; +Cc: nicholas.dokos, Lista - org-mode

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Again problems with latex inside footnotes.
  2011-07-12  2:34 Again problems with latex inside footnotes Rafael Calsaverini
  2011-07-12  3:02 ` Rafael Calsaverini
@ 2011-07-12 10:05 ` Nicolas Goaziou
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2011-07-12 10:05 UTC (permalink / raw)
  To: Rafael Calsaverini; +Cc: Lista - org-mode

Hello,

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

> sorry for bothering you again with it

No problem.

> but I'm having a problem with latex inside footnotes and I couldn't
> find the answer in the manual.
>
> When I try something like:
>
> ----8<---
> blablabla [fn:bla]
> [fn:bla] this is what \cite{she} said.
> ----8<---
>
> this gets exported as:
>
> ---8<---
> blablabla \footnote{this is what \cite\{she\} said. }
> ---8<---

I have pushed a fix for that problem in master. May you try it to
confirm it works (or not...)?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Again problems with latex inside footnotes.
  2011-07-12  6:37   ` Nick Dokos
@ 2011-07-13  8:40     ` Bastien
  2011-07-13 17:33       ` Rafael Calsaverini
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2011-07-13  8:40 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Rafael Calsaverini, Lista - org-mode

Hi Rafael,

Nick Dokos <nicholas.dokos@hp.com> writes:

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

Yes, we need to rework the way the exporters handle espace chars,
especially the LaTeX one --- it's not only ugly and buggy.

Don't hold your breath though, I won't be on this before 7.7.

Thanks for your understanding,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Again problems with latex inside footnotes.
  2011-07-13  8:40     ` Bastien
@ 2011-07-13 17:33       ` Rafael Calsaverini
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael Calsaverini @ 2011-07-13 17:33 UTC (permalink / raw)
  To: Bastien; +Cc: nicholas.dokos, Lista - org-mode

[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]

Hi Bastien,


I have enough interest in using org-mode to produce latex texts to get
involved. I can't do it right now cause I'm in a critical time to produce
results for my thesis, but I've been delaying learning e-lisp and taking a
good look on org-mode for some time.

Nick Dokos above said that org-mode uses a huge regexp to parse the latex.
When this pressing phase pass I'll certainly take a look on that. I played a
bit (only a bit) with funcional parsers in Haskell (monadic parsers and
parsers based on arrows) and, in my experience, they are much, much more
easy to write and more powerful than regexp's (they can parse html! :D).
Well, lisp is functional... Maybe I'll take a look at this in the near
future.

---
Rafael Calsaverini
Dep. de Física Geral, Sala 336
Instituto de Física - Universidade de São Paulo

rafael.calsaverini@gmail.com
http://stoa.usp.br/calsaverini/weblog
CEL: (11) 7525-6222
USP: (11) 3091-6803



On Wed, Jul 13, 2011 at 05:40, Bastien <bzg@altern.org> wrote:

> Hi Rafael,
>
> Nick Dokos <nicholas.dokos@hp.com> writes:
>
> > 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].
>
> Yes, we need to rework the way the exporters handle espace chars,
> especially the LaTeX one --- it's not only ugly and buggy.
>
> Don't hold your breath though, I won't be on this before 7.7.
>
> Thanks for your understanding,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 2149 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-13 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-07-13  8:40     ` Bastien
2011-07-13 17:33       ` Rafael Calsaverini
2011-07-12 10:05 ` Nicolas Goaziou

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