From 7c06e78fb4e0bbb781a967d370858f06da1b9678 Mon Sep 17 00:00:00 2001 From: Roger Welsh Date: Sat, 20 Mar 2021 16:43:22 +1300 Subject: [PATCH] Adds template for AwesomeCV coverletter format Adds the components for constructing a coverletter using awesome-cv Provides additional sections CV_ENV: letterheader, lettersection, and cvletter cvletter provides the overall letter container lettersection provides underlined letter sections letterheader provides metadata as below Letterheader additional variables RECIPIENT: E.g. Company Recruitment Team LETTER_OPENING: E.g. Dear Mr./Ms./Dr. LastName, LETTER_CLOSING: E.g. Yours Sincerely, LETTER_ATTACHED: E.g. Curriculum Vitae LETTER_DATE: Uses \\today as default, E.g. <2021-01-01> Letterheader also uses the following variables EMPLOYER: E.g. Google Inc. LOCATION: E.g. 1600 Amphitheatre Parkway\\Mountain View, CA 94043 --- ox-awesomecv.el | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/ox-awesomecv.el b/ox-awesomecv.el index 424b59d..9144f93 100644 --- a/ox-awesomecv.el +++ b/ox-awesomecv.el @@ -244,7 +244,14 @@ as a communication channel." (location (or (org-element-property :LOCATION headline) "")) (right-img (org-element-property :RIGHT_IMG headline)) (label (or (org-element-property :LABEL headline) nil)) - (label-str (if label (format "%s\\hfill{}" label) ""))) + (label-str (if label (format "%s\\hfill{}" label) "")) + ;; Other Coverletter properties + (recipient (or (org-element-property :RECIPIENT headline) "")) + (letter-date (format "\\letterdate{%s}" (or date "\\today"))) + (letter-opening (or (format "\\letteropening{%s}" (org-element-property :LETTER_OPENING headline)) "")) + (letter-closing (or (format "\\letterclosing{%s}" (org-element-property :LETTER_CLOSING headline)) "")) + (letter-attached (or (format "\\letterenclosure[Attached]{%s}" (org-element-property :LETTER_ATTACHED headline)) "")) + ) (cond ((string= entrytype "cvemployer") @@ -280,7 +287,25 @@ as a communication channel." title employer location - (org-cv-utils--format-time-window from-date to-date)))))) + (org-cv-utils--format-time-window from-date to-date))) + ;; Coverletter sections + ((string= entrytype "letterheader") + (format "\\recipient\n {%s}\n {%s\\\\%s}\n\n%s\n%s\n%s\n%s\n" + recipient + employer + location + letter-date + letter-opening + letter-closing + letter-attached)) + ((string= entrytype "cvletter") + (format "\n\\lettertitle{%s}\n\\makelettertitle\n\n\\begin{cvletter}\n%s\n\\end{cvletter}\n\\makeletterclosing" + title + contents)) + ((string= entrytype "lettersection") + (format "\n\\lettersection{%s}\n%s" + title + contents))))) ;;;; Headlines of type "cventries" (defun org-awesomecv--format-cvenvironment (environment headline contents info) @@ -308,7 +333,11 @@ as a communication channel." (string= environment "cvsubentry") (string= environment "cvemployer") (string= environment "cvschool") - (string= environment "cvhonor")) + (string= environment "cvhonor") + (string= environment "cvletter") + (string= environment "lettersection") + (string= environment "letterheader") + ) (org-awesomecv--format-cventry headline contents info)) ((or (string= environment "cventries") (string= environment "cvhonors")) (org-awesomecv--format-cvenvironment environment headline contents info))