emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Force new page on exporting


From: Nick Dokos
Subject: Re: [O] Force new page on exporting
Date: Tue, 01 Jul 2014 12:21:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

York Zhao <address@hidden> writes:

>> My understanding is that you need extra machinery to implement 
>> "ignoreheading"
>
> I had implemented machinery the "ignoreheading" and posted the code in the 
> post
> "Wrong numbering after removal of headline". But anyways here's my code:
>
> (defun yz/org-export-process-heading-removal (backend)
>   "Ignore headlines with tag `ignoreheading'."
>   (save-excursion
>     (let ((org-allow-promoting-top-level-subtree t))
>       (org-map-entries
>        (lambda ()
>          (when (member "removeheading" (org-get-local-tags))
>            (org-promote-subtree)
>            (delete-region (line-beginning-position)
>                           (progn (forward-line) (point)))))))))
>
> (add-hook 'org-export-before-parsing-hook
>           #'yz/org-export-process-heading-removal)
>
> This code worked for ignoring the headline with tag "removeheading", and did
> re-numbering all the headlines properly. But:
>
> * Latex New Page :ignoreheading:
> #+latex: \newpage
>
>  Still didn't work which I have no idea at this moment yet. Any idea?

So before parsing, you are getting rid of the "ignoreheading" [fn:1]
headline (first, "promoting" it to a comment and then deleting the
region), so the #+latex: \newpage line now belongs to headline 2
which is then parsed and discarded.

I think you need a filter after parsing (which of course conflicts with
your need in the "Wrong numbering..." thread).

Footnotes:

[fn:1]  there is a "removeheading" vs "ignoreheading" inconsistency,
btw.




reply via email to

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