emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode][babel] How to add results to text inline?


From: Andreas Leha
Subject: Re: [Orgmode][babel] How to add results to text inline?
Date: Wed, 23 Feb 2011 08:53:38 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Iceowl/1.0b1 Icedove/3.0.11

Hi Torsten,

Have a look at the 'src_<language>{<body>}' 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]