emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Eric S Fraga <e.fraga@ucl.ac.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: excluding whole trees on export when subtrees have "select" tags present
Date: Mon, 09 Jan 2017 10:46:58 -0500	[thread overview]
Message-ID: <m2k2a4p765.fsf@Johns-MacBook-Air.local> (raw)
In-Reply-To: <878tqkmunb.fsf@ucl.ac.uk>

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

  reply	other threads:[~2017-01-09 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09  9:48 excluding whole trees on export when subtrees have "select" tags present Eric S Fraga
2017-01-09 15:46 ` John Kitchin [this message]
     [not found] ` <b3655cb7d021410f872939e0fedfee6a@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-09 21:49   ` Eric S Fraga
2017-01-10 14:27     ` John Kitchin
     [not found]     ` <617f560207eb41c0888a6f3c6a8df9db@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-11 15:26       ` Eric S Fraga
2017-01-11 20:26         ` Nicolas Goaziou
     [not found]         ` <af9636231a6b44598ee8e17caee8e941@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-12  6:50           ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k2a4p765.fsf@Johns-MacBook-Air.local \
    --to=jkitchin@andrew.cmu.edu \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).