Re: [O] change tables to matrix when importing, including expressions.

2019-06-13 Thread Nick Dokos
Uwe Brauer  writes:

> However I would like 
>
> #+begin_src 
> #+attr_latex: :mode math :environment matrix
> D=
> | 0 | -5 |
> | 5 |  0 |
> #+end_src
>
>
> To be exported as 
>
> #+begin_src 
> \[
> D=
> \begin{matrix}
>  0 & -5 \\
>  5 & 0 \\
> \end{matrix}
> \]
> #+end_src
>

#+attr_latex: :mode math :environment matrix :math-prefix D=

perhaps?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] change tables to matrix when importing, including expressions.

2019-06-13 Thread Berry, Charles
[snip]

> On Jun 13, 2019, at 6:26 AM, Uwe Brauer  wrote:
> 
> 
> However I would like 
> #+begin_src 
> #+attr_latex: :mode math :environment matrix
> D=
> | 0 | -5 |
> | 5 |  0 |
> #+end_src
> 
> To be exported as 
> 
> #+begin_src 
> \[
> D=
> \begin{matrix}
> 0 & -5 \\
> 5 & 0 \\
> \end{matrix}
> \]
> #+end_src
> 
> How can I do that? 


This is morally equivalent:


#+attr_latex: :mode math :math-prefix D= :environment matrix
| 0 | -5 |
| 5 |  0 |


There will be no newline between the '=' and the '\begin'. If that is something 
you truly need you will have to add a filter. See (info "(org) Advanced Export 
Configuration").

HTH,

Chuck



Re: [O] change tables to matrix when importing, including expressions.

2019-06-13 Thread Uwe Brauer

> [snip]


> This is morally equivalent:


> #+attr_latex: :mode math :math-prefix D= :environment matrix
> | 0 | -5 |
> | 5 |  0 |


> There will be no newline between the '=' and the '\begin'. If that is
> something you truly need you will have to add a filter. See (info
> "(org) Advanced Export Configuration").

It is very useful, thanks a lot.

The missing newline is a bit annoying but no catastrophe.


smime.p7s
Description: S/MIME cryptographic signature


[O] change tables to matrix when importing, including expressions.

2019-06-13 Thread Uwe Brauer


Hi

I know that 
#+begin_src 
#+attr_latex: :mode math :environment matrix
| 0 | -5 |
| 5 |  0 |
#+end_src

Results in 


#+begin_src 
\[
\begin{matrix}
 0 & -5 \\
 5 & 0 \\
\end{matrix}
\]
#+end_src


However I would like 
#+begin_src 
#+attr_latex: :mode math :environment matrix
D=
| 0 | -5 |
| 5 |  0 |
#+end_src

To be exported as 

#+begin_src 
\[
D=
\begin{matrix}
 0 & -5 \\
 5 & 0 \\
\end{matrix}
\]
#+end_src

How can I do that? 

Thanks and regards

Uwe Brauer