From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: End Section with \clearpage Date: Tue, 13 Jan 2015 11:34:10 +0100 Message-ID: <87k30r6kbh.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAynu-0003rr-SE for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 05:34:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAynq-0003u8-QR for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 05:34:30 -0500 Received: from plane.gmane.org ([80.91.229.3]:53485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAynq-0003u0-Iy for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 05:34:26 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YAynn-0005La-QM for emacs-orgmode@gnu.org; Tue, 13 Jan 2015 11:34:23 +0100 Received: from 109.201.154.154 ([109.201.154.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Jan 2015 11:34:23 +0100 Received: from rasmus by 109.201.154.154 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Jan 2015 11:34:23 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Rainer M Krug writes: > I want to add after some sections a \clearpage which works, But the > \clearpage is part of the last header: > > ,---- > | * Subsection to be ended with clearpage > | ** Sub-section > | some text > | *** sub-sub-section > | Some more text > | > | \clearpage > | > | * Next Subsection > | * Last subsection > `---- > > Is there a way that I can add this \clearpage at the end of the section > *without* being in the last subsection? > > I guess not? Use a org-export-filter-section-functions filter to insert "\clearpage" at the end on headlines with the appropriate property or tag. A quick hack: (defun rasmus/get-org-headline-string-element (headline backend info) "Return the org element representation of an element. Won't work on ~verb~/=code=-only headers" (let ((prop-point (next-property-change 0 headline))) (if prop-point (plist-get (text-properties-at prop-point headline) :parent)))) (defun rasmus/org-latex-clearpage (headline backend info) "Insert a clearpage at end of heading if property clearpage is non-nil." (when (org-export-derived-backend-p backend 'latex) (let ((elm (rasmus/get-org-headline-string-element headline backend info))) (when (and elm (org-element-property :CLEARPAGE elm)) (concat headline "\\clearpage\\n"))))) (add-to-list 'org-export-filter-headline-functions 'rasmus/org-latex-clearpage) Example file: * test :PROPERTIES: :clearpage: t :END: ** sub1 ** sub2 —Rasmus -- Summon the Mothership!