From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: End Section with \clearpage Date: Wed, 21 Jan 2015 10:25:20 +0100 Message-ID: References: <87k30r6kbh.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDrXX-0004C1-SL for emacs-orgmode@gnu.org; Wed, 21 Jan 2015 04:25:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDrXV-0000Hq-2I for emacs-orgmode@gnu.org; Wed, 21 Jan 2015 04:25:31 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:34062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDrXU-0000HU-Sd for emacs-orgmode@gnu.org; Wed, 21 Jan 2015 04:25:28 -0500 Received: by mail-wi0-f182.google.com with SMTP id n3so30066840wiv.3 for ; Wed, 21 Jan 2015 01:25:27 -0800 (PST) In-Reply-To: <87k30r6kbh.fsf@gmx.us> (rasmus@gmx.us's message of "Tue, 13 Jan 2015 11:34:10 +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: Rasmus Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rasmus writes: > 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 >> |=20 >> | \clearpage >> |=20 >> | * 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~/=3Dcode=3D-only headers" > (let ((prop-point (next-property-change 0 headline))) > (if prop-point (plist-get (text-properties-at prop-point headline) :paren= t)))) > > (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 i= nfo))) > (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 This looks very interesting for many things. Thanks. Rainer > > =E2=80=94Rasmus =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUv3CEAAoJENvXNx4PUvmClCgIAJsQ8xzcbqaL1IiB/w7/RE/V 5QHvAb5/1S4mRCIGRg/mIhoA9sU8v+KuGWPFRln1dPJj69Ky93C+fTz2y+AObP5N 1o/qCgDNlcGbjI7S6KhACc5EZ4qyDGz9I0eEGSq32EWp7kbKGPqZ0EkVnpVibff9 OpQpq+8cjWItKh+UAZkmyhWFpx7pQeuSsvtT3Ra83es5bE0ArZdSphxeALplhFIi JU7meuFU31XVUxFcdCk+NtbO3mSo9ogW50oVUIRileIsoyFsuEr5ODrRuDCkzyRy rcQ7ODlEi2M+N7UxyitUhO6R42r6yMXn6XGeZtWtyWMRYDiPuRDfImiGg7AsjMk= =Exls -----END PGP SIGNATURE----- --=-=-=--