Re: [O] insert evaluation results in place

2018-03-28 Thread Zhihao Ding
Thank you!

Zhihao


On Wed, Mar 28, 2018 at 4:28 PM Berry, Charles  wrote:

>
>
> > On Mar 28, 2018, at 7:42 AM, Zhihao Ding  wrote:
> >
> > I was wondering if anyone could share an example for referencing the
> results of a source code block in place.
> >
>
>
> See
>
> (info "(org) Evaluating code blocks")
>
> Example
>
>
> #+Name: put_in_para
> #+BEGIN_SRC R :exports none
> n_value=10
> n_value
> #+END_SRC
>
>
> This is the result: call_put_in_para() of the above.
>
> HTH,
>
> Chuck
>


Re: [O] insert evaluation results in place

2018-03-28 Thread Berry, Charles


> On Mar 28, 2018, at 7:42 AM, Zhihao Ding  wrote:
> 
> I was wondering if anyone could share an example for referencing the results 
> of a source code block in place. 
> 


See 

(info "(org) Evaluating code blocks")

Example


#+Name: put_in_para
#+BEGIN_SRC R :exports none
n_value=10
n_value
#+END_SRC


This is the result: call_put_in_para() of the above.

HTH,

Chuck



[O] insert evaluation results in place

2018-03-28 Thread Zhihao Ding
Hi there,

I was wondering if anyone could share an example for referencing the
results of a source code block in place.

For example, a source code block could be defined as below

  #+HEADER: n_value
  #+HEADER: :results value
  #+HEADER: :noweb yes
  #+BEGIN_SRC R
n_value=10
n_value
  #+END_SRC

and I want to insert the result value after evaluation into a paragraph of
text.

I currently evaluate the source code block first, then copy the stuff under
"#+RESULTS:" to the target location. I want to make it in one go,
especially when the output is just a single number.

Thank you,

Zhihao