From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Fraga, Eric" Subject: Re: Hiding a node title in export but not the content Date: Thu, 9 Jan 2020 09:48:21 +0000 Message-ID: <877e21hsf2.fsf@ucl.ac.uk> References: <87muaxca82.fsf@ntnu.no> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:40430) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipUQU-0003kR-Ca for emacs-orgmode@gnu.org; Thu, 09 Jan 2020 04:48:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipUQT-00063E-2S for emacs-orgmode@gnu.org; Thu, 09 Jan 2020 04:48:26 -0500 Received: from mail-eopbgr60125.outbound.protection.outlook.com ([40.107.6.125]:35972 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipUQS-0005sN-IU for emacs-orgmode@gnu.org; Thu, 09 Jan 2020 04:48:24 -0500 Content-Language: en-US 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Sven Bretfeld Cc: "emacs-orgmode@gnu.org" On Thursday, 9 Jan 2020 at 09:20, Sven Bretfeld wrote: > Hi everybody > > Is this possible? > > ** headline <-- not exported > :PROPERTIES: <-- not exported > Some content. <-- exported yes. I do this all the time to add structure to a document, structure that is not required in the exported version. I have the following code: #+begin_src emacs-lisp (defun esf/remove-lines-with-ignore-heading-tag (backend) (message "Deleting lines with ignore heading tag") (while (search-forward-regexp "^\\*+.*[ \t]+[a-ZA-Z0-9:]*:ignoreheading= :[a-ZA-Z0-9:]*$" (point-max) t) (cond ((eq backend 'latex) (replace-match "#+latex: % \\&" )) ((eq backend 'html) (replace-match "#+html: " )) (t (replace-match "")))) (message "... done deleting ignored headings.")) (add-hook 'org-export-before-processing-hook 'esf/remove-lines-with-ignor= e-heading-tag) #+end_src which then causes any headline with the ignoreheading tag to be removed, leaving the subtree under that headline present. One caveat: the subtree content inherits behaviour from the previous headline. For instance, if the previous headline was one that would not be exported at all, then this subtree will also not be exported. E.g.: #+begin_src org ,* heading 1 Text that will be exported ,* heading 2 :ignoreheading: Text that will also be exported but without the heading ,* heading 3 :noexport: Text that will not be exported. ,* heading 4 :ignoreheading: Text here will also not be exported because it ends up being under "heading 3" which has the :noexport: tag. #+end_src Note that my implementation is old and it could very well be that later versions of org have introduced something to cater for this use case. I have org customizations going back over 10 years... --=20 Eric S Fraga via Emacs 27.0.50, Org release_9.3-34-g2eee3c