[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] ignoreheading in LaTeX export
From: |
Alan Schmitt |
Subject: |
Re: [O] ignoreheading in LaTeX export |
Date: |
Thu, 27 Mar 2014 15:24:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) |
Nicolas Goaziou <address@hidden> writes:
> I suggest to use the dedicated MATCH argument for `org-map-entries':
>
> (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 () (delete-region (point) (progn (forward-line) (point))))
> "+ignoreheading"))
Thank you, this works, with a big caveat (which makes this approach
broken for me): with the following ECM
--8<---------------cut here---------------start------------->8---
* No Export :noexport:
test
* Heading 1 :ignoreheading:
foo
* Heading 2
bar
--8<---------------cut here---------------end--------------->8---
the text under "Heading 1" is no longer present. I suspect the heading is
removed before the ":noexport:" is processed, which captures the text as
well (which is bad: the reason for the heading in the first place is to
end the ":noexport:" block). I went back to the stack-overflow
suggestion.
>> 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?
>
> I don't think so. Though, after a quick test, I'm unable to reproduce
> it. Do you have an ECM?
It is indeed a problem with the stack-overflow solution and not with
yours. I was confused when trying things out.
Thanks,
Alan
Re: [O] ignoreheading in LaTeX export, Marcin Borkowski, 2014/03/29