nit(mu4e): correct indentation
This commit is contained in:
parent
090c7b9afa
commit
9e8e1d93ea
1 changed files with 63 additions and 63 deletions
|
@ -55,78 +55,78 @@ clicked."
|
||||||
(/ 1.0 (plist-get org-format-latex-options :scale))))))
|
(/ 1.0 (plist-get org-format-latex-options :scale))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-html-latex-fragment-scaled-a (latex-fragment _contents info)
|
(defun +org-html-latex-fragment-scaled-a (latex-fragment _contents info)
|
||||||
"Transcode a LATEX-FRAGMENT object from Org to HTML.
|
"Transcode a LATEX-FRAGMENT object from Org to HTML.
|
||||||
CONTENTS is nil. INFO is a plist holding contextual information.
|
CONTENTS is nil. INFO is a plist holding contextual information.
|
||||||
|
|
||||||
This differs from `org-html-latex-fragment' in that it uses the LaTeX fragment
|
This differs from `org-html-latex-fragment' in that it uses the LaTeX fragment
|
||||||
as a meaningful alt value, applies a class to indicate what sort of fragment it is
|
as a meaningful alt value, applies a class to indicate what sort of fragment it is
|
||||||
(latex-fragment-inline or latex-fragment-block), and (on Linux) scales the image to
|
(latex-fragment-inline or latex-fragment-block), and (on Linux) scales the image to
|
||||||
account for the value of :scale in `org-format-latex-options'."
|
account for the value of :scale in `org-format-latex-options'."
|
||||||
(let ((latex-frag (org-element-property :value latex-fragment))
|
(let ((latex-frag (org-element-property :value latex-fragment))
|
||||||
(processing-type (plist-get info :with-latex)))
|
(processing-type (plist-get info :with-latex)))
|
||||||
(cond
|
(cond
|
||||||
((memq processing-type '(t mathjax))
|
((memq processing-type '(t mathjax))
|
||||||
(org-html-format-latex latex-frag 'mathjax info))
|
(org-html-format-latex latex-frag 'mathjax info))
|
||||||
((eq processing-type 'html)
|
((eq processing-type 'html)
|
||||||
(org-html-format-latex latex-frag 'html info))
|
(org-html-format-latex latex-frag 'html info))
|
||||||
((assq processing-type org-preview-latex-process-alist)
|
((assq processing-type org-preview-latex-process-alist)
|
||||||
(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))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-html-latex-environment-scaled-a (latex-environment _contents info)
|
(defun +org-html-latex-environment-scaled-a (latex-environment _contents info)
|
||||||
"Transcode a LATEX-ENVIRONMENT element from Org to HTML.
|
"Transcode a LATEX-ENVIRONMENT element from Org to HTML.
|
||||||
CONTENTS is nil. INFO is a plist holding contextual information.
|
CONTENTS is nil. INFO is a plist holding contextual information.
|
||||||
|
|
||||||
This differs from `org-html-latex-environment' in that (on Linux) it
|
This differs from `org-html-latex-environment' in that (on Linux) it
|
||||||
scales the image to account for the value of :scale in `org-format-latex-options'."
|
scales the image to account for the value of :scale in `org-format-latex-options'."
|
||||||
(let ((processing-type (plist-get info :with-latex))
|
(let ((processing-type (plist-get info :with-latex))
|
||||||
(latex-frag (org-remove-indentation
|
(latex-frag (org-remove-indentation
|
||||||
(org-element-property :value latex-environment)))
|
(org-element-property :value latex-environment)))
|
||||||
(attributes (org-export-read-attribute :attr_html latex-environment))
|
(attributes (org-export-read-attribute :attr_html latex-environment))
|
||||||
(label (and (org-element-property :name latex-environment)
|
(label (and (org-element-property :name latex-environment)
|
||||||
(org-export-get-reference latex-environment info)))
|
(org-export-get-reference latex-environment info)))
|
||||||
(caption (and (org-html--latex-environment-numbered-p latex-environment)
|
(caption (and (org-html--latex-environment-numbered-p latex-environment)
|
||||||
(number-to-string
|
(number-to-string
|
||||||
(org-export-get-ordinal
|
(org-export-get-ordinal
|
||||||
latex-environment info nil
|
latex-environment info nil
|
||||||
(lambda (l _)
|
(lambda (l _)
|
||||||
(and (org-html--math-environment-p l)
|
(and (org-html--math-environment-p l)
|
||||||
(org-html--latex-environment-numbered-p l))))))))
|
(org-html--latex-environment-numbered-p l))))))))
|
||||||
(plist-put attributes :class "latex-environment")
|
(plist-put attributes :class "latex-environment")
|
||||||
(cond
|
(cond
|
||||||
((memq processing-type '(t mathjax))
|
((memq processing-type '(t mathjax))
|
||||||
(org-html-format-latex
|
(org-html-format-latex
|
||||||
(if (org-string-nw-p label)
|
(if (org-string-nw-p label)
|
||||||
(replace-regexp-in-string "\\`.*"
|
(replace-regexp-in-string "\\`.*"
|
||||||
(format "\\&\n\\\\label{%s}" label)
|
(format "\\&\n\\\\label{%s}" label)
|
||||||
latex-frag)
|
latex-frag)
|
||||||
latex-frag)
|
latex-frag)
|
||||||
'mathjax info))
|
'mathjax info))
|
||||||
((assq processing-type org-preview-latex-process-alist)
|
((assq processing-type org-preview-latex-process-alist)
|
||||||
(let ((formula-link
|
(let ((formula-link
|
||||||
(org-html-format-latex
|
(org-html-format-latex
|
||||||
(org-html--unlabel-latex-environment latex-frag)
|
(org-html--unlabel-latex-environment latex-frag)
|
||||||
processing-type info)))
|
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))))
|
||||||
(org-html--wrap-latex-environment
|
(org-html--wrap-latex-environment
|
||||||
(org-html--format-image source
|
(org-html--format-image source
|
||||||
(append attributes
|
(append attributes
|
||||||
(when (memq processing-type '(dvipng convert))
|
(when (memq processing-type '(dvipng convert))
|
||||||
(+org-msg-img-scale-css source)))
|
(+org-msg-img-scale-css source)))
|
||||||
info)
|
info)
|
||||||
info caption label)))))
|
info caption label)))))
|
||||||
(t (org-html--wrap-latex-environment latex-frag info caption label)))))
|
(t (org-html--wrap-latex-environment latex-frag info caption label)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue