# typesetting matrix output from maxima using org-mode

How can I make org-mode typeset matrices output from maxima?

For example, the following code produces tex output that display

#+BEGIN_SRC maxima :results raw
m: matrix([1, 2], [3, 4]);
tex(m);
#+END_SRC


It produces the result:

#+RESULTS:
$$\pmatrix{1&2\cr 3&4\cr }$$


This does not display anything. Is there an easy way to make this code valid so that it will display?

Apparently I had mostly the same question 2 years ago (but with a more complicated example). Unfortunately, I didn't get a reproducible answer at the time:

Getting maxima source block to return and display latex equations

I found the following comment about loading the maxima package mactex-utilities on http://maxima-discuss.narkive.com/fenby68e/export-tex-format

Post by Paul RIVIER

I take this opportunity to ask you if there is a work in progress to include a latex export as well. I don't know of anybody that is working on this. To generate LaTeX output for fractions and matrices, load 'mactex-utilities':

(%i1) load("mactex-utilities")\$
(%i2) tex(a/b);
$$\frac{a}{b}$$
(%o2) false

(%i3) tex(matrix([1,2],[3,4]));
$$\begin{pmatrix}1 & 2 \\ 3 & 4 \\ \end{pmatrix}$$
(%o3) false


Barton

Therewith it should be no problem to render the equations with cdlatex from orgmode.