emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] LaTeX math mode and export


From: Fabrice Popineau
Subject: Re: [O] LaTeX math mode and export
Date: Sat, 12 Oct 2013 00:03:16 +0200


> \[\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: address@hidden}

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]