0

I want to compose "recipes," consisting of "subroutines" defined as org nodes in separate files, into a single tree.

I can't get the behavior I want because (it seems) the org exporter handles #+INCLUDEs iteratively.

The level of each node relative to the absolute root is not known a priori.

root.org:

* root
#+INCLUDE: sub.org :minlevel 2
#+INCLUDE: sub.org :minlevel 2

sub.org:

* sub
#+INCLUDE: subsub.org :minlevel 2
#+INCLUDE: subsub.org :minlevel 2

subsub.org:

* subsub

When I export to org (C-c C-e O O) I get:

* root
** sub
** subsub
** subsub
** sub
** subsub
** subsub

If I remove all :minlevel 2 I get:

* root
** sub
*** subsub
**** subsub
***** sub
****** subsub
******* subsub

What I want is:

* root
** sub
*** subsub
*** subsub
** sub
*** subsub
*** subsub

Is this possible?

  • Make :minlevel 3 in sub.org? – NickD Nov 4 '20 at 0:42
  • @NickD The level of each node is only known relative to the headline in its own file. I want to be able to reuse sub.org in another recipe at any level. – wfsch Nov 4 '20 at 0:44
  • So why specify :minlevel at all? – NickD Nov 4 '20 at 1:54
  • @NickD The question shows the output when :minlevel is not included and how it differs from the output I'm after. – wfsch Nov 4 '20 at 2:02
  • I cannot reproduce that. What version of Org mode are you using? – NickD Nov 4 '20 at 2:28

Your Answer

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

Browse other questions tagged or ask your own question.