On Tue, Sep 30, 2014 at 3:05 AM, Rainer M Krug <rai...@krugs.de> wrote:
> Eric Brown <br...@fastmail.fm> writes:

Like Rainier mentioned you might want to use [noweb] to tangle both
for output tangling and execution. My system is set up to tangle for
both eg:

This
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+name: query
#+begin_src sql
select
    *
from
    table
where
    x > 10
#+end_src

#+begin_src R :tangle output.R
input <- '
    «query»
'
#+end_src
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
produces this
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
input <- '
    select
        *
    from
        table
    where
        x > 10
'
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
and

this
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+name: msg
#+begin_src sql
Hello, world.
#+end_src

#+begin_src R :eval yes
print("«msg»")
#+end_src

#+NAME:
#+begin_example
[1] "Hello, world."
#+end_example
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

produces this

## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
╭────
│ Hello, world.
╰────

╭────
│ print("«msg»")
╰────

╭────
│ [1] "Hello, world."
╰────
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

http://orgmode.org/manual/noweb.html#noweb

Reply via email to