org-babel: want all noweb block references to appear verbatim on export
Question: Consider the following MVE in org-mode -- it contains my full question in
detail. But, in summary, with some code blocks, some noweb references to other
code blocks are substituted inline when I export the document, and, with other
code blocks, the noweb references, in double broket quotes, are copied
verbatim into the exported PDF. I do not know what causes this difference in
behavior and I don't know how to control it, but I'd like to. I'd like to be
able to specify that some blocks have behavior 1 (references substituted) and
other blocks have behavior 2 (references verbatim).

The PDF that results from `org-export` is [at this
link](https://drive.google.com/file/d/0B4v0MzmZfdm8TzRLeFlreUFnbEk/view?usp=sharing)

    
    
    #+BEGIN_COMMENT
    The emacs lisp block must export results, even though the results are none,
    otherwise the block will not be eval'ed on export, and we will get 
    unacceptable confirmation requests for all the subsequent python blocks. 
    #+END_COMMENT
    
    #+BEGIN_SRC emacs-lisp :exports results :results none
    (setq org-confirm-babel-evaluate nil)
    #+END_SRC
    
    ** PyTests
    
       Define the test and cases. This code must be tangled out to an external file
       so =py.test= can see it.
    
       When I /export/ this to PDF, the noweb references, namely =<<imports>>= and
       =<<definitions>>=, are substituted inline, so the typeset version of this
       block in the PDF shows ALL the code.  This is not what I want.
    
    #+NAME: test-block
    #+BEGIN_SRC python :noweb yes :tangle test_foo.py 
    <<imports>>
    <<definitions>>
    def test_smoke ():
        np.testing.assert_approx_equal (foo_func (), foo_constant)
    #+END_SRC
    
    #+RESULTS: test-block
    : None
    
       The following blocks import prerequisites and do a quick smoke test:
    
    ** Do Some Imports
    
    #+NAME: imports
    #+BEGIN_SRC python 
    import numpy as np
    #+END_SRC
    
    #+RESULTS: imports
    : None
    
    ** Define Some Variables
    
       However, in the typeset PDF, the noweb reference =<<foo-func>>= in the block
       below is /not/ substituted in-line, but rather appears verbatim. I want /all/
       noweb references to appear verbatim in the exported, typeset, PDF document,
       just like this one.
    
    #+NAME: definitions
    #+BEGIN_SRC python 
    foo_constant = 42.0
    <<foo-func>>
    #+END_SRC
    
    #+RESULTS: definitions
    
    ** Define Some Functions
    
    *** Foo Function is Really Interesting
    
    #+NAME: foo-func
    #+BEGIN_SRC python
    def foo_func () :
        return 42.000
    #+END_SRC
    
    #+RESULTS: foo-func
    : None
    
    We want results from pytest whether it succeeds or fails, hence the /OR/ with
    =true= in the shell
    
    #+BEGIN_SRC sh :results output replace :exports both
    py.test || true
    #+END_SRC
    
    #+RESULTS:
    : ============================= test session starts ==============================
    : platform darwin -- Python 2.7.10, pytest-2.8.0, py-1.4.30, pluggy-0.3.1
    : rootdir: /Users/bbeckman/foo, inifile: 
    : collected 1 items
    : 
    : test_foo.py .
    : 
    : =========================== 1 passed in 0.06 seconds ===========================
    


Answer: Found the appropriate [references
here](http://orgmode.org/manual/noweb.html#noweb)

[Here is a corrected PDF exported from the following .org
file](https://drive.google.com/file/d/0B4v0MzmZfdm8QmwybXRrYVFVdEk/view?usp=sharing).

And here is the corrected MVE (it, itself, explains the correction):

    
    
    #+BEGIN_COMMENT
    The emacs lisp block must export results, even though the exports are none,
    otherwise the block will not be eval'ed on export, and we will get unacceptable
    confirmation requests for all the subsequent python blocks.
    #+END_COMMENT
    
    #+BEGIN_SRC emacs-lisp :exports results :results none
      (setq org-confirm-babel-evaluate nil)
    #+END_SRC
    
    ** PyTests
    
       Define the test and cases. This code must be tangled out to an external file
       so =py.test= can see it.
    
       When I /export/ this to PDF, the noweb references, namely =<<imports>>= and
       =<<definitions>>=, are *NOT* substituted inline, but typeset verbatim. This
       is what I want.  You get this behavior by saying =:noweb no-export= in the
       header.
    
    #+NAME: test-block
    #+BEGIN_SRC python :tangle test_foo.py :noweb no-export :exports code :results none
    dummy_for_org_mode = True
    <<imports>>
    <<definitions>>
    def test_smoke ():
        np.testing.assert_approx_equal (foo_func (), foo_constant)
    #+END_SRC
    
       The following blocks import prerequisites and do a quick smoke test:
    
    ** Do Some Imports
    
    #+NAME: imports 
    #+BEGIN_SRC python :exports code :results none
      import numpy as np
    #+END_SRC
    
    ** Define Some Variables and Functions
    
       In this block, I want the noweb reference =<<foo-func>>= in the block to be
       substituted in-line and not to appear verbatim. Do that by saying
       =:noweb yes= in the header.
    
    #+NAME: definitions 
    #+BEGIN_SRC python :noweb yes :exports code :results none
      foo_constant = 42.0
      <<foo-func>>
    #+END_SRC
    
    ** Define Some Functions
    
    *** Foo Function is Really Interesting
    
    Here, I want to talk about the implementation of foo function in detail, but I
    don't want its code to be exported again, just to appear in the original
    =.org= file as I reminder or note to me.
    
    #+NAME: foo-func 
    #+BEGIN_SRC python :exports none :results none
      def foo_func () :
          return 42.000
    #+END_SRC
    
    ** Run the Tests
    
    We want results from pytest whether it succeeds or fails, hence the /OR/ with
    =true= in the shell
    
    #+BEGIN_SRC sh :results output replace :exports both
      py.test || true
    #+END_SRC
    
    #+RESULTS:
    : ============================= test session starts ==============================
    : platform darwin -- Python 2.7.10, pytest-2.8.0, py-1.4.30, pluggy-0.3.1
    : rootdir: /Users/bbeckman/foo, inifile: 
    : collected 1 items
    : 
    : test_foo.py .
    : 
    : =========================== 1 passed in 0.08 seconds ===========================
    

