Hi,

In worg's documentation of ob-maxima.el[fn:1], there are several bugs.


1. In the subsection `Inline Display of Maxima LaTeX Output', the
results are missing. This is because the code block is named
`solve-maxima', the same as in the section `Solver'. Export results in
that output being put in the `Solver' section (I don't know if that
should be considered a bug in Org). On the webpage, the errant output
has been deleted. The correct output in both sections should be
included.

2. In `3D Plots', the header arguments do not result in a link to a
generated file being created on evaluation of the code block. I am
unsure if this is a bug in Org, ob-maxima.el or ob-doc-maxima.org or
what. On reading the description of the =:results graphics=
header[fn:2], it looks like there is blame to go around. Related: in
ob-doc-octave.org, the graphics example only includes a =:results file=
header argument.

The attached patch to ob-doc-maxima.org fixes only the documentation
issues:

1. Present the correct output of code block `solve-maxima'.
2. Add the header argument `file' to the `3d-maxima' example to create a
correct link and graphics file.
3. Rename the tex code block to `tex-maxima' and change the results type
to =latex= to generate correct output.

TIA,
Leo Butler

[fn:1]
https://orgmode.org/worg//org-contrib/babel/languages/ob-doc-maxima.html
[fn:2] (info "(org) Results of Evaluation")

diff --git a/org-contrib/babel/languages/ob-doc-maxima.org b/org-contrib/babel/languages/ob-doc-maxima.org
index 810c9ef4..f1388187 100644
--- a/org-contrib/babel/languages/ob-doc-maxima.org
+++ b/org-contrib/babel/languages/ob-doc-maxima.org
@@ -137,6 +137,12 @@ Of course, =maxima= is more than a calculator.
   print(solution);
 #+end_src
 
+#+RESULTS: solve-maxima
+: solve: solution:
+:                                     x = - 4
+:                                      x = 4
+: [%t1, %t2] 
+
 ** 3D plots
 With =gnuplot= installed (4.0 or higher), 3D graphics are possible.
 This example is from [[http://maxima.sourceforge.net/maxima-gnuplot.html][a tutorial on the maxima/gnuplot interface]].
@@ -145,7 +151,7 @@ This example is from [[http://maxima.sourceforge.net/maxima-gnuplot.html][a tuto
 ,#+name: 3d-maxima
 ,#+header: :file images/maxima-3d.png
 ,#+header: :exports results
-,#+header: :results graphics
+,#+header: :results graphics file
 ,#+begin_src maxima 
   programmode: false;
   plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]);
@@ -154,14 +160,14 @@ This example is from [[http://maxima.sourceforge.net/maxima-gnuplot.html][a tuto
 
 #+name: 3d-maxima
 #+header: :file images/maxima-3d.png
-#+header: :results graphics
 #+header: :exports results
+#+header: :results graphics file
 #+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
 
-#+results: 3d-maxima
+#+RESULTS: 3d-maxima
 [[file:images/maxima-3d.png]]
 
 ** Inline Display of Maxima LaTeX Output
@@ -170,19 +176,24 @@ This example is from [[http://maxima.sourceforge.net/maxima-gnuplot.html][a tuto
   example.
 
 #+begin_example
-,#+NAME: solve-maxima
-,#+HEADER: :exports none
-,#+BEGIN_SRC maxima :results raw
+,#+NAME: tex-maxima
+,#+HEADER: :exports results
+,#+BEGIN_SRC maxima :results latex
   tex(exp(-x)/x);
 ,#+END_SRC
 #+end_example
 
-#+NAME: solve-maxima
+#+NAME: tex-maxima
 #+HEADER: :exports results
-#+BEGIN_SRC maxima :results raw
+#+BEGIN_SRC maxima :results latex
   tex(exp(-x)/x);
 #+END_SRC
 
+#+RESULTS: tex-maxima
+#+begin_export latex
+$${{e^ {- x }}\over{x}}$$
+#+end_export
+
 *** Toggle inline display of latex code
     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

Reply via email to