From: Ihor Radchenko <yantar92@posteo.net>
To: Leo Butler <Leo.Butler@umanitoba.ca>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [BUG] ob-doc-maxima.org and ob-maxima.el
Date: Fri, 04 Nov 2022 03:38:48 +0000 [thread overview]
Message-ID: <87k04b5qyf.fsf@localhost> (raw)
In-Reply-To: <87edujkiq2.fsf@t14.reltub.ca>
Leo Butler <Leo.Butler@umanitoba.ca> writes:
>> You basically need to evaluate the code block manually to have it
>> present in the original file without a need to evaluate during export.
>>
>> I do not have maxima on my system. It would be welcome if you evaluate
>> the code blocks with missing results manually and submit a patch with.
>
> Attached.
There is no need to wrap the results into example blocks. They will
better be as is. Org export will take care about choosing what to
export: code, results, or both.
>> Using graphics together with file does not make sense.
>
> Ok. But I am not sure the code agrees with you. In ob-core.el,
> `org-babel-graphical-output-file' is defined as:
Let's discuss it in a separate thread. I will need to study the code a
bit more to understand what we promise in the manual vs. actual state of
the code.
> #+name: 3d-maxima
> #+header: :file images/maxima-3d.png
> -#+header: :results graphics
> #+header: :exports results
> +#+header: :results 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
> +Which produces the code:
> +
> +#+begin_example
> +,#+RESULTS: 3d-maxima
> [[file:images/maxima-3d.png]]
> +#+end_example
> +
> +and the image:
> +
> +#+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?
> -#+NAME: solve-maxima
> +#+NAME: tex-maxima
> #+HEADER: :exports results
> #+BEGIN_SRC maxima :results raw
> tex(exp(-x)/x);
> #+END_SRC
>
> +Which produces the code:
> +#+begin_example
> +,#+RESULTS: tex-maxima
> +$${{e^ {- x }}\over{x}}$$
> +#+end_example
> +that is rendered as:
> +#+RESULTS: tex-maxima
> +$${{e^ {- x }}\over{x}}$$
Please make #+RESULTS a separate paragraph. It may otherwise not be
correctly recognized.
> --- a/lisp/ob-maxima.el
> +++ b/lisp/ob-maxima.el
> @@ -77,6 +77,9 @@
> "Execute a block of Maxima entries with org-babel.
> This function is called by `org-babel-execute-src-block'."
> (message "Executing Maxima source code block")
> + ;; Make `:results file' imply `:results graphics file'
> + (when (member "file" (assq :result-params params))
> + (push "graphics" (alist-get :result-params params)))
> (let ((result-params (split-string (or (cdr (assq :results params)) "")))
> (result
> (let* ((cmdline (or (cdr (assq :cmdline params)) ""))
Let's move the ob-maxima changes and discussion about graphics to a
separate thread.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2022-11-04 3:39 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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k04b5qyf.fsf@localhost \
--to=yantar92@posteo.net \
--cc=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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.