From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: [babel] How to add results to text inline? Date: Wed, 23 Feb 2011 14:55:41 +0900 Message-ID: <4D64A15D.7020103@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=42221 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ps7hT-0005g9-Jl for Emacs-orgmode@gnu.org; Wed, 23 Feb 2011 00:55:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ps7hS-0001ly-Dj for Emacs-orgmode@gnu.org; Wed, 23 Feb 2011 00:55:47 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:65226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ps7hS-0001lr-7P for Emacs-orgmode@gnu.org; Wed, 23 Feb 2011 00:55:46 -0500 Received: by pzk33 with SMTP id 33so588482pzk.0 for ; Tue, 22 Feb 2011 21:55:45 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs-orgmode@gnu.org 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.