From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: [babel] How to add results to text inline? Date: Wed, 23 Feb 2011 17:14:50 +0900 Message-ID: <4D64C1FA.9030300@gmail.com> References: <4D64A15D.7020103@gmail.com> <4D64BD02.3030306@med.uni-goettingen.de> 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=37284 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ps9s8-00015i-VS for emacs-orgmode@gnu.org; Wed, 23 Feb 2011 03:14:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ps9s7-0004DW-S3 for emacs-orgmode@gnu.org; Wed, 23 Feb 2011 03:14:56 -0500 Received: from mail-px0-f169.google.com ([209.85.212.169]:49702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ps9s7-0004DE-Mr for emacs-orgmode@gnu.org; Wed, 23 Feb 2011 03:14:55 -0500 Received: by pxi9 with SMTP id 9so574605pxi.0 for ; Wed, 23 Feb 2011 00:14:54 -0800 (PST) In-Reply-To: <4D64BD02.3030306@med.uni-goettingen.de> 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: Andreas Leha Cc: emacs-orgmode@gnu.org Hi Andreas, thanks for pointing to that. I guess it is the same like on worg. As far as I understood this would help me to add the python code inside my paragraph which is indeed nice for small code-snippet. However, I would like to replace the result of a function call via #+call aka #+lob aka #+function. I will try he src_python{print f} and use a session... However, I thought there might be a 'easier' way ;) Thanks Torsten On 02/23/2011 04:53 PM, Andreas Leha wrote: > Hi Torsten, > > Have a look at the 'src_{}' construct as described here: > http://orgmode.org/org.html#Structure-of-code-blocks > > Hth, > Andreas > > > Am 23.02.2011 06:55, schrieb Torsten Wagner: >> 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. >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode