emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Fabrice Popineau <fabrice.popineau@supelec.fr>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: LaTeX math mode and export
Date: Fri, 11 Oct 2013 11:13:17 +0200	[thread overview]
Message-ID: <CAFgFV9P3uipQ-+2q3XF3iGDPDhMnu6mj7a0+c915OMSkuRghwQ@mail.gmail.com> (raw)

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

Hi,

The status of when warious LaTeX related markers are escaped or not has
moved over time, but the situation reached is still not very clear.

If I do the following test with yesterday's git org-mode :

#+LaTeX_CLASS: article
#+OPTIONS: H:2 <:nil toc:nil
* Test
[2013-10-11 ven. 10:45]
** Subsection
[2013-10-11 ven. 10:46]

 Let blah blah blah ...
  \[ \tilde{\delta}(q, w) = \left\{\begin{array}{ll}
      q & \text{ si }  w = \epsilon \\ \delta(\tilde{\delta}(q,w'),a) &
\text{ si } w = w'a \text{ et } a \in \Sigma
    \end{array}\right. \]
** Subsection
[2013-10-11 ven. 10:48]

 Let blah blah blah ...
\[\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}
\]

The first \[ is left as-is but the second one is translated
into $\backslash$[ which is obviously weird.

Moreover Mathjax being able to interpret this, it should be better if these
equations where all left as-is in the text for both html and latex
exporters. Unless there is something I can't see that prevents to do it?

I have two other examples of the same kind of problem:

1- Same thing with \( ... \) instead of \[ ...\] :

** Subsection
[2013-10-11 ven. 11:05]

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

I ended up in surrounding the second item text into #+begin_latex ...
#+end_latex.

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}

I get with the latex export :

\author{\IEEEauthorblockN{Foo, Bar} \IEEEauthorblockA\{ Somewhere\\ Over
the Rainbow \\ Email: \{foo,bar\}@baz.fr \} \and \IEEEauthorblockN{foobar}
\IEEEauthorblockA{somewhere else \\ Email: foobar@baz.fr}}

It seems impossible to avoid that the curly braces of \IEEEauthorblockA be
left as-is.

I guess all of this is about tweaking regular expressions, but I'm afraid I
won't be aware of other side effects.
I would be glad to whoever can offer a better handling of these situations.

Another related question also : did anybody managed to hilghlight LaTeX
equations inside org-mode ?
It could be very helpful to detect missing end markers.

Thanks for your work on Org mode and for you help :-)

-- 
Fabrice Popineau
-----------------------------
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
------------------------------

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

             reply	other threads:[~2013-10-11  9:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11  9:13 Fabrice Popineau [this message]
2013-10-11 15:43 ` LaTeX math mode and export Nicolas Goaziou
2013-10-11 22:03   ` Fabrice Popineau
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=CAFgFV9P3uipQ-+2q3XF3iGDPDhMnu6mj7a0+c915OMSkuRghwQ@mail.gmail.com \
    --to=fabrice.popineau@supelec.fr \
    --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).