emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Fabrice Popineau <fabrice.popineau@supelec.fr>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: LaTeX math mode and export
Date: Sat, 12 Oct 2013 09:58:27 +0200	[thread overview]
Message-ID: <874n8m9azg.fsf@gmail.com> (raw)
In-Reply-To: <CAFgFV9P9ctUx8qSiMmazQcOr+15Wpz2eQ8gb88Hb6APAdvW_Bw@mail.gmail.com> (Fabrice Popineau's message of "Sat, 12 Oct 2013 00:03:16 +0200")

Hello,

Fabrice Popineau <fabrice.popineau@supelec.fr> writes:

> I'm not sure why it is not correct : I guess you mean not correct Org
> syntax?

Correct.

> The problem as I feel it is that \[ \] works sometimes, but not as
> often as with LaTeX, which is disconcerting.

\[...\] is more limited in Org than in LaTeX, indeed.

> I know that theparagraph entity in Org mode is different than what it is is
> in LaTeX, but still.
>
> Why \[ ... \] couldn't be handled as if it where \begin{equation} ...
> \end{equation} ?
> Is there any other use of \[ that would prevent its detection ?

There are two types of structures in Org syntax: inline (i.e. contained
in a paragraph) and not inline. inlined structures always belong to
a non-inlined one. Therefore, the parser always gives precedence to
non-inlined syntax over inlined one.

Thus, the following example will be a single paragraph with some maths
inside:

  A paragraph with \[1+1=2\] maths.

But the following one:

  A paragraph
  \[1
    + 1
    = 2
  \]
  with maths.

will be a paragraph, a list and another paragraph: "A paragraph\n\[1",
" + 1" and " = 2\n\]\nwith maths."

If \[...\] constructs were to be changed into non-inlined, the maths
snippet in the first example would not be recognized.

It is theoretically possible to make "\[...\]" both inline and
non-inline. Though, I have the feeling that it would come with its own
set of problems.

> Sorry to be such an hassle, but that would help to smooth the conversion of
> previous LaTeX files/users
> to Org.

I think that a major pitfall for these users is to think that you can
wrap LaTeX syntax in Org structures. Actually, Org only supports
a limited set of LaTeX syntax.

> IF I fix it and I use #+begin_equation ... #+end_equation , I still hit
> something with these math delimiters:

No, you should use \begin{equation}...\end{equation} in order to make it
a full LaTeX environment. #+begin_equation is not an equation
environment, it's a special block, which can contain Org syntax (and you
don't want Org syntax here).

>  > - \(\min(x,y)\) , \(\max(x,y)\)
>> > - \(\operatorname{Prime}(x) = \left\{ \begin{array}{cl} 1 & \text{ if }
>> >   x \text{ is prime } \\ 0 & \text{ if } x \text{ is not prime }
>> > \end{array} \right. \)
>>
>> The last line is not correctly indented: it doesn't belong to the last
>> item and therefore, the math snippets is not recognized.
>
> True, didn't notice that it could make a difference, because Org-mode
> refuses to indent it.
> I mean I used <Tab> on all lines and thought that it wasn't indented
> because it could have
> been the previous line that was wrapped. Org-mode is able to indent the
> second line but
> what is preventing it to indent the third line?

The last line doesn't belong to the list above. "Indenting" it at the
"x" level would actually change the structure of the list, which is more
than what a simple indentation command is allowed to do (I know about
python mode and I don't think it is a good behaviour for Org).

> Ok. I understand that curly braces in plain text need to be backslahed in
> LaTeX.
> But again what is surprising is that the backslash itself
> in \IEEEAuthorBlockA and \IEEEAuthorBlockN are not translated to LaTeX
> syntax.

Honestly, it surprised me too, as I thought that every curly bracket
would be escaped. But I don't have time to look into it at the moment.

> I hope my comments do not seem too rude. I try to report the feeling of
> someone
> who doesn't know the internals. I think that the less suprised the user is,
> the more it is
> willing to accept the tool. In the area of maths delimiters, I start to
> wonder if Org-mode doesn't push too far
> its guessing of what the user had intended. But maybe I don't see the whole
> picture.

I think the behaviour is not surprising once you know that Org you can't
mix raw LaTeX and regular Org syntax without some precautions. In
particular, Org can only parse very simple LaTeX syntax, but provides
ways to deal with more more complex one.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-10-12  7:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11  9:13 LaTeX math mode and export Fabrice Popineau
2013-10-11 15:43 ` Nicolas Goaziou
2013-10-11 22:03   ` Fabrice Popineau
2013-10-12  7:58     ` Nicolas Goaziou [this message]
2013-10-12  8:31       ` Nicolas Goaziou
2013-10-12 10:56       ` Suvayu Ali

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=874n8m9azg.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fabrice.popineau@supelec.fr \
    /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).