emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] ignoreheading in LaTeX export


From: Nicolas Goaziou
Subject: Re: [O] ignoreheading in LaTeX export
Date: Thu, 27 Mar 2014 14:28:08 +0100

Alan Schmitt <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]