From df20a2497630be8d6b4165b21736fd4552c09b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Fri, 23 Mar 2018 02:04:36 +0100 Subject: [PATCH] hacky way to get multi-line address --- ox-cv.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ox-cv.el b/ox-cv.el index bc6d618..eec3422 100644 --- a/ox-cv.el +++ b/ox-cv.el @@ -24,13 +24,19 @@ :options-alist '((:mobile "MOBILE" nil nil parse) (:homepage "HOMEPAGE" nil nil parse) - (:address "ADDRESS" nil nil parse) + (:address "ADDRESS" nil nil newline) (:gitlab "GITLAB" nil nil parse) (:github "GITHUB" nil nil parse) (:linkedin "LINKEDIN" nil nil parse) ) :translate-alist '((template . org-cv-template))) +(defun org-cv--add-latex-newlines (string) + "Replace regular newlines with LaTeX newlines (i.e. `\\\\')" + (let ((str (org-trim string))) + (when (org-string-nw-p str) + (concat (replace-regexp-in-string "\n" "\\\\\\\\\n" str) "\\\\")))) + ;;;; Template ;; ;; Template used is similar to the one used in `latex' back-end, @@ -80,7 +86,7 @@ holding export options." (when linkedin (format "\\social[linkedin]{%s}\n" linkedin))) ;; address (let ((address (org-export-data (plist-get info :address) info))) - (when address (format "\\address{%s}\n" address))) + (when address (format "\\address{%s}\n" (org-cv--add-latex-newlines address)))) ;; Date. (let ((date (and (plist-get info :with-date) (org-export-get-date info)))) (format "\\date{%s}\n" (org-export-data date info)))