emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Federico Beffa <beffa@ieee.org>
To: emacs-orgmode@gnu.org
Subject: Bug: wrong interpretation of LaTeX [8.2.6 (8.2.6-47-ge3d2c1-elpa @ c:/Users/beffa/.emacs.d/elpa/org-20140526/)]
Date: Fri, 25 Jul 2014 15:04:08 +0200	[thread overview]
Message-ID: <CAKrPhPO_yCOSE3uQcGAMscHXqa1qtBro=R-mcfSTtGvwTxaf3A@mail.gmail.com> (raw)

Hi,

I'm a long time LaTeX user starting to use the excellent org-mode.
I've noticed what I believe is a wrong interpretation of the LaTeX
syntax by org-mode:

According to the LaTeX manual and reference "LaTeX: A Document
Preparation System", L. Lamport, \[ ... \] is a short form for a
displaymath environment. Citing the reference:
"... Because displayed equations are used so frequently in
mathematics, LaTeX allows you to type \[ ... \] instead of
\begin{displaymath} ... \end{displaymath}. ..."

However, org-mode classify \[ ... \] as a latex-fragment, the same as
\(...\). The two are however very different in LaTeX because, while
the latter displays some mathematical expression *inline*, the former
makes its content stand out by putting it on *its own line*.

What I do not like about this is that "org-fill-paragraph" considers
the \[ ...\] environment part of a paragraph and therefore the
environment gets "lost" in the middle of a line.

Here a simple org file:
------------------------------------------------------------------
* Intro

First paragraph with equation environment:
\begin{equation}
E = mc^2  .
\end{equation}

Second paragraph with short form of displaymath environment:
\[
E = \hbar\omega  .
\]

(setq fbe-tmp (org-element-parse-buffer))
------------------------------------------------------------------

and here how it is parsed
------------------------------------------------------------------
(org-data nil
      (headline
       (:raw-value "Intro" :begin 1 :end 226 :pre-blank 1 :hiddenp nil
:contents-begin 10 :contents-end 226 :level 1 :priority nil :tags nil
:todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil
:archivedp nil :commentedp nil :quotedp nil :CATEGORY nil :title
               (#("Intro" 0 5
              (:parent #1)))
               :parent #0)
       (section
        (:begin 10 :end 226 :contents-begin 10 :contents-end 226
:post-blank 0 :parent #1)
        (paragraph
         (:begin 10 :end 53 :contents-begin 10 :contents-end 53
:post-blank 0 :post-affiliated 10 :parent #2)
         #("First paragraph with equation environment:\n" 0 43
           (:parent #3)))
        (latex-environment
         (:begin 53 :end 98 :value "\\begin{equation}\nE = mc^2
.\n\\end{equation}\n" :post-blank 1 :post-affiliated 53 :parent #2))
        (paragraph
         (:begin 98 :end 185 :contents-begin 98 :contents-end 184
:post-blank 1 :post-affiliated 98 :parent #2)
         #("Second paragraph with short form of displaymath environment:\n" 0 61
           (:parent #3))
         (latex-fragment
          (:value "\\[\nE = \\hbar\\omega  .\n\\]" :begin 159 :end 183
:post-blank 0 :parent #3))
         #("\n" 0 1
           (:parent #3)))
        (paragraph
         (:begin 185 :end 226 :contents-begin 185 :contents-end 226
:post-blank 0 :post-affiliated 185 :parent #2)
         #("(setq fbe-tmp (org-element-parse-buffer))" 0 41
           (:parent #3))))))

------------------------------------------------------------------

Regards,
Fede


Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.6 (8.2.6-47-ge3d2c1-elpa @
c:/Users/beffa/.emacs.d/elpa/org-20140526/)

             reply	other threads:[~2014-07-25 13:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 13:04 Federico Beffa [this message]
2014-07-25 18:32 ` Bug: wrong interpretation of LaTeX [8.2.6 (8.2.6-47-ge3d2c1-elpa @ c:/Users/beffa/.emacs.d/elpa/org-20140526/)] Nicolas Goaziou
2014-07-25 20:39   ` Federico Beffa
2014-07-26  8:26     ` Nicolas Goaziou
2014-07-26  9:20       ` Federico Beffa
2014-07-27  9:27         ` Federico Beffa
2014-07-27 16:46           ` Nicolas Goaziou
2014-07-28 11:16             ` Federico Beffa
2014-07-28 12:03               ` Nicolas Goaziou
2014-07-27 11:36       ` Bastien

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='CAKrPhPO_yCOSE3uQcGAMscHXqa1qtBro=R-mcfSTtGvwTxaf3A@mail.gmail.com' \
    --to=beffa@ieee.org \
    --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).