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

feat(ox-moderncv.el): allow specify of last name with regexp string

It looks at the string value of "author" and using a regexp (to be
enhanced) it puts the last name(s) in the the appropriate second
argument of the LaTeX macro of moderncv "\name{first-name}{last-name}"
This commit is contained in:
Louis Vigneras 2025-01-05 15:51:41 +01:00
parent 7d31fe46b8
commit cdccd2cdcf

View file

@ -102,8 +102,11 @@ holding export options."
(let ((author (and (plist-get info :with-author)
(let ((auth (plist-get info :author)))
(and auth (org-export-data auth info))))))
(print author)
(format "\\name{%s}{}\n" author))
(if (string-match "u\\([a-z]*.[a-z]*\\).:last.\\([a-z]*.[a-z]*\\)" 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)))
;; photo
(let ((photo (org-export-data (plist-get info :photo) info)))
(when (org-string-nw-p photo)