Nicolas Goaziou <[email protected]> writes:
>> I'm doing some stuff where the natural output of my tables are
>> matrices. I found a decent translation function here ¹. However,
>> I'm not very successful in making org use it.
>
> Using the new exporter, something like should replace any table using
> default environment (i.e. no special attribute) and without horizontal
> rules with bmatrix environment. It should also insert it in math mode
> automatically.
I didn't manage to get your (Nicolas') or my own attempt working
correctly for exporting matrices. I still think it would be nice.
I tried to use the regexp
(not (string-match "|[\\+-]+|" table))
to identify tables without heading separators, but it didn't work
properly.
Thinking about it, it might be nice to be able to specify table export
function more generally. For instance, I might have a matrix with
labels (in LaTeX a bordermatrix or kbordermatrix). Likewise, it might
also be nice to specify a header argument to tables s.t. I can specify
a name, e.g.
#+NAME: P
#+TBLOPTIONS: :prefix "P=" :type matrix
| a| b|
| c| d|
would export to
\[P=\begin{bmatrix}a&b\\c&d\end{bmatrix}\]
–Rasmus
--
May the Force be with you