From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: excluding whole trees on export when subtrees have "select" tags present Date: Mon, 09 Jan 2017 10:46:58 -0500 Message-ID: References: <878tqkmunb.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQcAA-0003jO-Lj for emacs-orgmode@gnu.org; Mon, 09 Jan 2017 10:47:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQcA6-0004HI-Oh for emacs-orgmode@gnu.org; Mon, 09 Jan 2017 10:47:10 -0500 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:33174) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cQcA6-0004H2-Kq for emacs-orgmode@gnu.org; Mon, 09 Jan 2017 10:47:06 -0500 Received: by mail-qt0-x236.google.com with SMTP id v23so139093864qtb.0 for ; Mon, 09 Jan 2017 07:47:06 -0800 (PST) In-reply-to: <878tqkmunb.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Eric S Fraga Cc: emacs-orgmode@gnu.org 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 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu