From e1720f9809598b4976e8ceeaa6a624ae56f7c758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Thu, 29 Mar 2018 19:29:12 +0200 Subject: [PATCH] correct way of dealing with multi-line address --- ox-moderncv.el | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ox-moderncv.el b/ox-moderncv.el index cecdfe5..801a2b9 100644 --- a/ox-moderncv.el +++ b/ox-moderncv.el @@ -67,13 +67,6 @@ :translate-alist '((template . org-moderncv-template) (headline . org-moderncv-headline))) -(defun org-moderncv--add-latex-newlines (string) - "Replace regular newlines in STRING 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 ;; @@ -124,7 +117,8 @@ holding export options." (when homepage (format "\\homepage{%s}\n" homepage))) ;; address (let ((address (org-export-data (plist-get info :address) info))) - (when address (format "\\address{%s}\n" (org-moderncv--add-latex-newlines address)))) + (when address (format "\\address%s\n" (mapconcat (lambda (line) (format "{%s}" line)) + (split-string address "\n") "")))) (mapconcat (lambda (social-network) (let ((command (org-export-data (plist-get info (car social-network))