From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: LaTeX math mode and export Date: Fri, 11 Oct 2013 11:13:17 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01681e2894511a04e873886f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUYmy-00054p-S8 for emacs-orgmode@gnu.org; Fri, 11 Oct 2013 05:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUYmw-0001BT-U6 for emacs-orgmode@gnu.org; Fri, 11 Oct 2013 05:13:40 -0400 Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:61799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUYmw-0001BJ-Il for emacs-orgmode@gnu.org; Fri, 11 Oct 2013 05:13:38 -0400 Received: by mail-ee0-f42.google.com with SMTP id b45so1755600eek.1 for ; Fri, 11 Oct 2013 02:13:37 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --089e01681e2894511a04e873886f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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) =3D \left\{\begin{array}{ll} q & \text{ si } w =3D \epsilon \\ \delta(\tilde{\delta}(q,w'),a) & \text{ si } w =3D 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) =3D \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 :-) --=20 Fabrice Popineau ----------------------------- SUPELEC D=E9partement Informatique 3, rue Joliot Curie 91192 Gif/Yvette Cedex Tel direct : +33 (0) 169851950 Standard : +33 (0) 169851212 ------------------------------ --089e01681e2894511a04e873886f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

The status of when warious LaTeX re= lated markers are escaped or not has moved over time, but the situation rea= ched is still not very clear.=A0

If I do the follo= wing test with yesterday's git org-mode :

#+LaTeX_CLASS: article
#+OPTIONS: H:2 &l= t;:nil toc:nil
* Test
[2013-10-11 ven. 10:45]
** Subsection
[2013-10-11 ven. 10:46]

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

=A0Let blah blah blah ...
<= div>\[\begin{array}{c}
=A0 \begin{array}{|c|c|c|}
=A0 = =A0 \hline
=A0 =A0 \delta_{1} & 0 & =A01 \\
=A0 =A0 \hline
=A0 =A0 p & \{p, q\} & \{q\} \\
=A0 =A0 \hline
=A0 =A0 q & \{r\} & \{q, r\} \\
=A0 =A0 \hline
=A0 =A0 r & \{s\} & \{p\} \\
=A0 =A0 \hline
=A0 =A0 s & \{s\} & \{p\} \\
=A0 =A0 \hline
=A0 \end{array}
\]
The first \[ is left as-is but the second one is translated int= o=A0$\backslash$[ which is obviously weird.

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

I have two other examples of the same kind of problem:<= /div>

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

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

- \(\min(x,y)\) , \(\max(x,y)\)
- \(\operator= name{Prime}(x) =3D \left\{ \begin{array}{cl} 1 & \text{ if }
<= div>=A0 x \text{ is prime } \\ 0 & \text{ if } x \text{ is not prime }<= /div>
\end{array} \right. \)

I ended up in su= rrounding 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} \IEEEau= thorblockA{ 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} \IEEEau= thorblockA{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&#= 39;m afraid I won't be aware of other side effects.
I would be glad to whoever can offer a better handling of these situat= ions.

Another related question also : did any= body 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 :-)

<= /div>--
Fabrice Popineau
-----------------------------
SUPELEC
D=E9partement Inf= ormatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
------------------------------

--089e01681e2894511a04e873886f--