emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX equation align in orgmode?
@ 2015-09-28 19:10 Rainer M Krug
  2015-09-29  4:06 ` Andreas Leha
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Rainer M Krug @ 2015-09-28 19:10 UTC (permalink / raw)
  To: emacs-orgmode

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


Hi

I would need in a document several equations which are aligned as in 
http://tex.stackexchange.com/a/167908/6941

How can I use the following latex formula in orgmode?

--8<---------------cut here---------------start------------->8---
\begin{proof} The proof is a follows: 
\begin{align}
(x+y)^3&=(x+y)(x+y)^2\\
       &=(x+y)(x^2+2xy+y^2)\\
       &=x^3+3x^2y+3xy^3+x^3.\qedhere
\end{align}
\end{proof}
--8<---------------cut here---------------end--------------->8---

I have effectrively

--8<---------------cut here---------------start------------->8---
#+LATEX_HEADER: \usepackage{amsmath}

* The equations

\begin{equation}
\begin{align}
(x+y)^3&=(x+y)(x+y)^2\\
       &=(x+y)(x^2+2xy+y^2)\\
       &=x^3+3x^2y+3xy^3+x^3.\qedhere
\end{align}
\end{equation}
--8<---------------cut here---------------end--------------->8---

but with latex fragment preview (C-c C-x C-l) I only get an empty frame.

How can use this align environment in org?

I could use


--8<---------------cut here---------------start------------->8---
\begin{eqnarray*}
\hat{f}(x) & \propto & \sum_{\nu} \frac{|F(\nu)H(\nu)|^2}{|N(\nu)|^2}  
           \frac{G(\nu)}{H(\nu)} e^{\frac{2 \pi i \nu x}{N}}\\
           & \propto & \sum_{\nu} \frac{|F(\nu)|^2}{|N(\nu)|^2} H(\nu) H^*(\nu) 
           \frac{G(\nu)}{H(\nu)} e^{\frac{2 \pi i \nu x}{N}}\\
           & \propto & \sum_{\nu} H^*(\nu) G(\nu) e^{\frac{2 \pi i \nu x}{N}}
\end{eqnarray*}
--8<---------------cut here---------------end--------------->8---

but eqnarray is apparently bad (see link above).

Thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

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

* Re: LaTeX equation align in orgmode?
  2015-09-28 19:10 LaTeX equation align in orgmode? Rainer M Krug
@ 2015-09-29  4:06 ` Andreas Leha
  2015-09-29  7:52   ` BUG?: LaTeX equation align in orgmode? - even in -Q Rainer M Krug
  2015-09-29  8:24   ` LaTeX equation align in orgmode? Ken Mankoff
  2015-09-29  7:38 ` Eric S Fraga
  2015-09-29 15:49 ` Nicolas Goaziou
  2 siblings, 2 replies; 19+ messages in thread
From: Andreas Leha @ 2015-09-29  4:06 UTC (permalink / raw)
  To: emacs-orgmode

Hi Rainer,

Rainer M Krug <Rainer@krugs.de> writes:
> Hi
>
> I would need in a document several equations which are aligned as in 
> http://tex.stackexchange.com/a/167908/6941
>
> How can I use the following latex formula in orgmode?
>
> \begin{proof} The proof is a follows: 
> \begin{align}
> (x+y)^3&=(x+y)(x+y)^2\\
>        &=(x+y)(x^2+2xy+y^2)\\
>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
> \end{align}
> \end{proof}
>
>
> I have effectrively
>
> #+LATEX_HEADER: \usepackage{amsmath}
>
> * The equations
>
> \begin{equation}
> \begin{align}
> (x+y)^3&=(x+y)(x+y)^2\\
>        &=(x+y)(x^2+2xy+y^2)\\
>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
> \end{align}
> \end{equation}
>
>
> but with latex fragment preview (C-c C-x C-l) I only get an empty frame.
>
> How can use this align environment in org?

This seems to a problem with your setup of preview latex.  It
should work just fine.

For me the following org file works as expected -- also with
previewing the equation.

--8<---------------cut here---------------start------------->8---
#+LaTeX_header: \usepackage{amsmath} %% needed explicitely for org-preview-latex


* Test align

\begin{align}
(x+y)^3&=(x+y)(x+y)^2\\
       &=(x+y)(x^2+2xy+y^2)\\
       &=x^3+3x^2y+3xy^3+x^3.\qedhere
\end{align}
--8<---------------cut here---------------end--------------->8---

I do not seem to have any special setup for previewing latex,
though...

Sorry to be of no further help.

Regards,
Andreas

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

* Re: LaTeX equation align in orgmode?
  2015-09-28 19:10 LaTeX equation align in orgmode? Rainer M Krug
  2015-09-29  4:06 ` Andreas Leha
@ 2015-09-29  7:38 ` Eric S Fraga
  2015-09-29  8:09   ` SOLVED: " Rainer M Krug
  2015-09-29 13:43   ` Rasmus
  2015-09-29 15:49 ` Nicolas Goaziou
  2 siblings, 2 replies; 19+ messages in thread
From: Eric S Fraga @ 2015-09-29  7:38 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

On Monday, 28 Sep 2015 at 21:10, Rainer M Krug wrote:
> Hi
>
> I would need in a document several equations which are aligned as in 
> http://tex.stackexchange.com/a/167908/6941

I use align all the time.

> How can I use the following latex formula in orgmode?
>
> \begin{proof} The proof is a follows: 
> \begin{align}
> (x+y)^3&=(x+y)(x+y)^2\\
>        &=(x+y)(x^2+2xy+y^2)\\
>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
> \end{align}
> \end{proof}

Where is proof defined? You may need to add specific packages to
org-latex-packages-alist.

In any case, I find that it is safer generally to enclose all LaTeX
fragments in a LaTeX block: #+begin_latex ... #+end_latex.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.1-203-g4ca3d3

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

* BUG?:  LaTeX equation align in orgmode? - even in -Q
  2015-09-29  4:06 ` Andreas Leha
@ 2015-09-29  7:52   ` Rainer M Krug
  2015-09-29  8:24   ` LaTeX equation align in orgmode? Ken Mankoff
  1 sibling, 0 replies; 19+ messages in thread
From: Rainer M Krug @ 2015-09-29  7:52 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2584 bytes --]

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Hi Rainer,
>
> Rainer M Krug <Rainer@krugs.de> writes:
>> Hi
>>
>> I would need in a document several equations which are aligned as in 
>> http://tex.stackexchange.com/a/167908/6941
>>
>> How can I use the following latex formula in orgmode?
>>
>> \begin{proof} The proof is a follows: 
>> \begin{align}
>> (x+y)^3&=(x+y)(x+y)^2\\
>>        &=(x+y)(x^2+2xy+y^2)\\
>>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
>> \end{align}
>> \end{proof}
>>
>>
>> I have effectrively
>>
>> #+LATEX_HEADER: \usepackage{amsmath}
>>
>> * The equations
>>
>> \begin{equation}
>> \begin{align}
>> (x+y)^3&=(x+y)(x+y)^2\\
>>        &=(x+y)(x^2+2xy+y^2)\\
>>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
>> \end{align}
>> \end{equation}
>>
>>
>> but with latex fragment preview (C-c C-x C-l) I only get an empty frame.
>>
>> How can use this align environment in org?
>
> This seems to a problem with your setup of preview latex.  It
> should work just fine.

But it doesn't:

- I started emacs with -Q
- executed the following in scratch to load newest org
--8<---------------cut here---------------start------------->8---
;; Load up Org Mode and Org Babel for elisp embedded in Org Mode files
(add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
(add-to-list 'load-path "~/.emacs.d/org-mode/contrib/lisp")

;; load up Org-mode and Org-babel
(require 'org)
--8<---------------cut here---------------end--------------->8---
- pasted this in an org buffer
--8<---------------cut here---------------start------------->8---
#+LaTeX_header: \usepackage{amsmath} %% needed explicitely for org-preview-latex

* General conditions
The general conditions for all parametrizations are the following:

\begin{equation}
     x=\sqrt{b}
\end{equation}

\begin{equation}
\begin{align*}
(x+y)^3&=(x+y)(x+y)^2\\
       &=(x+y)(x^2+2xy+y^2)\\
       &=x^3+3x^2y+3xy^3+x^3.\qedhere
\end{align*}
\end{equation}


\begin{eqnarray*}
\hat{f}(x) & \propto & \sum_{\nu} \frac{|F(\nu)H(\nu)|^2}{|N(\nu)|^2}  
           \frac{G(\nu)}{H(\nu)} e^{\frac{2 \pi i \nu x}{N}}\\
           & \propto & \sum_{\nu} \frac{|F(\nu)|^2}{|N(\nu)|^2} H(\nu) H^*(\nu) 
           \frac{G(\nu)}{H(\nu)} e^{\frac{2 \pi i \nu x}{N}}\\
           & \propto & \sum_{\nu} H^*(\nu) G(\nu) e^{\frac{2 \pi i \nu x}{N}}
\end{eqnarray*}

--8<---------------cut here---------------end--------------->8---

- did C-c C-x C-l (which runs (org-preview-latex-fragment)) on each
formula and I got the attached screenshot [1]


[-- Attachment #1.2: Screenshot.png --]
[-- Type: image/png, Size: 103790 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 1370 bytes --]


,----
| Org-mode version 8.3.1 (release_8.3.1-283-gf6187d @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)
| GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F27)) of 2015-09-29
`----

to make sure, I emptied the ltxpng folder - still the same.

Could somebody confirm this or give me an idea how I can debug this?

Rainer

>
> For me the following org file works as expected -- also with
> previewing the equation.
>
> #+LaTeX_header: \usepackage{amsmath} %% needed explicitely for org-preview-latex
>
>
> * Test align
>
> \begin{align}
> (x+y)^3&=(x+y)(x+y)^2\\
>        &=(x+y)(x^2+2xy+y^2)\\
>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
> \end{align}
>
> I do not seem to have any special setup for previewing latex,
> though...
>
> Sorry to be of no further help.
>
> Regards,
> Andreas
>
>


Footnotes: 
[1]  https://www.dropbox.com/s/z41qyzwakx9yby0/Screenshot.png?dl=0

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

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

* SOLVED:  LaTeX equation align in orgmode?
  2015-09-29  7:38 ` Eric S Fraga
@ 2015-09-29  8:09   ` Rainer M Krug
  2015-09-29 15:54     ` Andreas Leha
  2015-09-29 13:43   ` Rasmus
  1 sibling, 1 reply; 19+ messages in thread
From: Rainer M Krug @ 2015-09-29  8:09 UTC (permalink / raw)
  To: emacs-orgmode

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

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Monday, 28 Sep 2015 at 21:10, Rainer M Krug wrote:
>> Hi
>>
>> I would need in a document several equations which are aligned as in 
>> http://tex.stackexchange.com/a/167908/6941
>
> I use align all the time.
>
>> How can I use the following latex formula in orgmode?
>>
>> \begin{proof} The proof is a follows: 
>> \begin{align}
>> (x+y)^3&=(x+y)(x+y)^2\\
>>        &=(x+y)(x^2+2xy+y^2)\\
>>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
>> \end{align}
>> \end{proof}
>
> Where is proof defined? You may need to add specific packages to
> org-latex-packages-alist.

The proof and the ".\qedhere"

Stupid typos.

>
> In any case, I find that it is safer generally to enclose all LaTeX
> fragments in a LaTeX block: #+begin_latex ... #+end_latex.

Good idea - but then the preview does not work anymore?

Sorry for the noise and thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

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

* Re: LaTeX equation align in orgmode?
  2015-09-29  4:06 ` Andreas Leha
  2015-09-29  7:52   ` BUG?: LaTeX equation align in orgmode? - even in -Q Rainer M Krug
@ 2015-09-29  8:24   ` Ken Mankoff
  1 sibling, 0 replies; 19+ messages in thread
From: Ken Mankoff @ 2015-09-29  8:24 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode@gnu.org

Nested align in equation is incorrect format. 

  -k. 

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

On Sep 29, 2015, at 00:06, Andreas Leha <andreas.leha@med.uni-goettingen.de> wrote:

>> 
>> \begin{equation}
>> \begin{align}

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

* Re: LaTeX equation align in orgmode?
  2015-09-29  7:38 ` Eric S Fraga
  2015-09-29  8:09   ` SOLVED: " Rainer M Krug
@ 2015-09-29 13:43   ` Rasmus
  1 sibling, 0 replies; 19+ messages in thread
From: Rasmus @ 2015-09-29 13:43 UTC (permalink / raw)
  To: emacs-orgmode

Rainer,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Monday, 28 Sep 2015 at 21:10, Rainer M Krug wrote:
>> I would need in a document several equations which are aligned as in 
>> http://tex.stackexchange.com/a/167908/6941
>
> I use align all the time.

align is defined in amsmath.  amsmath is loaded by default by org.  I use
amsmath extensively and there's no problem.  I don't escape my math
environments and IMO you shouldn't as they would then be ignored by ox-odt
and ox-html.

As Eric point out you'd typically use amsthm for proofs.  You need to add
this to your document.  The proof env. is predefined in amsthm, though.

Hope it helps,
Rasmus

-- 
Sådan en god dansk lagereddike kan man slet ikke bruge mere

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

* Re: LaTeX equation align in orgmode?
  2015-09-28 19:10 LaTeX equation align in orgmode? Rainer M Krug
  2015-09-29  4:06 ` Andreas Leha
  2015-09-29  7:38 ` Eric S Fraga
@ 2015-09-29 15:49 ` Nicolas Goaziou
  2 siblings, 0 replies; 19+ messages in thread
From: Nicolas Goaziou @ 2015-09-29 15:49 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

Hello,

Rainer M Krug <Rainer@krugs.de> writes:

> I would need in a document several equations which are aligned as in 
> http://tex.stackexchange.com/a/167908/6941
>
> How can I use the following latex formula in orgmode?
>
> \begin{proof} The proof is a follows: 
> \begin{align}
> (x+y)^3&=(x+y)(x+y)^2\\
>        &=(x+y)(x^2+2xy+y^2)\\
>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
> \end{align}
> \end{proof}
>
> I have effectrively
>
> #+LATEX_HEADER: \usepackage{amsmath}
>
> * The equations
>
> \begin{equation}
> \begin{align}
> (x+y)^3&=(x+y)(x+y)^2\\
>        &=(x+y)(x^2+2xy+y^2)\\
>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
> \end{align}
> \end{equation}
>
> but with latex fragment preview (C-c C-x C-l) I only get an empty frame.
>
> How can use this align environment in org?

Make sure to C-c C-c on the keyword.

Regards,

-- 
Nicolas Goaziou

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-09-29  8:09   ` SOLVED: " Rainer M Krug
@ 2015-09-29 15:54     ` Andreas Leha
  2015-10-08 22:25       ` Enzo Chi
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Leha @ 2015-09-29 15:54 UTC (permalink / raw)
  To: emacs-orgmode

Rainer M Krug <Rainer@krugs.de> writes:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> On Monday, 28 Sep 2015 at 21:10, Rainer M Krug wrote:
>>> Hi
>>>
>>> I would need in a document several equations which are aligned as in 
>>> http://tex.stackexchange.com/a/167908/6941
>>
>> I use align all the time.
>>
>>> How can I use the following latex formula in orgmode?
>>>
>>> \begin{proof} The proof is a follows: 
>>> \begin{align}
>>> (x+y)^3&=(x+y)(x+y)^2\\
>>>        &=(x+y)(x^2+2xy+y^2)\\
>>>        &=x^3+3x^2y+3xy^3+x^3.\qedhere
>>> \end{align}
>>> \end{proof}
>>
>> Where is proof defined? You may need to add specific packages to
>> org-latex-packages-alist.
>
> The proof and the ".\qedhere"
>
> Stupid typos.
>
>>
>> In any case, I find that it is safer generally to enclose all LaTeX
>> fragments in a LaTeX block: #+begin_latex ... #+end_latex.
>
> Good idea - but then the preview does not work anymore?
>

see http://orgmode.org/worg/org-hacks.html#orgheadline91

Best,
Andreas

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-09-29 15:54     ` Andreas Leha
@ 2015-10-08 22:25       ` Enzo Chi
  2015-10-09  9:41         ` Eric S Fraga
  0 siblings, 1 reply; 19+ messages in thread
From: Enzo Chi @ 2015-10-08 22:25 UTC (permalink / raw)
  To: emacs-orgmode

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

I tried that "\begin{align}...\end{align}" code with "C-c C-x C-l", it
	generate a very back quality image like this:


[-- Attachment #2: equation --]
[-- Type: image/png, Size: 1328 bytes --]

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-08 22:25       ` Enzo Chi
@ 2015-10-09  9:41         ` Eric S Fraga
  2015-10-11 21:49           ` Enzo Chi
  0 siblings, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-10-09  9:41 UTC (permalink / raw)
  To: Enzo Chi; +Cc: emacs-orgmode

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

On Friday,  9 Oct 2015 at 09:25, Enzo Chi wrote:
> I tried that "\begin{align}...\end{align}" code with "C-c C-x C-l", it
> 	generate a very back quality image like this:

What settings do you have for image creation in org?  What is
org-latex-create-formula-image-program?  

For instance, I have the following settings:

#+begin_src emacs-lisp :results none
  (setq org-format-latex-options '(:foreground "white" :background "black" :scale 3 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
        org-latex-create-formula-image-program 'imagemagick
        )
#+end_src

and I get something along these lines:


[-- Attachment #2: paper_cd3a2decc74530d2f93549bfafc4c5d967ab21bc.png --]
[-- Type: image/png, Size: 4409 bytes --]

[-- Attachment #3: Type: text/plain, Size: 290 bytes --]


You'll probably not want to change the foreground and background colours
if you have a light background emacs theme.

The quality of the image may also be a function of your LaTeX default
packages and fonts.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-161-gd2ac25

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-09  9:41         ` Eric S Fraga
@ 2015-10-11 21:49           ` Enzo Chi
  2015-10-12  7:23             ` Eric S Fraga
  0 siblings, 1 reply; 19+ messages in thread
From: Enzo Chi @ 2015-10-11 21:49 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Friday,  9 Oct 2015 at 09:25, Enzo Chi wrote:
>> I tried that "\begin{align}...\end{align}" code with "C-c C-x C-l", it
>> 	generate a very back quality image like this:
>
> What settings do you have for image creation in org?  What is
> org-latex-create-formula-image-program?  
>
> For instance, I have the following settings:
>
> #+begin_src emacs-lisp :results none
>   (setq org-format-latex-options '(:foreground "white" :background "black" :scale 3 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
>         org-latex-create-formula-image-program 'imagemagick
>         )
> #+end_src
>
> and I get something along these lines:
>
>
>
>
> You'll probably not want to change the foreground and background colours
> if you have a light background emacs theme.
>
> The quality of the image may also be a function of your LaTeX default
> packages and fonts.

Thanks Eric, that solved the preview issue. But when export it to ODT
file, the image is still as bad as the one I post before. (Export to PDF
is fine). 

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-11 21:49           ` Enzo Chi
@ 2015-10-12  7:23             ` Eric S Fraga
  2015-10-12  7:34               ` Rasmus
  0 siblings, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-10-12  7:23 UTC (permalink / raw)
  To: Enzo Chi; +Cc: emacs-orgmode

On Monday, 12 Oct 2015 at 08:49, Enzo Chi wrote:

[...]

> Thanks Eric, that solved the preview issue. But when export it to ODT
> file, the image is still as bad as the one I post before. (Export to PDF
> is fine). 

One step forward at least...  with respect to ODT export, I'm not best
placed to answer this.  Maybe somebody else can chime in?  My equations
come out fine when I export to ODT but I don't have anything customised
that I can see.  Maybe check the org-odt- variables?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3beta-1229-ge900eb

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-12  7:23             ` Eric S Fraga
@ 2015-10-12  7:34               ` Rasmus
  2015-10-14 11:35                 ` Eric S Fraga
  0 siblings, 1 reply; 19+ messages in thread
From: Rasmus @ 2015-10-12  7:34 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Monday, 12 Oct 2015 at 08:49, Enzo Chi wrote:
>
> [...]
>
>> Thanks Eric, that solved the preview issue. But when export it to ODT
>> file, the image is still as bad as the one I post before. (Export to PDF
>> is fine). 
>
> One step forward at least...  with respect to ODT export, I'm not best
> placed to answer this.  Maybe somebody else can chime in?  My equations
> come out fine when I export to ODT but I don't have anything customised
> that I can see.  Maybe check the org-odt- variables?

I haven't followed the thread, but ox-odt should export to mathml by
default.  I use this to produce mathml:

(setq org-latex-to-mathml-convert-command
        "latexmlmath \"%i\" --presentationmathml=%o")

Rasmus

-- 
Governments should be afraid of their people

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-12  7:34               ` Rasmus
@ 2015-10-14 11:35                 ` Eric S Fraga
  2015-10-14 12:58                   ` Rasmus
  0 siblings, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-10-14 11:35 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

On Monday, 12 Oct 2015 at 09:34, Rasmus wrote:

[...]

> I haven't followed the thread, but ox-odt should export to mathml by
> default.  I use this to produce mathml:
>
> (setq org-latex-to-mathml-convert-command
>         "latexmlmath \"%i\" --presentationmathml=%o")
>
> Rasmus

Hi Rasmus,

thanks for the above.

I don't believe the default is to export to mathml.  At least, for me,
this doesn't happen.  But, to be brutally honest, I'm more than a little
confused about what is possible or not in ODT export.  I don't use it
often, mostly because almost all of my documents have some maths in
LaTeX form, but there are indeed cases where it would be nice to have
the capability of exporting maths to ODT.

Setting the variable mentioned above doesn't work for me either.  I had
to install the latexml package (on Ubuntu) to have the command available
but I don't know where to get the jar file that may be needed
(cf. org-latex-to-mathml-jar-file).  Any help in this regard would be
welcome.  Searching the mailing list doesn't bring up anything useful.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-161-gd2ac25

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-14 11:35                 ` Eric S Fraga
@ 2015-10-14 12:58                   ` Rasmus
  2015-10-14 14:09                     ` Eric S Fraga
  0 siblings, 1 reply; 19+ messages in thread
From: Rasmus @ 2015-10-14 12:58 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I don't believe the default is to export to mathml.  At least, for me,
> this doesn't happen.

For me, when I eval the following from emacs -q I get odt.

(require 'ox-odt)
(setq org-latex-to-mathml-convert-command
      "latexmlmath \"%i\" --presentationmathml=%o")

E.g. export: \(x\).

> But, to be brutally honest, I'm more than a little confused about what
> is possible or not in ODT export.  I don't use it often, mostly because
> almost all of my documents have some maths in LaTeX form, but there are
> indeed cases where it would be nice to have the capability of exporting
> maths to ODT.

It’s getting better.  I exported a large document recently, and Nicolas
fixed a lot of bugs.

> Setting the variable mentioned above doesn't work for me either.  I had
> to install the latexml package (on Ubuntu) to have the command available
> but I don't know where to get the jar file that may be needed
> (cf. org-latex-to-mathml-jar-file).

None.  At least two methods are supported: latexmlmath and some .jar file,
perhaps mathtoweb.jar or something like that?

> Any help in this regard would be welcome.  Searching the mailing list
> doesn't bring up anything useful.

Run from emacs -q and check your *messages*.  You should see something
like this in the buffer:

     Formatting LaTeX using mathml
     Creating MathML snippet 1...
     Wrote /tmp/ltxmathml-in5102GLn
     Running latexmlmath "\(x\)" --presentationmathml=ltxmathml-out5102TVt
     Using vacuous schema
     Wrote /tmp/ltxmathml/test-formula-27f4fea30995c43e0894e19929353bf9fa8957cb.mathml
     Embedding /tmp/ltxmathml/test-formula-27f4fea30995c43e0894e19929353bf9fa8957cbm.

Rasmus

-- 
Spil noget med Slayer!

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-14 12:58                   ` Rasmus
@ 2015-10-14 14:09                     ` Eric S Fraga
  2015-10-14 14:18                       ` Rasmus
  0 siblings, 1 reply; 19+ messages in thread
From: Eric S Fraga @ 2015-10-14 14:09 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

On Wednesday, 14 Oct 2015 at 14:58, Rasmus wrote:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> I don't believe the default is to export to mathml.  At least, for me,
>> this doesn't happen.
>
> For me, when I eval the following from emacs -q I get odt.
>
> (require 'ox-odt)
> (setq org-latex-to-mathml-convert-command
>       "latexmlmath \"%i\" --presentationmathml=%o")
>
> E.g. export: \(x\).

I get:

,----
| LaTeX to MathML converter not available.
| Formatting LaTeX using verbatim
`----

I do not get:

> Run from emacs -q and check your *messages*.  You should see something
> like this in the buffer:
>
>      Formatting LaTeX using mathml
>      Creating MathML snippet 1...
>      Wrote /tmp/ltxmathml-in5102GLn
>      Running latexmlmath "\(x\)" --presentationmathml=ltxmathml-out5102TVt
>      Using vacuous schema
>      Wrote
> /tmp/ltxmathml/test-formula-27f4fea30995c43e0894e19929353bf9fa8957cb.mathml
>      Embedding
> /tmp/ltxmathml/test-formula-27f4fea30995c43e0894e19929353bf9fa8957cbm.

I am using org from git, fairly recent version.

There must be some other configuration setting, maybe something outside
org that enables latexml to work?

thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-161-gd2ac25

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-14 14:09                     ` Eric S Fraga
@ 2015-10-14 14:18                       ` Rasmus
  2015-10-14 15:24                         ` Eric S Fraga
  0 siblings, 1 reply; 19+ messages in thread
From: Rasmus @ 2015-10-14 14:18 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Wednesday, 14 Oct 2015 at 14:58, Rasmus wrote:
>> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>>
>
>>> I don't believe the default is to export to mathml.  At least, for me,
>>> this doesn't happen.
>>
>> For me, when I eval the following from emacs -q I get odt.
>>
>> (require 'ox-odt)
>> (setq org-latex-to-mathml-convert-command
>>       "latexmlmath \"%i\" --presentationmathml=%o")
>>
>> E.g. export: \(x\).
>
> I get:
>
> ,----
> | LaTeX to MathML converter not available.
> | Formatting LaTeX using verbatim
> `----

This is triggered if (org-format-latex-mathml-available-p) returns nil.
Go through each step of this function (in org.el).  My guess is that
latexmlmath is not in your PATH, at least according to Emacs...

-- 
Together we will make the possible totalllly impossible!

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

* Re: SOLVED:  LaTeX equation align in orgmode?
  2015-10-14 14:18                       ` Rasmus
@ 2015-10-14 15:24                         ` Eric S Fraga
  0 siblings, 0 replies; 19+ messages in thread
From: Eric S Fraga @ 2015-10-14 15:24 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

On Wednesday, 14 Oct 2015 at 16:18, Rasmus wrote:
> This is triggered if (org-format-latex-mathml-available-p) returns nil.
> Go through each step of this function (in org.el).  My guess is that
> latexmlmath is not in your PATH, at least according to Emacs...

Got it!  org-latex-to-mathml-convert-command is one of those variables
that has to be either set globally (which I don't want) or I have to use
#+bind:.  Setting it locally is no good!

Works very well now!

Thanks for all the help,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-161-gd2ac25

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

end of thread, other threads:[~2015-10-14 15:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 19:10 LaTeX equation align in orgmode? Rainer M Krug
2015-09-29  4:06 ` Andreas Leha
2015-09-29  7:52   ` BUG?: LaTeX equation align in orgmode? - even in -Q Rainer M Krug
2015-09-29  8:24   ` LaTeX equation align in orgmode? Ken Mankoff
2015-09-29  7:38 ` Eric S Fraga
2015-09-29  8:09   ` SOLVED: " Rainer M Krug
2015-09-29 15:54     ` Andreas Leha
2015-10-08 22:25       ` Enzo Chi
2015-10-09  9:41         ` Eric S Fraga
2015-10-11 21:49           ` Enzo Chi
2015-10-12  7:23             ` Eric S Fraga
2015-10-12  7:34               ` Rasmus
2015-10-14 11:35                 ` Eric S Fraga
2015-10-14 12:58                   ` Rasmus
2015-10-14 14:09                     ` Eric S Fraga
2015-10-14 14:18                       ` Rasmus
2015-10-14 15:24                         ` Eric S Fraga
2015-09-29 13:43   ` Rasmus
2015-09-29 15:49 ` 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).