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

Unknown environment 'matrix' #3290

Open
quanzhongxian opened this issue Sep 26, 2024 · 1 comment
Open

Unknown environment 'matrix' #3290

quanzhongxian opened this issue Sep 26, 2024 · 1 comment
Labels
Expected Behavior This is how MathJax works v3

Comments

@quanzhongxian
Copy link

image
image

@dpvc
Copy link
Member

dpvc commented Sep 30, 2024

Because you are loading MathJax modules directly rather than using MathJax Components, you have to load all the needed modules yourself by hand. In particular, you need to load the ams package code using

import 'mathjax-full/js/input/ams/AmsConfiguration.js';

Similarly, load any other packages you may need. Listing it in the tex.packages array is not enough to cause it to be loaded. The matrix environment is part of the ams package, which is why you are getting the message about it being undefined.

Note that you don't have to create and register the adaptor each time renderMathToImg() is called (in fact, you should not re-register the adaptor each time). These can be global values that renderMathToImg() re-uses each time.

You haven't said which version of MathJax you are using, but 4.0.0-beta.7 includes an option in the "Show Math As" menu for generating an SVG image (if the SVG output is selected), so perhaps you can take advantage of that.

@dpvc dpvc added Expected Behavior This is how MathJax works v3 labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expected Behavior This is how MathJax works v3
Projects
None yet
Development

No branches or pull requests

2 participants