I have a chapter heading in a literate program, in which all source-code is tangled into a single file called test.hs. It is irritating and error-prone to have to repeatedly type the :tangle code/src/test.hs for every new code block

Hence I would like to use the properties drawer of that chapter to once and for all tell Emacs to tangle ALL source code it sees inside this subtree to go into the file test.hs

My attempt at trying this did not work. How do I fix it?

 ** New Chapter
 :tangle: code/src/test.hs   (This does not work!)

  #+BEGIN_SRC haskell
    import qualified Data.Map as Map  
    main = print "Hello World"

  Here's the `add` function to add two numbers.     

  #+BEGIN_SRC haskell 
   add a b = a+b
  • 1
    There is unnecessary +-sign in the example before PROPERTIES.
    – Panu
    Jan 10, 2017 at 19:58

1 Answer 1


You have to use :header-args: property instead. Like this

** New Chapter
:header-args: :tangle code/src/test.hs

This behaviour changed with the Org-mode 9 (see changes). There is also entry on org-mode manual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.