forked from mirrors/org-mode
org-latex-preview: Split org-format-latex into two
* lisp/org-latex-preview.el (org-create-latex-preview, org-format-latex): Split `org-format-latex' into two, creating a new function for the `cond' branch that deals with `org-preview-latex-process-alist'.
This commit is contained in:
parent
c591dda62a
commit
ae09ab8ebe
|
@ -429,6 +429,26 @@ Some of the options can be changed using the variable
|
|||
((assq processing-type org-preview-latex-process-alist)
|
||||
;; Process to an image.
|
||||
(cl-incf cnt)
|
||||
(org-create-latex-preview
|
||||
prefix beg end dir overlays msg forbuffer processing-type
|
||||
value cnt block-type checkdir-flag))
|
||||
((eq processing-type 'mathml)
|
||||
;; Process to MathML.
|
||||
(unless (org-format-latex-mathml-available-p)
|
||||
(user-error "LaTeX to MathML converter not configured"))
|
||||
(cl-incf cnt)
|
||||
(when msg (message msg cnt))
|
||||
(goto-char beg)
|
||||
(delete-region beg end)
|
||||
(insert (org-format-latex-as-mathml
|
||||
value block-type prefix dir)))
|
||||
(t
|
||||
(error "Unknown conversion process %s for LaTeX fragments"
|
||||
processing-type)))))))))))
|
||||
|
||||
(defun org-create-latex-preview (prefix beg end dir overlays msg forbuffer processing-type
|
||||
value cnt block-type checkdir-flag)
|
||||
"The `org-preview-latex-process-alist' branch of `org-format-latex'."
|
||||
(goto-char beg)
|
||||
(let* ((processing-info
|
||||
(cdr (assq processing-type org-preview-latex-process-alist)))
|
||||
|
@ -481,20 +501,8 @@ Some of the options can be changed using the variable
|
|||
(unless (file-exists-p movefile)
|
||||
(org-create-formula-image
|
||||
value movefile options forbuffer processing-type))
|
||||
(org-place-formula-image link block-type beg end value overlays movefile imagetype)))
|
||||
((eq processing-type 'mathml)
|
||||
;; Process to MathML.
|
||||
(unless (org-format-latex-mathml-available-p)
|
||||
(user-error "LaTeX to MathML converter not configured"))
|
||||
(cl-incf cnt)
|
||||
(when msg (message msg cnt))
|
||||
(goto-char beg)
|
||||
(delete-region beg end)
|
||||
(insert (org-format-latex-as-mathml
|
||||
value block-type prefix dir)))
|
||||
(t
|
||||
(error "Unknown conversion process %s for LaTeX fragments"
|
||||
processing-type)))))))))))
|
||||
(org-place-formula-image
|
||||
link block-type beg end value overlays movefile imagetype)))
|
||||
|
||||
(defun org-place-formula-image (link block-type beg end value overlays movefile imagetype)
|
||||
"Place an overlay from BEG to END showing MOVEFILE.
|
||||
|
|
Loading…
Reference in New Issue