anki-editor
anki-editor copied to clipboard
AnkiDroid doesn't support wrapping each lines of display equations in <div>
I have replaced anki-editor--ox-latex-for-mathjax
with this version, and I have had no issues on Anki desktop and AnkiDroid.
(defun anki-editor--ox-latex-for-mathjax (latex _contents _info)
"Transcode LATEX from Org to HTML.
CONTENTS is nil. INFO is a plist holding contextual information."
(message "HELLO")
(let ((code (org-remove-indentation (org-element-property :value latex))))
(setq code
(pcase (org-element-type latex)
('latex-fragment (anki-editor--translate-latex-delimiters-to-anki-mathjax-delimiters code))
('latex-environment (anki-editor--wrap-latex-for-mathjax (org-html-encode-plain-text code)))))
(if anki-editor-break-consecutive-braces-in-latex
(replace-regexp-in-string "}}" "} } " code)
code)))
Please note that I used this pull request to make the display equations (latex-environments) work.