emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: [BUG] ob-doc-maxima.org and ob-maxima.el
Date: Wed, 2 Nov 2022 19:39:36 +0000	[thread overview]
Message-ID: <87edulm9hk.fsf@t14.reltub.ca> (raw)

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

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")


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to worg/org-contrib/babel/languages/ob-doc-maxima.org.diff --]
[-- Type: text/x-diff; name="ob-doc-maxima.org.diff", Size: 2444 bytes --]

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	other threads:[~2022-11-02 19:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 19:39 Leo Butler [this message]
2022-11-03  6:51 ` [BUG] ob-doc-maxima.org and ob-maxima.el Ihor Radchenko
2022-11-03 18:15   ` Leo Butler
2022-11-04  3:38     ` Ihor Radchenko
2022-11-04 20:49       ` Leo Butler
2022-11-05  3:40         ` Ihor Radchenko
2022-11-07 14:24           ` Leo Butler
2022-11-04  4:03     ` Clarification on :results file vs. :results graphics file (was: [BUG] ob-doc-maxima.org and ob-maxima.el) Ihor Radchenko
2022-11-04 19:11       ` Clarification on :results file vs. :results graphics file Leo Butler
2022-11-05  3:41       ` Clarification on :results file vs. :results graphics file (was: [BUG] ob-doc-maxima.org and ob-maxima.el) Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edulm9hk.fsf@t14.reltub.ca \
    --to=leo.butler@umanitoba.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).