all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [new exporter] problems exporting mathmode to LaTeX
@ 2012-07-18 10:13 Thomas Holst
  2012-07-18 11:48 ` Giovanni Ridolfi
  2012-07-18 13:46 ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Holst @ 2012-07-18 10:13 UTC (permalink / raw)
  To: Orgmode

Hi,

forgive me if I am nagging :-). One of my collegues and myself want to
switch to new exporter. While testing the new exporter on our existing
org-files we encounter these problems.

So here is the next one:
#+BEGIN_SRC org
  160\(^\circ\}\nbsp{}C
  -11^{\circ}\nbsp{}C
#+END_SRC

With the old exporter this becomes:
#+BEGIN_SRC latex
  160\(^\circ\)~C
  -11$^{\circ}$~C
#+END_SRC
in LaTeX. Which looks well in pdf.

With the new exporter it becomes:
#+BEGIN_SRC latex
  160\(^\circ\)~C
  -11$^{\mathrm{\^{}}}$~C
#+END_SRC
in LaTeX. Where the second construct obviously is not what is expected
and looks totaly wrong in pdf.

Again with emacs -Q
(emacs-version)
"GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-19 on 3249CTO"

(org-version)
Org-mode version 7.8.11
(release_7.8.11-201-g528b17
 @ c:/daten/users/de_hts2fe/git/org-mode/lisp/)

-- 
Bis neulich ...
  Thomas

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

* Re: [new exporter] problems exporting mathmode to LaTeX
  2012-07-18 10:13 [new exporter] problems exporting mathmode to LaTeX Thomas Holst
@ 2012-07-18 11:48 ` Giovanni Ridolfi
  2012-07-18 13:46 ` Nicolas Goaziou
  1 sibling, 0 replies; 6+ messages in thread
From: Giovanni Ridolfi @ 2012-07-18 11:48 UTC (permalink / raw)
  To: Thomas Holst, Orgmode

Da: Thomas Holst <thomas.holst@de.bosch.com>
Inviato: Mercoledì 18 Luglio 2012 12:13

> So here is the next one:
> #+BEGIN_SRC org
   160\(^\circ\}\nbsp{}C
  -11^{\circ}\nbsp{}C
> # +END_SRC

> With the new exporter it becomes:
> #+BEGIN_SRC latex
  160\(^\circ\)~C
  -11$^{\mathrm{\^{}}}$~C
> #+END_SRC
> in LaTeX. Where the second construct obviously is not what is expected

same here:

(emacs-version)
> "GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
> of 2011-09-19 on 3249CTO"

GNU Emacs 24.1.1 (i386-mingw-nt6.1.7601) of 2012-06-10 on MARVIN

(org-version)
> Org-mode version 7.8.11
> (release_7.8.11-201-g528b17

Org-mode version 7.8.11 (66767db5 

-- 
Bis neulich ...
  Thomas

----- Messaggio originale -----


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

* Re: [new exporter] problems exporting mathmode to LaTeX
  2012-07-18 10:13 [new exporter] problems exporting mathmode to LaTeX Thomas Holst
  2012-07-18 11:48 ` Giovanni Ridolfi
@ 2012-07-18 13:46 ` Nicolas Goaziou
  2012-07-18 14:18   ` Holst Thomas (DGS-EC/ESE4)
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2012-07-18 13:46 UTC (permalink / raw)
  To: Thomas Holst; +Cc: Orgmode

Hello,

Thomas Holst <thomas.holst@de.bosch.com> writes:

> So here is the next one:
> #+BEGIN_SRC org
>   160\(^\circ\}\nbsp{}C
>   -11^{\circ}\nbsp{}C
> #+END_SRC
>
> With the old exporter this becomes:
> #+BEGIN_SRC latex
>   160\(^\circ\)~C
>   -11$^{\circ}$~C
> #+END_SRC
> in LaTeX. Which looks well in pdf.
>
> With the new exporter it becomes:
> #+BEGIN_SRC latex
>   160\(^\circ\)~C
>   -11$^{\mathrm{\^{}}}$~C
> #+END_SRC
> in LaTeX. Where the second construct obviously is not what is expected
> and looks totaly wrong in pdf.

I don't know how you obtain this result, you may have settings different
than mine.

Anyway, the new exporter doesn't change anything with regards to src
blocks. It basically runs `org-export-blocks-preprocess' in a temporary
clone of the buffer being exported and then parses the obtained
expansion.

If you want to have a glimpse at what is really parsed, you can evaluate
the following snippet in the buffer you want to export:

  (let ((org-current-export-file (current-buffer)))
    (org-export-blocks-preprocess))

It may help to understand what is going on.


Regards,

-- 
Nicolas Goaziou

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

* Re: [new exporter] problems exporting mathmode to LaTeX
  2012-07-18 13:46 ` Nicolas Goaziou
@ 2012-07-18 14:18   ` Holst Thomas (DGS-EC/ESE4)
  2012-07-18 14:48     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Holst Thomas (DGS-EC/ESE4) @ 2012-07-18 14:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Orgmode

Hello Nicolas,

thanks for your answer.

Perhaps there is a misunderstanding. In my original post

#+BEGIN_SRC org / #+END_SRC means context of an org file *not* inside a block.

#+BEGIN_SRC LaTeX / #+END_SRC is the content of the tex-file generated by the exporters.

So it isn't about blocks. It is about LaTeX-fragments in org files.

Hope that helps to clarify what it is about.

--
Bis neulich ...
  Thomas

> -----Ursprüngliche Nachricht-----
> Von: Nicolas Goaziou [mailto:n.goaziou@gmail.com]
> Gesendet: Mittwoch, 18. Juli 2012 15:47
> An: Holst Thomas (DGS-EC/ESE4)
> Cc: Orgmode
> Betreff: Re: [new exporter] problems exporting mathmode to LaTeX
>
> Hello,
>
> Thomas Holst <thomas.holst@de.bosch.com> writes:
>
> > So here is the next one:
> > #+BEGIN_SRC org
> >   160\(^\circ\}\nbsp{}C
> >   -11^{\circ}\nbsp{}C
> > #+END_SRC
> >
> > With the old exporter this becomes:
> > #+BEGIN_SRC latex
> >   160\(^\circ\)~C
> >   -11$^{\circ}$~C
> > #+END_SRC
> > in LaTeX. Which looks well in pdf.
> >
> > With the new exporter it becomes:
> > #+BEGIN_SRC latex
> >   160\(^\circ\)~C
> >   -11$^{\mathrm{\^{}}}$~C
> > #+END_SRC
> > in LaTeX. Where the second construct obviously is not what
> is expected
> > and looks totaly wrong in pdf.
>
> I don't know how you obtain this result, you may have
> settings different
> than mine.
>
> Anyway, the new exporter doesn't change anything with regards to src
> blocks. It basically runs `org-export-blocks-preprocess' in a
> temporary
> clone of the buffer being exported and then parses the obtained
> expansion.
>
> If you want to have a glimpse at what is really parsed, you
> can evaluate
> the following snippet in the buffer you want to export:
>
>   (let ((org-current-export-file (current-buffer)))
>     (org-export-blocks-preprocess))
>
> It may help to understand what is going on.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

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

* Re: [new exporter] problems exporting mathmode to LaTeX
  2012-07-18 14:18   ` Holst Thomas (DGS-EC/ESE4)
@ 2012-07-18 14:48     ` Nicolas Goaziou
  2012-07-19  6:48       ` Thomas Holst
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2012-07-18 14:48 UTC (permalink / raw)
  To: Holst Thomas (DGS-EC/ESE4); +Cc: Orgmode

Hello,

"Holst Thomas (DGS-EC/ESE4)" <Thomas.Holst@de.bosch.com> writes:

> Perhaps there is a misunderstanding. 

There was. Now I get it.

> So it isn't about blocks. It is about LaTeX-fragments in org files.

Actually, it isn't about LaTeX-fragments but entities.  Your first line
contains a LaTeX-fragment: it appears (correctly) as-is in the LaTeX
output.

Though, the second line has an entity, \circ (see `org-entities'
variable), which is going to be replaced with "\^{}", as suggested by
the variable. I think that's not what you expect.

It seems that there is no Org entity providing \circ LaTeX symbol.
Maybe one should be added, if only to compose functions.  On the other
hand, for your specific case, there is the "deg" entity that may fit
your needs. I.e.⁡⁡⁡

  -11\deg\nbsp{}C

You can also enforce \circ by making it a real LaTeX-fragment. I.e.

  -11^{$\circ$}\nbsp{}C


As a final note, it seems there is still a bug in the new exporter,
since the expected output should be:

  -11$^{\^{}}$~C

There shouldn't be a \mathrm{} for a single command. I am going to fix
it.


Regards,

-- 
Nicolas Goaziou

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

* Re: [new exporter] problems exporting mathmode to LaTeX
  2012-07-18 14:48     ` Nicolas Goaziou
@ 2012-07-19  6:48       ` Thomas Holst
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Holst @ 2012-07-19  6:48 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Holst Thomas (DGS-EC/ESE4), Orgmode

Hi Niclolas,

thanks for your answer and explaination.

· Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
>
> "Holst Thomas (DGS-EC/ESE4)" <Thomas.Holst@de.bosch.com> writes:
>
>> Perhaps there is a misunderstanding. 
>
> There was. Now I get it.
>
>> So it isn't about blocks. It is about LaTeX-fragments in org files.
>
> Actually, it isn't about LaTeX-fragments but entities.  Your first line
> contains a LaTeX-fragment: it appears (correctly) as-is in the LaTeX
> output.
>
> Though, the second line has an entity, \circ (see `org-entities'
> variable), which is going to be replaced with "\^{}", as suggested by
> the variable. I think that's not what you expect.
>
> It seems that there is no Org entity providing \circ LaTeX symbol.
> Maybe one should be added, if only to compose functions.  On the other
> hand, for your specific case, there is the "deg" entity that may fit
> your needs. I.e.⁡⁡⁡
>
>   -11\deg\nbsp{}C

This works fine.

>
> You can also enforce \circ by making it a real LaTeX-fragment. I.e.
>
>   -11^{$\circ$}\nbsp{}C

This also works fine. 
>
> As a final note, it seems there is still a bug in the new exporter,
> since the expected output should be:
>
>   -11$^{\^{}}$~C
>
> There shouldn't be a \mathrm{} for a single command. I am going to fix
> it.

Thanks for looking into it and fixing it.

-- 
Bis neulich ...
  Thomas

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

end of thread, other threads:[~2012-07-19  6:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-18 10:13 [new exporter] problems exporting mathmode to LaTeX Thomas Holst
2012-07-18 11:48 ` Giovanni Ridolfi
2012-07-18 13:46 ` Nicolas Goaziou
2012-07-18 14:18   ` Holst Thomas (DGS-EC/ESE4)
2012-07-18 14:48     ` Nicolas Goaziou
2012-07-19  6:48       ` Thomas Holst

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.