branch: externals/org
commit 8b900ae374390c68ebfc14fc4001d33ab951fd5c
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    ox-odt: Fix embedding LaTeX fragments as svg images
    
    * lisp/ox-odt.el (org-odt--translate-latex-fragments): Accept dvisvgm
    processing type.
    
    Reported-by: Jacob S. Gordon <jacob.as.gor...@gmail.com>
    Link: 
https://orgmode.org/list/be6e32d6-d537-4003-9a2f-2b908c730...@gmail.com
---
 lisp/ox-odt.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 4f6fac1cb6..8fb026247a 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -3789,10 +3789,14 @@ contextual information."
           (setq processing-type 'mathml)
          (setq warning "`org-odt-with-latex': LaTeX to MathML converter not 
available.  Falling back to verbatim.")
         (setq processing-type 'verbatim)))
-      ((dvipng imagemagick)
+      ((dvipng imagemagick dvisvgm)
        (unless (and (org-check-external-command "latex" "" t)
                    (org-check-external-command
-                    (if (eq processing-type 'dvipng) "dvipng" "convert") "" t))
+                     (cl-case processing-type
+                       (dvipng "dvipng")
+                       (dvisvgm "dvisvgm")
+                       (imagemagick "convert"))
+                    "" t))
         (setq warning "`org-odt-with-latex': LaTeX to PNG converter not 
available.  Falling back to verbatim.")
         (setq processing-type 'verbatim)))
       (verbatim) ;; nothing to do
@@ -3813,7 +3817,7 @@ contextual information."
     (message "Formatting LaTeX using %s" processing-type)
 
     ;; Convert `latex-fragment's and `latex-environment's.
-    (when (memq processing-type '(mathml dvipng imagemagick))
+    (when (memq processing-type '(mathml dvipng dvisvgm imagemagick))
       (org-element-map tree '(latex-fragment latex-environment)
        (lambda (latex-*)
          (cl-incf count)
@@ -3822,14 +3826,14 @@ contextual information."
                 (cache-dir (file-name-directory input-file))
                 (cache-subdir (concat
                                (cl-case processing-type
-                                 ((dvipng imagemagick)
+                                 ((dvipng dvisvgm imagemagick)
                                   org-preview-latex-image-directory)
                                  (mathml "ltxmathml/"))
                                (file-name-sans-extension
                                 (file-name-nondirectory input-file))))
                 (display-msg
                  (cl-case processing-type
-                   ((dvipng imagemagick)
+                   ((dvipng dvisvgm imagemagick)
                     (format "Creating LaTeX Image %d..." count))
                    (mathml (format "Creating MathML snippet %d..." count))))
                 ;; Get an Org-style link to PNG image or the MathML

Reply via email to