emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Torsten Wagner <torsten.wagner@gmail.com>
To: Emacs-orgmode@gnu.org
Subject: [babel] How to add results to text inline?
Date: Wed, 23 Feb 2011 14:55:41 +0900	[thread overview]
Message-ID: <4D64A15D.7020103@gmail.com> (raw)

Hi,

guess this is a FAQ or at least a stupid question.
However, I read along worg and wasn't able to find a solution.

I would like to add the result of a source code block in some text 
paragraph.

---start--mini-example----

#+source:my_formula(my_parameter='1')
#+begin_src python :results value :exports code
y = 2
f = my_parameter * y
return f
#+end_src

In my long long paragraph after that I want to say that
my result is #+call: my_formula(my_parameter='5') for x=5 but it is
#+call: my_formula() for x=1

---end--mini-example----

Well I would replace the calls by the result of the source code block
I read about no-web but this seems to work only within code blocks. I 
read about inline source code blocks, however, more complex functions 
would make it difficult to read.

Thanks for pointing me to obvious solutions ;)

Torsten

CC. How about some C-like format string for number results like
#+call: my_formula(my_parameter='5') :exports results :format %i5
results in integer 5 digits
00010
and  #+call: my_formula(my_parameter='5') :exports results :format %s.3
could result in scientific notation with 3 digits after the comma
1.000*10^1

This would allow to format the result to the needs just in place.

             reply	other threads:[~2011-02-23  5:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23  5:55 Torsten Wagner [this message]
2011-02-23  7:53 ` [babel] How to add results to text inline? Andreas Leha
2011-02-23  8:14   ` Torsten Wagner
2011-02-23  8:34     ` Andreas Leha
2011-02-23 13:03       ` Eric Schulte

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=4D64A15D.7020103@gmail.com \
    --to=torsten.wagner@gmail.com \
    --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).