emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX math mode and export
@ 2013-10-11  9:13 Fabrice Popineau
  2013-10-11 15:43 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Popineau @ 2013-10-11  9:13 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- 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 --]

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

end of thread, other threads:[~2013-10-12 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-10-12  8:31       ` Nicolas Goaziou
2013-10-12 10:56       ` Suvayu Ali

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