From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: ignoreheading in LaTeX export Date: Thu, 27 Mar 2014 14:08:47 +0100 Message-ID: References: <87y4zwrpp9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTA3r-0004an-3T for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 09:09:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTA3i-00022R-PR for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 09:09:35 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:49935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTA3i-000222-Iu for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 09:09:26 -0400 In-Reply-To: <87y4zwrpp9.fsf@gmail.com> (Nicolas Goaziou's message of "Thu, 27 Mar 2014 09:49:38 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode Nicolas Goaziou writes: > Hello, > > Alan Schmitt writes: > >> I need to ignore a heading during a LaTeX export (I don't want the >> "section" command to be generated, but I need the text to be included; >> the heading is there because the previous one is tagged with "export"). >> I found this solution: >> >> https://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents >> >> Is it still the way to go? > > You can use a hook or a filter to remove the headline. I would use > a hook in this case. See (info "(org) Advanced configuration"), the > first example, with an appropriate MATCH argument for `org-map-entries'. Thanks a lot for the suggestion, here is what I ended up doing: #+begin_src emacs-lisp (defun as/delete-ignored-heading (backend) "Remove every headline with a tag `ignoreheading' in the current buffer. BACKEND is the export back-end being used, as a symbol." (org-map-entries (lambda () (when (member "ignoreheading" (org-get-tags-at nil t)) (lambda () (delete-region (point) (progn (forward-line) (point)))))))) (setq org-export-before-parsing-hook '(as/delete-ignored-heading)) #+end_src It works great. I have a followup question (purely from an aesthetic point of view, the code works fine). I see that a label is still generated in the LaTeX file (there is a "\label{sec-1}" with just the "\maketitle" above it). Is it expected? Thanks again, Alan