Skip to content

Commit 4504473

Browse files
committed
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.
1 parent eb5622b commit 4504473

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lisp/ox-latex.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2765,7 +2765,12 @@ used as a communication channel."
27652765
((string-prefix-p "," options)
27662766
(format "[%s]" (substring options 1)))
27672767
(t (format "[%s]" options)))
2768-
path))
2768+
;; While \includegraphics is fine with unicode in the path,
2769+
;; \includesvg is prone to producing errors.
2770+
(if (and (string-match-p "[^[:ascii:]]" path)
2771+
(equal filetype "svg"))
2772+
(concat "\\detokenize{" path "}")
2773+
path)))
27692774
(when (equal filetype "svg")
27702775
(setq image-code (replace-regexp-in-string "^\\\\includegraphics"
27712776
"\\includesvg"

0 commit comments

Comments
 (0)