emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 10139c8 1/3: org.el (org-create-formula-image): Fix


From: ELPA Syncer
Subject: [elpa] externals/org 10139c8 1/3: org.el (org-create-formula-image): Fix ignored background color
Date: Thu, 30 Sep 2021 00:57:18 -0400 (EDT)

branch: externals/org
commit 10139c86bc81cc486af04771ea4f0eda9c2629e9
Author: Sébastien Miquel <sebastien.miquel@posteo.eu>
Commit: Bastien <bzg@gnu.org>

    org.el (org-create-formula-image): Fix ignored background color
    
    * lisp/org.el (org-preview-latex-process-alist): add a
    `:transparent-image-converter' property for `dvipng'.
    (org-create-formula-image): If available, use
    `:transparent-image-converter' when no background color is set.
---
 lisp/org.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 405f0f0..dccc6fb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3324,7 +3324,9 @@ All available processes and theirs documents can be found 
in
      :image-output-type "png"
      :image-size-adjust (1.0 . 1.0)
      :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
-     :image-converter ("dvipng -D %D -T tight -bg Transparent -o %O %f"))
+     :image-converter ("dvipng -D %D -T tight -o %O %f")
+     :transparent-image-converter
+     ("dvipng -D %D -T tight -bg Transparent -o %O %f"))
     (dvisvgm
      :programs ("latex" "dvisvgm")
      :description "dvi > svg"
@@ -3379,6 +3381,9 @@ PROPERTIES accepts the following attributes:
                       given to the shell and supports any of the following
                       place-holders defined below.
 
+If set, :transparent-image-converter is used instead of :image-converter to
+convert an image when the background color is nil or \"Transparent\".
+
 Place-holders used by `:image-converter' and `:latex-compiler':
 
   %f    input file name
@@ -16303,7 +16308,6 @@ a HTML file."
               org-format-latex-header
               'snippet)))
         (latex-compiler (plist-get processing-info :latex-compiler))
-        (image-converter (plist-get processing-info :image-converter))
         (tmpdir temporary-file-directory)
         (texfilebase (make-temp-name
                       (expand-file-name "orgtex" tmpdir)))
@@ -16317,7 +16321,11 @@ a HTML file."
                 "Black"))
         (bg (or (plist-get options (if buffer :background :html-background))
                 "Transparent"))
-        (log-buf (get-buffer-create "*Org Preview LaTeX Output*"))
+        (image-converter
+          (or (and (string= bg "Transparent")
+                   (plist-get processing-info :transparent-image-converter))
+              (plist-get processing-info :image-converter)))
+         (log-buf (get-buffer-create "*Org Preview LaTeX Output*"))
         (resize-mini-windows nil)) ;Fix Emacs flicker when creating image.
     (dolist (program programs)
       (org-check-external-command program error-message))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]