1

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.

2
  • 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.
    – wdkrnls
    Sep 18, 2015 at 2:25
  • 1
    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.
    – wvxvw
    Sep 18, 2015 at 6:20

1 Answer 1

2

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
#+header: :results graphics

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.

3
  • 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.
    – wdkrnls
    Sep 19, 2015 at 12:47
  • I tried using :exports none, but that had no effect. I was, however, able to correctly display basic equations as latex; just not matrices.
    – wdkrnls
    Sep 19, 2015 at 13:01
  • Nevermind, the number-or-marker-p error came back.
    – wdkrnls
    Sep 19, 2015 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.