From: "Eric Schulte" <schulte.eric@gmail.com>
To: Thomas Holst <thomas.holst@de.bosch.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [babel] Variable support for ob-maxima
Date: Wed, 23 Mar 2011 11:44:37 -0600 [thread overview]
Message-ID: <878vw5enov.fsf@gmail.com> (raw)
In-Reply-To: .ywodd3lh3mjt@de.bosch.com
Thomas Holst <thomas.holst@de.bosch.com> writes:
> Hello,
>
> recent org-mode versions have support for maxima via org-babel. But
> there is no support vor variables. I implemented basic support for
> variables. A header =var: eq="x^2"= is translated to:
>
> #+begin_src maxima
> eq : x^2;
> #+end_src
>
> I attached a patch to this eMail.
>
Great, thanks for sharing this patch, I'd very much like to apply this.
Have you seen the instructions for contributing to Org-mode [1]? Any
patch over 10 lines long requires signed FSF copyright attribution
papers. Please let me know if you are able to complete the copyright
assignment, once that is done I will apply this patch.
>
> Now I can use the output from one maxima block and make a LaTeX equation
> out of it with one maxima code block and reuse the output and make further
> maipulations with it. I find it dificult to explain what I want to do,
> so here is an example:
>
The example below like a nice application, you may also want to use
"begin_src latex" blocks to display equations resulting from maxima code
blocks.
Cheers -- Eric
>
> * Reuse Output of maxima code blocks
>
> #+source: eq1()
> #+begin_src maxima :exports none :results output verbatim
> display2d:false;
> eq1: x**2;
> print(eq1);
> #+end_src
> #+results: eq1
> : x^2
>
> Pretty print equation with LaTeX:
>
> #+source: eq1-latex
> #+begin_src maxima :exports results :results output latex :var eq=eq1()
> print("\\begin{equation}");
> print(tex1(eq));
> print("\\end{equation}");
> #+end_src
>
> #+results: eq1-latex
> #+BEGIN_LaTeX
> \begin{equation}
> x^2
> \end{equation}
> #+END_LaTeX
>
> Do some further calculation / maipulation to equation
>
> #+source: eq2()
> #+begin_src maxima :exports none :results output verbatim :var eq=eq1()
> display2d:false;
> eq2 : eq + sin(x);
> print(eq2);
> #+end_src
> #+results: eq5
> : sin(x)+x^2
>
> Pretty print second equation:
>
> #+source: eq2-latex
> #+begin_src maxima :exports results :results output latex :var eq=eq2()
> print("\\begin{equation}");
> print(tex1(eq));
> print("\\end{equation}");
> #+end_src
>
> #+results:
> #+BEGIN_LaTeX
> \begin{equation}
> \sin x+x^2
> \end{equation}
> #+END_LaTeX
>
> With this workflow I have all org features for docmentation of math or
> engineering works.
>
> I am a lisp beginner so my lisp code may not be the best. If there are
> better ways to accomplish variable support please let me know.
Footnotes:
[1] http://orgmode.org/worg/org-contribute.php
next parent reply other threads:[~2011-03-23 17:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <.ywodd3lh3mjt@de.bosch.com>
2011-03-23 17:44 ` Eric Schulte [this message]
2011-03-24 7:25 ` [babel] Variable support for ob-maxima Thomas Holst
2011-03-23 15:04 Thomas Holst
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=878vw5enov.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=thomas.holst@de.bosch.com \
/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).