0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:36:26 +00:00

ox-latex: Support svg images with unicode paths

* lisp/ox-latex.el (org-latex--inline-image): Testing with TeXLive 2022
finds that while \includegraphics is fine with unicode characters in the
file path, \includesvg needs \detokenize{...} to prevent errors.
This commit is contained in:
TEC 2022-07-25 21:58:04 +08:00
parent eb5622b7ad
commit 4504473779
Signed by: tec
GPG key ID: 779591AFDB81F06C

View file

@ -2765,7 +2765,12 @@ used as a communication channel."
((string-prefix-p "," options)
(format "[%s]" (substring options 1)))
(t (format "[%s]" options)))
path))
;; While \includegraphics is fine with unicode in the path,
;; \includesvg is prone to producing errors.
(if (and (string-match-p "[^[:ascii:]]" path)
(equal filetype "svg"))
(concat "\\detokenize{" path "}")
path)))
(when (equal filetype "svg")
(setq image-code (replace-regexp-in-string "^\\\\includegraphics"
"\\includesvg"