1 #+OPTIONS: H:3 num:nil toc:2 \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
2 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks
3 #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
4 #+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n)
5 #+TITLE: Maxima Source Code Blocks in Org Mode
6 #+AUTHOR: Thomas S. Dye
7 #+EMAIL: tsd[at]tsdye[dot]com
9 #+STYLE: <style type="text/css">#outline-container-introduction{ clear:both; }</style>
10 #+LINK_UP: ../languages.html
11 #+LINK_HOME: http://orgmode.org/worg/
12 #+EXPORT_EXCLUDE_TAGS: noexport
16 <div id="subtitle" style="float: center; text-align: center;">
18 Org Mode support for <a href="http://maxima.sourceforge.net/">Maxima</a>
21 <a href="http://maxima.sourceforge.net/">
22 <img src="http://maxima.sourceforge.net/i/logo.png"/>
28 * Template Checklist [8/12] :noexport:
30 - [X] Indicate #+AUTHOR:
32 - [X] Revise banner source block [3/3]
33 - [X] Add link to a useful language web site
34 - [X] Replace "Language" with language name
35 - [X] Find a suitable graphic and use it to link to the language
37 - [X] Write an [[Introduction]]
38 - [X] Describe [[Requirements%20and%20Setup][Requirements and Setup]]
39 - [X] Replace "Language" with language name in [[Org%20Mode%20Features%20for%20Language%20Source%20Code%20Blocks][Org Mode Features for Language Source Code Blocks]]
40 - [ ] Describe [[Header%20Arguments][Header Arguments]]
41 - [ ] Describe support for [[Sessions]]
42 - [ ] Describe [[Result%20Types][Result Types]]
43 - [ ] Describe [[Other]] differences from supported languages
44 - [X] Provide brief [[Examples%20of%20Use][Examples of Use]]
46 Maxima is a computer algebra system descended from Macsyma, which was
47 originally released in 1982. It is released under the terms of the
48 GNU General Public License.
50 Maxima is written in Common Lisp. It can be accessed and extended in
53 * Requirements and Setup
54 Maxima binaries are available for Windows and Linux. These either
55 require a compatible Common Lisp or an executable Lisp image. Mac OS
56 X users can install via brew or MacPorts. The combinations of
57 operating system and Lisp implementation known to run Maxima can be
58 found on [[http://maxima-project.org/wiki/index.php?title%3DMaxima_ports][the Maxima ports page]].
60 There are several versions of Maxima, some with different names. The
61 variable =org-babel-maxima-command= can be set to the name of your
62 Maxima executable. The default value is "maxima".
64 Maxima ships with =Emacs= modes. Instructions for configuring them
65 can be found on [[http://emacswiki.org/emacs/MaximaMode][emacswiki]]. =imaxima= is an =Emacs= front end with
66 image that displays fully typeset math in your =Emacs= window.
68 You must activate Maxima by adding a line to
69 =org-babel-load-languages=:
71 #+BEGIN_SRC emacs-lisp
72 (org-babel-do-load-languages
73 'org-babel-load-languages
74 '((maxima . t))) ; this line activates maxima
78 * Org Mode Features for Maxima Source Code Blocks
80 There are no Maxima-specific default header argument values.
82 The header argument, =:cmdline=, can be used to pass command line
86 Org-mode support for Maxima does not include sessions.
89 Maxima produces the full range of result types.
93 The following source code block uses =maxima= as a calculator for
94 powers of 12, where the powers are passed with a variable.
98 ,#+header: :exports results
99 ,#+header: :var x=1.3121254
107 #+header: :exports results
108 #+header: :var x=1.3121254
114 #+results: test-maxima
117 Of course, =maxima= is more than a calculator.
120 ,#+name: solve-maxima
121 ,#+header: :exports results
122 ,#+begin_src maxima :results output
125 solution: solve(eq, x);
131 #+header: :exports results
132 #+begin_src maxima :results output
135 solution: solve(eq, x);
139 #+results: solve-maxima
145 With =gnuplot= installed (4.0 or higher), 3D graphics are possible.
146 This example is from [[http://maxima.sourceforge.net/maxima-gnuplot.html][a tutorial on the maxima/gnuplot interface]].
150 ,#+header: :file images/maxima-3d.png
151 ,#+header: :exports results
152 ,#+header: :results graphics
155 plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]);
160 #+header: :file images/maxima-3d.png
161 #+header: :results graphics
162 #+header: :exports results
165 plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]);
169 [[file:images/maxima-3d.png]]