fix(mu4e): minor errors with org-msg LaTeX eqns

A typo and a missing "*" break the creation and insertion of LaTeX
images.

Close #5416
This commit is contained in:
TEC 2021-10-02 16:01:34 +08:00
parent d13816ce3e
commit 090c7b9afa
No known key found for this signature in database
GPG key ID: 779591AFDB81F06C

View file

@ -39,9 +39,9 @@ clicked."
"For a given IMG-URI, use imagemagick to find its width." "For a given IMG-URI, use imagemagick to find its width."
(if +org-msg-currently-exporting (if +org-msg-currently-exporting
(when (and (not IS-WINDOWS)) ; relies on posix path (when (and (not IS-WINDOWS)) ; relies on posix path
(let ((with-call (and (executable-find "identify") (let ((width-call (and (executable-find "identify")
(doom-call-process "identify" "-format" "%w" (doom-call-process "identify" "-format" "%w"
(substring img-uri 7))))) ; 7=(length "file://") (substring img-uri 7))))) ; 7=(length "file://")
(unless width-call (unless width-call
(setq width-call (doom-call-process "file" (substring img-uri 7))) (setq width-call (doom-call-process "file" (substring img-uri 7)))
(setcdr width-call (replace-regexp-in-string "^.*image data, \\([0-9]+\\).*$" "\\1" (cdr width-call))) (setcdr width-call (replace-regexp-in-string "^.*image data, \\([0-9]+\\).*$" "\\1" (cdr width-call)))
@ -74,14 +74,14 @@ account for the value of :scale in `org-format-latex-options'."
(let ((formula-link (let ((formula-link
(org-html-format-latex latex-frag processing-type info))) (org-html-format-latex latex-frag processing-type info)))
(when (and formula-link (string-match "file:\\([^]]*\\)" formula-link)) (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
(let ((source (org-export-file-uri (match-string 1 formula-link))) (let* ((source (org-export-file-uri (match-string 1 formula-link)))
(attributes (append (list :alt latex-frag (attributes (append (list :alt latex-frag
:class :class
(concat "latex-fragment-" (concat "latex-fragment-"
(if (equal "\\(" (substring latex-frag 0 2)) (if (equal "\\(" (substring latex-frag 0 2))
"inline" "block"))) "inline" "block")))
(when (memq processing-type '(dvipng convert)) (when (memq processing-type '(dvipng convert))
(+org-msg-img-scale-css source))))) (+org-msg-img-scale-css source)))))
(org-html--format-image source attributes info))))) (org-html--format-image source attributes info)))))
(t latex-frag)))) (t latex-frag))))