From c9ddf59080a60ff813fc0443a322b16c19d8349b Mon Sep 17 00:00:00 2001 From: Diego Zamboni Date: Mon, 9 Mar 2020 10:18:13 +0100 Subject: [PATCH] Added support for PAGEBREAK attribute in headings in the AwesomeCV exporter. --- doc/content/post/latex_export.md | 2 ++ ox-awesomecv.el | 27 +++++++++++++++------------ readme.org | 2 ++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/doc/content/post/latex_export.md b/doc/content/post/latex_export.md index 6236053..830e3cd 100644 --- a/doc/content/post/latex_export.md +++ b/doc/content/post/latex_export.md @@ -143,6 +143,8 @@ these support additional property fields: | | to the entry. | | RIGHT\_IMG | path to an image to include floating to the right of a `cventry`, | | | a `cvsubentry` or `cvschool` entry. Meant to be used to show a logo. | +| PAGEBREAK | Causes a LaTeX `\clearpage` statement to be inserted in the | +| | exported output before the heading. | diff --git a/ox-awesomecv.el b/ox-awesomecv.el index 9323b26..e8e514f 100644 --- a/ox-awesomecv.el +++ b/ox-awesomecv.el @@ -283,18 +283,21 @@ CONTENTS is the contents of the headline. INFO is a plist used as a communication channel." (unless (org-element-property :footnote-section-p headline) (let ((environment (let ((env (org-element-property :CV_ENV headline))) - (or (org-string-nw-p env) "block")))) - (cond - ;; is a cv entry or subentry - ((or (string= environment "cventry") - (string= environment "cvsubentry") - (string= environment "cvemployer") - (string= environment "cvschool") - (string= environment "cvhonor")) - (org-awesomecv--format-cventry headline contents info)) - ((or (string= environment "cventries") (string= environment "cvhonors")) - (org-awesomecv--format-cvenvironment environment headline contents info)) - ((org-export-with-backend 'latex headline contents info)))))) + (or (org-string-nw-p env) "block"))) + (pagebreak (org-string-nw-p (org-element-property :PAGEBREAK headline)))) + (concat + (when pagebreak "\\clearpage\n") + (cond + ;; is a cv entry or subentry + ((or (string= environment "cventry") + (string= environment "cvsubentry") + (string= environment "cvemployer") + (string= environment "cvschool") + (string= environment "cvhonor")) + (org-awesomecv--format-cventry headline contents info)) + ((or (string= environment "cventries") (string= environment "cvhonors")) + (org-awesomecv--format-cvenvironment environment headline contents info)) + ((org-export-with-backend 'latex headline contents info))))))) ;;;; Plain List, to intercept and transform "cvskills" lists diff --git a/readme.org b/readme.org index 061901b..9ebff12 100644 --- a/readme.org +++ b/readme.org @@ -256,6 +256,8 @@ these support additional property fields: | | to the entry. | | RIGHT_IMG | path to an image to include floating to the right of a =cventry=, | | | a =cvsubentry= or =cvschool= entry. Meant to be used to show a logo. | +| PAGEBREAK | Causes a LaTeX =\clearpage= statement to be inserted in the | +| | exported output before the heading. | All the supported values of =CV_ENV= are described below.