# Getting maxima source block to return and display latex equations

I'd like my maxima source blocks to return either valid latex that I can display in the org-buffer, or an image of the results (a la imaxima). Ideally, the pure latex solution would be best.

Here is an example which I'd like to work.

#+BEGIN_SRC maxima :results output raw
C: matrix([1, -1], [1, 1]);
V: matrix([\sigma[11], \sigma[12]], [\sigma[12], \sigma[22]]);
tex(C . V . transpose(C));
#+END_SRC

#+RESULTS:
$$\pmatrix{\sigma_{22}-2\,\sigma_{12}+\sigma_{11}&\sigma_{11}-\sigma _{22}\cr \sigma_{11}-\sigma_{22}&\sigma_{22}+2\,\sigma_{12}+\sigma_{ 11}\cr }$$


The result doesn't render in my buffer.

• A related issue I found was that after trying to render it a bunch of times, I can no longer toggle the display of latex fragments until after restarting emacs. I get the error: Wrong type argument: number-or-marker-p, nil coming from org-remove-if. Sep 18 '15 at 2:25
• I have some examples here: raw.githubusercontent.com/wvxvw/uni-infinitesimal-calculus/HEAD/… and I too remember having troubles doing this. In the worst case you can feed the output of tex() to another Org block to format it the way you like. Sep 18 '15 at 6:20

Based on the babel's recommendation do you have this exports header someplace in the document?

#+header: :exports none


However for graphical rendering to file/displaying that file in-place, the manual recommends

#+header: :exports results

The other thing to check is the scale variable > 1 under org-format-latex-options. Yet I still get number-or-marker-p error every now and then.
• My scale is 1.7 in org-format-latex-options because I have trouble reading the 1.0 setting. Changing that back to 1 let me render latex images again. More interestingly, once they rendered correctly, I set it back to 1.7 and it still worked. Sep 19 '15 at 12:47
• Nevermind, the number-or-marker-p error came back. Sep 19 '15 at 13:13