1
0
Fork 1
mirror of https://gitlab.com/Titan-C/org-cv.git synced 2025-04-17 02:39:29 +00:00

fix(ox-moderncv.el): Awesomecv implementation for split names

This commit is contained in:
Louis Vigneras 2025-01-20 18:19:51 +01:00
parent b05ca19418
commit 09d6ae7138

View file

@ -98,15 +98,14 @@ holding export options."
(let ((sec-num (plist-get info :section-numbers)))
(when (integerp sec-num)
(format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
;; Author.
(let ((author (and (plist-get info :with-author)
(let ((auth (plist-get info :author)))
(and auth (org-export-data auth info))))))
(if (string-match "\\([a-zA-Z0-9].*\\).:last.\\([a-zA-Z0-9].*\\)" author)
(let ((first-name (match-string 1 author))
(last-name (match-string 2 author)))
(format "\\name{%s}{%s}\n" first-name last-name))
(format "\\name{%s}{}\n" author)))
;; Author. If FIRSTNAME or LASTNAME are not given, try to deduct
;; their values by splitting AUTHOR on white space.
(let* ((author (split-string (org-export-data (plist-get info :author) info)))
(first-name-prop (org-export-data (plist-get info :firstname) info))
(last-name-prop (org-export-data (plist-get info :lastname) info))
(first-name (or (org-string-nw-p first-name-prop) (car author)))
(last-name (or (org-string-nw-p last-name-prop) (cadr author))))
(format "\\name{%s}{%s}\n" first-name last-name))
;; photo
(let ((photo (org-export-data (plist-get info :photo) info)))
(when (org-string-nw-p photo)