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

How to use MathJax in Vue3+vite4 #3258

Closed
dragonliuhu opened this issue Jul 11, 2024 · 7 comments
Closed

How to use MathJax in Vue3+vite4 #3258

dragonliuhu opened this issue Jul 11, 2024 · 7 comments
Labels
Insufficient information You have not provided enough information to diagnose the problem.

Comments

@dragonliuhu
Copy link

require is not defined

@dpvc dpvc added the Insufficient information You have not provided enough information to diagnose the problem. label Jul 15, 2024
@dpvc
Copy link
Member

dpvc commented Jul 15, 2024

There is not enough information here about your situation to give you a meaningful answer. Please fill out the issue template that you were presented with when you opened the new issue; don't just delete it.

@dragonliuhu
Copy link
Author

I need the version for ES6.
I wanna use MathJax with ES6 and Vue3 or Vue2

@dragonliuhu
Copy link
Author

Is there an ES6 version

@dragonliuhu
Copy link
Author

There is not enough information here about your situation to give you a meaningful answer. Please fill out the issue template that you were presented with when you opened the new issue; don't just delete it.

When will ES6 be released?

@dpvc
Copy link
Member

dpvc commented Jul 23, 2024

I'm not sure why asking this three times here and once more in a separate issue is necessary.

MathJax v4 comes with both ES Modules (mjs) and CommonJS (cjs) formats. It is currently available in beta release, so that is one possibility for you.

Again, however, you have not provided sufficient information to really help you. Saying you are wanting to use MathJax with Vue3 or Vue2 is not enough information. What have you tried, and what is the result? MathJax can be included in a project in several different ways, and we can't tell which you are trying to use.

While the files in the MathJax v3 are CommonJS files, ES Modules can load CommonJS files. You are right that they can't include require() calls, so I'm assuming you re loading files from the mathjax-full/js, which do use require(). Note, however, that the combined components in mathjax/es5 or mathjax-full/es5 do not use require(), and so you should be able to import them into your Vue application. Have you tried that? (We don't know since you haven't given any real information about what you are doing.)

That is the best we can do until you provide some actual details.

@dragonliuhu
Copy link
Author

Sorry, I'm not very good at English.

Now, my project installed 'mathjax@beta', but I don't know how to import the MathJax.

I don't know which file to import so that I can use MathJax in es6 mode.

@dpvc
Copy link
Member

dpvc commented Jul 24, 2024

Closing this in favor of #3263.

@dpvc dpvc closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Insufficient information You have not provided enough information to diagnose the problem.
Projects
None yet
Development

No branches or pull requests

2 participants