correct way of dealing with multi-line address

This commit is contained in:
Óscar Nájera 2018-03-29 19:29:12 +02:00
parent 8174657679
commit e1720f9809

View file

@ -67,13 +67,6 @@
:translate-alist '((template . org-moderncv-template) :translate-alist '((template . org-moderncv-template)
(headline . org-moderncv-headline))) (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 ;;;; Template
;; ;;
@ -124,7 +117,8 @@ holding export options."
(when homepage (format "\\homepage{%s}\n" homepage))) (when homepage (format "\\homepage{%s}\n" homepage)))
;; address ;; address
(let ((address (org-export-data (plist-get info :address) info))) (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) (mapconcat (lambda (social-network)
(let ((command (org-export-data (plist-get info (let ((command (org-export-data (plist-get info
(car social-network)) (car social-network))