emacs-orgmode
[Top][All Lists]

Re: [O] ignoreheading in LaTeX export

 From: Alan Schmitt Subject: Re: [O] ignoreheading in LaTeX export Date: Thu, 27 Mar 2014 14:08:47 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
>
>> 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:
>>
>>
>> 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
"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))))))))

#+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