I'm trying to do something like this:
* Define some functions
#+begin_src python :noweb_ref defs
def f1(a,b,c):
return True
def f2(d,e,f):
return False
#+end_src
* Use them in a results-exported block later
#+begin_src python :results output :exports both :tangle yes
<<defs>>
print "test results:"
print f1(1,2,3)
#end_src
What I want to happen is for <<defs>> to be expanded tangle-style when the block is evaluated to produce the export output. What actually happens is that <<defs>> gets evaluated literally and causes a syntax error.
When tangling blocks like this to an output file, everything works perfectly, but I can't figure out how to do the same thing when I'm exporting the buffer.
Suggestions?
:noweb yes
header was exactly my problem. I'd tried:noweb tangle
and:tangle yes
. Now that you point it out, the documentation at orgmode.org/manual/noweb.html#noweb is perfectly clear. – Dispersal