Edgar Lux <edgar...@mailfence.com> writes:

> I am trying to exclude different sub-trees (a.k.a. headings or sections), 
> depending on the exporter backend. I am familiar with =:noexport:= to exclude 
> selected sections (disregarding the backend). I found a solution, but it is 
> only intended for a specific backend:
>
> https://emacs.stackexchange.com/a/76454

For arbitrary backend, you can try

(defun exclude-from-latex-export-hook (backend)
  (setq org-export-exclude-tags (cons (format "noexport_%s" backend) 
org-export-exclude-tags)))

> I would like to recommend that such a thing is implemented for any backend. 
> So that :noexport_X: (where X is a backend) is excluded. Something like:
>
> * Not for html   :noexport_html:
>
> * For HTML       :noexport_latex:

This is not a feature request I see often in the forums.
It is also easy to implement.
I think that it would be ok to add such feature if multiple users are 
interested.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to