From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: ignoreheading in LaTeX export
Date: Thu, 27 Mar 2014 14:28:08 +0100 [thread overview]
Message-ID: <87d2h7srdj.fsf@gmail.com> (raw)
In-Reply-To: <m2ob0rvleo.fsf@polytechnique.org> (Alan Schmitt's message of "Thu, 27 Mar 2014 14:08:47 +0100")
Alan Schmitt <alan.schmitt@polytechnique.org> writes:
> 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
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"))
> 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?
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2014-03-27 13:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 8:23 ignoreheading in LaTeX export Alan Schmitt
2014-03-27 8:49 ` Nicolas Goaziou
2014-03-27 10:23 ` Sebastien Vauban
2014-03-27 10:48 ` Nicolas Goaziou
2014-03-27 13:08 ` Alan Schmitt
2014-03-27 13:28 ` Nicolas Goaziou [this message]
2014-03-27 14:24 ` Alan Schmitt
2014-03-27 21:51 ` Rasmus
2014-03-29 9:48 ` Alan Schmitt
2014-03-29 14:17 ` Marcin Borkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d2h7srdj.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=alan.schmitt@polytechnique.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).