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

Browser preview does not use MathJax preamble in card template #3799

Open
JeppeKlitgaard opened this issue Feb 7, 2025 · 3 comments
Open

Comments

@JeppeKlitgaard
Copy link

I have a MathJax preamble defined in my front and back card templates. This is respected in some places (views/previews), but not in others (editors).

Image

Image

I would have expected and liked for the WYSIWYG editor to also include these, though I understand that the MathJax instance used here does not have access to the context of the card.

Would there be a good workaround available?

@abdnh
Copy link
Collaborator

abdnh commented Feb 9, 2025

I don't think there's a simple workaround. Maybe this should be customizable from the Note Types screen like it's done for LaTeX.

Image

@JeppeKlitgaard
Copy link
Author

I think that would be a great solution and definitely something I would love to see. This would serve much the same use-case as the existing Latex preamble

@JeppeKlitgaard
Copy link
Author

I have been working a bit on this and discovered a few dumps in the road that might require the input of someone more knowledgeable and opinionated than myself.

Currently the MathJax object is stored as a global singleton, which is nice for memory purposes, but slightly problematic in that it can be mutated using macros like \newcommand{}, which could lead to clashes between notes/notetypes. See: mathjax/MathJax#3275

Even as is, the state will 'bleed' from one note to the other in the browser and during a study session.

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

2 participants