Org Mode support for Maxima
Maxima is written in Common Lisp. It can be accessed and extended in Lisp.
Maxima binaries are available for Windows and Linux. These either require a compatible Common Lisp or an executable Lisp image. Mac OS X users can install via brew or MacPorts. The combinations of operating system and Lisp implementation known to run Maxima can be found on the Maxima ports page.
There are several versions of Maxima, some with different names. The
org-babel-maxima-command can be set to the name of your
Maxima executable. The default value is "maxima".
Maxima ships with
Emacs modes. Instructions for configuring them
can be found on emacswiki.
imaxima is an
Emacs front end with
image that displays fully typeset math in your
You must activate Maxima by adding a line to =org-babel-load-languages=:
(org-babel-do-load-languages 'org-babel-load-languages '((maxima . t))) ; this line activates maxima
There are no Maxima-specific default header argument values.
The header argument,
:cmdline, can be used to pass command line
arguments to Maxima.
Org-mode support for Maxima does not include sessions.
Maxima produces the full range of result types.
The following source code block uses
maxima as a calculator for
powers of 12, where the powers are passed with a variable.
,#+name: test-maxima ,#+header: :exports results ,#+header: :var x=1.3121254 ,#+begin_src maxima programmode: false; print(12^x); ,#+end_src
programmode: false; print(12^x);
maxima is more than a calculator.
,#+name: solve-maxima ,#+header: :exports results ,#+begin_src maxima :results output programmode: false; eq: x**2-16 = 0; solution: solve(eq, x); print(solution); ,#+end_src
programmode: false; eq: x**2-16 = 0; solution: solve(eq, x); print(solution);
gnuplot installed (4.0 or higher), 3D graphics are possible.
This example is from a tutorial on the maxima/gnuplot interface.
,#+name: 3d-maxima ,#+header: :file images/maxima-3d.png ,#+header: :exports results ,#+header: :results graphics ,#+begin_src maxima programmode: false; plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]); ,#+end_src
programmode: false; plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]);
,#+NAME: solve-maxima ,#+HEADER: :exports none ,#+BEGIN_SRC maxima :results raw tex(exp(-x)/x); ,#+END_SRC
Latex code in org mode can be displayed inline by 'C-c C-x C-l'. To remove the inline display 'C-c C-c' is used. This is described further in the manual 2. If the inline display of the equations are illegible, the scale can be set by customising the variable 'org-format-latex-options', by setting the :scale variable to a value >1. This exports nicely to both html (C-c C-e b) and pdf (C-c C-e d). See 3 and 4 in the manual. NOTE: I have not tested this yet, but as Eric Schulte noted on the mailing list: "Alternately, if you really want to get fancy you could use noweb expansion 5 to insert the results of the imaxima code block into a latex code block, and then use the existing latex code block functionality to convert the imaxima output to images of different types depending on the export target."