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

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

>  > \[\begin{array}{c}
> >   \begin{array}{|c|c|c|}
> >     \hline
> >     \delta_{1} & 0 &  1 \\
> >     \hline
> >     p & \{p, q\} & \{q\} \\
> >     \hline
> >     q & \{r\} & \{q, r\} \\
> >     \hline
> >     r & \{s\} & \{p\} \\
> >     \hline
> >     s & \{s\} & \{p\} \\
> >     \hline
> >   \end{array}
> > \]
>
> This isn't correct syntax: "\begin{array}{|c|c|c|}...\end{array}" is
> parsed as a latex environment, so it breaks the paragraph you started
> the line before. You can use "\begin{equation}" instead of "\[".
>
>
I'm not sure why it is not correct : I guess you mean not correct Org
syntax?
(I broke my example by shortening it, one \end{array} is missing and there
used
to be other arrays below)
The problem as I feel it is that \[ \]  works sometimes, but not as  often
as with LaTeX,
which is disconcerting.

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 ?

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

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

#+begin_equation
 \begin{array}{c}
   \begin{array}{|c|c|c|}
   \hline
   \delta_{1} & 0 &  1 \\
   \hline
   p & \{p, q\} & \{q\} \\
   \hline
   q & \{r\} & \{q, r\} \\
   \hline
   r & \{s\} & \{p\} \\
   \hline
   s & \{s\} & \{p\} \\
   \hline
   \end{array}
  \vspace{1em} \\
  (\{p,q,r,s\}, \{0,1\},  \delta_{2}, p, \{q,s\})
  \end{array}
  #+end_equation

The last line but two is translated :

  (\{p,q,r,s\}, \{0,1\},  $\delta$$_{\text{2}}$, p, \{q,s\})

This time, given that we are in an equation environment, things should be
left as-is surely?

 > - \(\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?

>

> 2 - Quoting of {} may also happen in unwanted places. If I write a complex
> > author line like :
> >
> > #+AUTHOR: \IEEEauthorblockN{Foo, Bar} \IEEEauthorblockA{ Somewhere\\ Over
> > the Rainbow \\ Email: \{foo,bar\}@baz.fr } \and
> \IEEEauthorblockN{foobar}
> > \IEEEauthorblockA{somewhere else \\ Email: foobar@baz.fr}
>
> You cannot write raw non-math LaTeX in an Org buffer (unless it is also
> an entity). You ought to use export snippets, i.e., @@latex:...@@.


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.
Actually, it is only the second curly brace that gets backslashed, not even
the first
one.



> Another related question also : did anybody managed to hilghlight LaTeX
> > equations inside org-mode ?
>
> See `org-highlight-latex-and-related'.
>
>
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.

Thanks a lot for your help and your work,

-- 
Fabrice

[-- Attachment #2: Type: text/html, Size: 6368 bytes --]

  reply	other threads:[~2013-10-11 22:03 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 [this message]
2013-10-12  7:58     ` Nicolas Goaziou
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=CAFgFV9P9ctUx8qSiMmazQcOr+15Wpz2eQ8gb88Hb6APAdvW_Bw@mail.gmail.com \
    --to=fabrice.popineau@supelec.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).