Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnkiDroid doesn't support wrapping each lines of display equations in <div> #92

Open
jody-frankowski opened this issue Jul 17, 2021 · 0 comments

Comments

@jody-frankowski
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant