emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: BUG?:  LaTeX equation align in orgmode? - even in -Q
Date: Tue, 29 Sep 2015 09:52:24 +0200	[thread overview]
Message-ID: <m2d1x14q87.fsf_-_@krugs.de> (raw)
In-Reply-To: <olueghhq372.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Tue, 29 Sep 2015 05:06:41 +0100")


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

  reply	other threads:[~2015-09-29  7:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Rainer M Krug [this message]
2015-09-29  8:24   ` 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

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=m2d1x14q87.fsf_-_@krugs.de \
    --to=rainer@krugs.de \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /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).