emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] equations in latex equation environment with leading +/- misinterpreted
@ 2011-09-08  7:54 Eric S Fraga
  2011-09-13 16:32 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-09-08  7:54 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

the attached org file illustrates a problem with the latex exporter in
which any line within a \begin{equation}...\end{equation} that begins
with a + or - is interpreted as a list item.

It's easy enough to avoid this problem by either reformatting the lines
in question or by enclosing the equation block in a LATEX org block.
Therefore, there's no urgency in addressing this bug.

Thanks,
eric

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Example of latex export bug --]
[-- Type: text/org, Size: 841 bytes --]

# -*- coding: utf-8; -*-
#+TITLE:     examplebug.org
#+AUTHOR:    Eric S Fraga
#+EMAIL:     e.fraga@ucl.ac.uk
#+OPTIONS:   H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:nil

* equation with leading minus sign
  The following equation
  \begin{equation}
  \label{eq:test}
  y = 3 x
  - 5
  + 4
  \end{equation} illustrates a problem in \LaTex export where the
  leading arithmetic operators are interpreted as list entries.

  A snippet of the \LaTeX code generated on export is here:
  #+begin_example
    The following equation
  \begin{equation}
  \label{eq:test}
  y = 3 x
\begin{itemize}
\item 5
\item 4
\end{itemize}
  \end{equation} illustrates a problem in \LaTex export where the
  leading arithmetic operators are interpreted as list entries.
  #+end_example

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


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.261.g2178)

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

* Re: [bug] equations in latex equation environment with leading +/- misinterpreted
  2011-09-08  7:54 [bug] equations in latex equation environment with leading +/- misinterpreted Eric S Fraga
@ 2011-09-13 16:32 ` Nicolas Goaziou
  2011-09-13 19:02   ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2011-09-13 16:32 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

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

> the attached org file illustrates a problem with the latex exporter in
> which any line within a \begin{equation}...\end{equation} that begins
> with a + or - is interpreted as a list item.
>
> It's easy enough to avoid this problem by either reformatting the lines
> in question or by enclosing the equation block in a LATEX org block.
> Therefore, there's no urgency in addressing this bug.

[...]

--8<---------------cut here---------------start------------->8---
> * equation with leading minus sign
>   The following equation
>   \begin{equation}
>   \label{eq:test}
>   y = 3 x
>   - 5
>   + 4
>   \end{equation} illustrates a problem in \LaTex export where the
>   leading arithmetic operators are interpreted as list entries.
--8<---------------cut here---------------end--------------->8---

I understand your concern, but, as far as I can tell, that's not a bug.

Lists have precedence over LaTeX snippets. In other words, you're asking
to start a list here, and Org starts one.

Also, that this kind of line won't appear automatically[1] (during
filling), so Org assumes it's here on purpose.


Regards,

[1] Now, if it does, that's indeed a bug.

-- 
Nicolas Goaziou

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

* Re: [bug] equations in latex equation environment with leading +/- misinterpreted
  2011-09-13 16:32 ` Nicolas Goaziou
@ 2011-09-13 19:02   ` Eric S Fraga
  2011-09-13 21:43     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-09-13 19:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> the attached org file illustrates a problem with the latex exporter in
>> which any line within a \begin{equation}...\end{equation} that begins
>> with a + or - is interpreted as a list item.
>>
>> It's easy enough to avoid this problem by either reformatting the lines
>> in question or by enclosing the equation block in a LATEX org block.
>> Therefore, there's no urgency in addressing this bug.
>
> [...]
>
>> * equation with leading minus sign
>>   The following equation
>
>>   \begin{equation}
>>   \label{eq:test}
>>   y = 3 x
>>   - 5
>>   + 4
>>   \end{equation} illustrates a problem in \LaTex export where the
>>   leading arithmetic operators are interpreted as list entries.
>
> I understand your concern, but, as far as I can tell, that's not a bug.
>
> Lists have precedence over LaTeX snippets. In other words, you're asking
> to start a list here, and Org starts one.

Okay, I understand.  "Unintended behaviour" instead of "bug" ;-) but
behaviour that I can accept, especially as the easy solution is to
simply enclose the equation in a latex block:

--8<---------------cut here---------------start------------->8---
* equation with leading minus sign
  The following equation
#+begin_latex
  \begin{equation}
  \label{eq:test}
  y = 3 x
  - 5
  + 4
  \end{equation}
#+end_latex
--8<---------------cut here---------------end--------------->8---

This works just fine and is probably for the best in any case.  Using a
latex block allows for latex specific editing (C-c ').  Should have done
this in the first place!

Sorry for the noise!

Thanks,
eric
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.282.g0037)

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

* Re: [bug] equations in latex equation environment with leading +/- misinterpreted
  2011-09-13 19:02   ` Eric S Fraga
@ 2011-09-13 21:43     ` Nicolas Goaziou
  2011-09-14  8:45       ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2011-09-13 21:43 UTC (permalink / raw)
  To: emacs-orgmode

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

> but behaviour that I can accept, especially as the easy solution is to
> simply enclose the equation in a latex block:
>
> * equation with leading minus sign
>   The following equation
> #+begin_latex
>   \begin{equation}
>   \label{eq:test}
>   y = 3 x
>   - 5
>   + 4
>   \end{equation}
> #+end_latex
>
> This works just fine and is probably for the best in any case.  Using a
> latex block allows for latex specific editing (C-c ').  Should have done
> this in the first place!

Technically, this isn't the same. The LaTeX block would be removed
during an HTML export while the plain LaTeX code would be changed into
an image (or "Mathjaxified", whatever that means).

That's annoying because I tend to think that writing plain LaTeX
environments (without any block marker) should be deprecated.

Indeed, while there's a need for short mathematical LaTeX snippets,
LaTeX environments can imply constructs that :

 - are not always related to mathematics (and should therefore be
   handled by Org blocks)
 - are too large to be called "snippets" (and should therefore be
   handled by Org blocks)

Also, I don't know what to think about an object that you can inline on
the right side but not on the left one (and I admit that's what annoys
me the most, at the moment).

Regards,

-- 
Nicolas Goaziou

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

* Re: [bug] equations in latex equation environment with leading +/- misinterpreted
  2011-09-13 21:43     ` Nicolas Goaziou
@ 2011-09-14  8:45       ` Eric S Fraga
  0 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2011-09-14  8:45 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> but behaviour that I can accept, especially as the easy solution is to
>> simply enclose the equation in a latex block:
>>
>> * equation with leading minus sign
>>   The following equation
>> #+begin_latex
>>   \begin{equation}
>>   \label{eq:test}
>>   y = 3 x
>>   - 5
>>   + 4
>>   \end{equation}
>> #+end_latex
>>
>> This works just fine and is probably for the best in any case.  Using a
>> latex block allows for latex specific editing (C-c ').  Should have done
>> this in the first place!
>
> Technically, this isn't the same. The LaTeX block would be removed
> during an HTML export while the plain LaTeX code would be changed into
> an image (or "Mathjaxified", whatever that means).

Agreed.  For my use case, this is not a major issue, mind you, as my
preferred export route is to PDF via LaTeX...

> That's annoying because I tend to think that writing plain LaTeX
> environments (without any block marker) should be deprecated.

Again, agreed, but this will require a more general approach to the
handling of e.g. latex blocks for export to other languages.  Not easy,
I would guess, unless we make more use of conversion to png for blocks.

Thanks again,
eric
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.284.g11de)

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

end of thread, other threads:[~2011-09-14  8:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08  7:54 [bug] equations in latex equation environment with leading +/- misinterpreted Eric S Fraga
2011-09-13 16:32 ` Nicolas Goaziou
2011-09-13 19:02   ` Eric S Fraga
2011-09-13 21:43     ` Nicolas Goaziou
2011-09-14  8:45       ` Eric S Fraga

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