forked from mirrors/org-cv
hacky way to get multi-line address
This commit is contained in:
parent
fad1070eca
commit
df20a24976
1 changed files with 8 additions and 2 deletions
10
ox-cv.el
10
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)))
|
||||
|
|
Loading…
Reference in a new issue