Apply string-trim to LaTeX font collections

This commit is contained in:
TEC 2024-03-09 00:20:47 +08:00
parent 2e8695eb20
commit e1de90f095
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 13 additions and 12 deletions

View File

@ -11531,18 +11531,19 @@ the cars in `org-latex-fontsets'."
(let* ((fontset-spec (org-latex-fontset-entry)) (let* ((fontset-spec (org-latex-fontset-entry))
(fontset (alist-get (car fontset-spec) org-latex-fontsets))) (fontset (alist-get (car fontset-spec) org-latex-fontsets)))
(if fontset (if fontset
(concat (string-trim
(mapconcat (concat
(lambda (style) (mapconcat
(when (plist-get fontset style) (lambda (style)
(concat (plist-get fontset style) "\n"))) (when (plist-get fontset style)
desired-styles (concat (plist-get fontset style) "\n")))
"") desired-styles
(when (memq (cdr fontset-spec) desired-styles) "")
(pcase (cdr fontset-spec) (when (memq (cdr fontset-spec) desired-styles)
(:serif "\\renewcommand{\\familydefault}{\\rmdefault}\n") (pcase (cdr fontset-spec)
(:sans "\\renewcommand{\\familydefault}{\\sfdefault}\n") (:serif "\\renewcommand{\\familydefault}{\\rmdefault}\n")
(:mono "\\renewcommand{\\familydefault}{\\ttdefault}\n")))) (:sans "\\renewcommand{\\familydefault}{\\sfdefault}\n")
(:mono "\\renewcommand{\\familydefault}{\\ttdefault}\n")))))
(error "Font-set %s is not provided in org-latex-fontsets" (car fontset-spec))))) (error "Font-set %s is not provided in org-latex-fontsets" (car fontset-spec)))))
#+end_src #+end_src