3

I am trying to set the following org-mode tangle property (mkdirp), which

creates parent directories for tangled files if the directory does not exist. A ‘yes’ value enables directory creation whereas ‘no’ inhibits it.

Apparently, it makes sense to set it for all relevant code blocks. My question is:

Is there a way to set a header property/argument like this globally for the entire .org file?

7

File-level properties can be set like this:

#+PROPERTY: header-args :mkdirp yes

Language-specific arguments can be set with this syntax (setting property p1 to value v1):

#+PROPERTY: header-args:lang :p1 v1

If you want to add properties without resetting everything else to default, use lang+, as in the following - it doesn't modify the previously set p1 when setting p2. Without the +, p2 would be set, but p1 would revert to the default value

#+PROPERTY: header-args:lang+ :p2 v2.

File-level properties need to be evaluated (C-c C-c on the line, or close and re-open the buffer) to take effect.

Finally, rather than file-level, you can set properties at each * Header level with the PROPERTIES drawers:

* Header
:PROPERTIES:
:header-args:lang: :property_1 v1 :property_2 v2
:header-args:lang+: :property_n value_n
:END:

These take effect immediately, and do not need to be evaluated.

See https://orgmode.org/manual/Property-Syntax.html for details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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