From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [BUG] ob-doc-maxima.org and ob-maxima.el
Date: Fri, 4 Nov 2022 20:49:40 +0000 [thread overview]
Message-ID: <87r0yih2cd.fsf@t14.reltub.ca> (raw)
In-Reply-To: <87k04b5qyf.fsf@localhost> (Ihor Radchenko's message of "Fri, 04 Nov 2022 03:38:48 +0000")
[-- Attachment #1: Type: text/plain, Size: 884 bytes --]
On Fri, Nov 04 2022, Ihor Radchenko <yantar92@posteo.net> wrote:
>> +#+RESULTS: 3d-maxima
>> +[[https://orgmode.org/worg/org-contrib/babel/languages/images/maxima-3d.png]]
>> +
>
> I am a bit confused here. Did you hand-craft the results?
I did, based on what I see in ob-doc-octave.org. In the present patch
(attached), I have left the results alone.
>
>> -#+NAME: solve-maxima
>> +#+NAME: tex-maxima
>> #+HEADER: :exports results
>> #+BEGIN_SRC maxima :results raw
>> tex(exp(-x)/x);
>> #+END_SRC
>
> Please make #+RESULTS a separate paragraph. It may otherwise not be
> correctly recognized.
Ok, I have done this in the attached patch.
>
> Let's move the ob-maxima changes and discussion about graphics to a
> separate thread.
Ok.
I believe the attached patch fixes all the problems that you saw with
the previous versions.
Leo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-contrib-babel-languages-ob-doc-maxima.org-correc.patch --]
[-- Type: text/x-diff; name="0001-org-contrib-babel-languages-ob-doc-maxima.org-correc.patch", Size: 3440 bytes --]
From a4db0ed4af22e43e817ebca110872e7ee5222c2d Mon Sep 17 00:00:00 2001
From: Leo Butler <leo.butler@umanitoba.ca>
Date: Fri, 4 Nov 2022 15:23:27 -0500
Subject: [PATCH] org-contrib/babel/languages/ob-doc-maxima.org: correct docs
* include the results of test-maxima and solve-maxima examples;
* correct the :results header of graphics example;
* rename the tex example to tex-maxima and include the results;
* add an empty line before each #+results: as suggested by Ihor.
Ref: https://list.orgmode.org/87k04b5qyf.fsf@localhost/T/#t
---
org-contrib/babel/languages/ob-doc-maxima.org | 32 +++++++++++++++----
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/org-contrib/babel/languages/ob-doc-maxima.org b/org-contrib/babel/languages/ob-doc-maxima.org
index 810c9ef4..a6b403dc 100644
--- a/org-contrib/babel/languages/ob-doc-maxima.org
+++ b/org-contrib/babel/languages/ob-doc-maxima.org
@@ -111,7 +111,9 @@ powers of 12, where the powers are passed with a variable.
print(12^x);
#+end_src
-#+results: test-maxima
+HTML export of the result:
+
+#+RESULTS: test-maxima
: 26.06280316745402
** Solver
@@ -137,6 +139,14 @@ Of course, =maxima= is more than a calculator.
print(solution);
#+end_src
+HTML export of the result:
+
+#+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 +155,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 file 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]);
@@ -154,35 +164,43 @@ 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 file 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
-#+results: 3d-maxima
+HTML export of the Maxima code block result:
+
+#+RESULTS: 3d-maxima
[[file:images/maxima-3d.png]]
+
** Inline Display of Maxima LaTeX Output
[[http://maxima.sourceforge.net/][Maxima]] code can be evaluated and displayed inline in Org mode
through babel [fn:1] as in the example below, based on RS initial
example.
#+begin_example
-,#+NAME: solve-maxima
-,#+HEADER: :exports none
+,#+NAME: tex-maxima
+,#+HEADER: :exports results
,#+BEGIN_SRC maxima :results raw
tex(exp(-x)/x);
,#+END_SRC
#+end_example
-#+NAME: solve-maxima
+#+NAME: tex-maxima
#+HEADER: :exports results
#+BEGIN_SRC maxima :results raw
tex(exp(-x)/x);
#+END_SRC
+HTML export of the result:
+
+#+RESULTS: tex-maxima
+$${{e^ {- x }}\over{x}}$$
+
*** 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
--
2.35.1
next prev parent reply other threads:[~2022-11-04 21:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 19:39 [BUG] ob-doc-maxima.org and ob-maxima.el Leo Butler
2022-11-03 6:51 ` Ihor Radchenko
2022-11-03 18:15 ` Leo Butler
2022-11-04 3:38 ` Ihor Radchenko
2022-11-04 20:49 ` Leo Butler [this message]
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=87r0yih2cd.fsf@t14.reltub.ca \
--to=leo.butler@umanitoba.ca \
--cc=emacs-orgmode@gnu.org \
--cc=yantar92@posteo.net \
/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).