[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] excluding whole trees on export when subtrees have "select" tags

From: John Kitchin
Subject: Re: [O] excluding whole trees on export when subtrees have "select" tags present
Date: Mon, 09 Jan 2017 10:46:58 -0500
User-agent: mu4e 0.9.19; emacs

Based on the docstrings for org-export-select-tags and
org-export-exclude-tags, this looks expected.

It does not look possible to exclude a heading and include a subheading
under it. It is possible to include a heading and exclude some
subheadings though you need a wanted tag in the parent, and notwanted
tags in the subtrees, and to declare the exclude tags.

#+EXCLUDE_TAGS: notwanted

I am surprised you can use comment like this. It looks to me like
commenting a tree makes all the subtrees in it not export too.

I could see somehow an org-export-before-processing-hook function that
deletes headlines and content you do not want, but it will mess with the
outline, e.g. if you delete "* headline" but leave "** subhead".
I thought I would be able to comment headlines with a hook function like
this, but I could not get it to work. Maybe it is a local problem though.

Eric S Fraga writes:

> Hello all,
> In this very minimal example,
> #+begin_src org
>   ,#+select_tags: wanted
>   ,* headline                                                   :notwanted:
>   some text
>   ,** subhead                                                     :wanted:
>   more text
> #+end_src
> exporting exports the whole tree under /headline/.  I can see why but it
> is arguably the wrong thing to do.  If /notwanted/ hasn't been selected,
> I would have assumed that all the contents under that headline would be
> ignored during export.
> My problem is that I want to export a document where certain headlines
> (but not all) are included *and* within these, some subheadlines are
> also included but not all.  I would be specifying one or two tags for
> selection depending on the specific export case.
> I can achieve what I want by commenting and uncommenting headlines but
> this is very clumsy and error-prone for my use case.
> I guess I simply want to confirm that the above noted behaviour is
> indeed what is expected from org.  If so, I will find a work-around.
> Thanks,
> eric

Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213

reply via email to

[Prev in Thread] Current Thread [Next in Thread]