Skip to content
New issue

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

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

Already on GitHub? # to your account

Use MathJax@beta with uniapp or vue(vue或者uniapp使用MathJax@4) #3263

Open
dragonliuhu opened this issue Jul 24, 2024 · 1 comment
Open
Labels

Comments

@dragonliuhu
Copy link

dragonliuhu commented Jul 24, 2024

In uniapp, I want to use MathJax@bata to display MathML, TeX, and ASCIImath.

I don't know how to import and setting config

Please show me a template, from how to import to use in view or DOM

At the same time, I need to edit the expression function

1、功能:需要在页面中展示MathML、TeX、ASCIImath;
2、问题:不知道引入怎么引入对应模块、配置文具,并且在vue中使用

@dragonliuhu dragonliuhu changed the title Use MathJax@beta with uniapp or vue Use MathJax@beta with uniapp or vue(vue或者uniapp使用MathJax@4) Jul 24, 2024
@dpvc
Copy link
Member

dpvc commented Jul 24, 2024

The documentation for MathJax has descriptions of how to include MstahJax in a web page. You might start at the Getting started with MathJax components section. There are examples of this in the examples section, and there are a number of examples illustrating the use of MathJax in web pages in the MathJax web demos repository.

These examples show how MathJax is used in a web page. For use in a javascript application, you might want to look at the MathJax node demos repository, as there are a number of different ways that can be done. These illustrate node applications, but the idea is the same for inclusion into an application that will run on the web. Because these repositories are for v3, they use require() rather than import, but you can rewrite the require() commands using import. For example

const {mathjax} = require('mathjax-full/js/mathjax.js');

would become

import {mathjax} from 'mathjax-full/js/mathjax.js';

On the other hand, rather than do the work yourself, you might consider using one of the Vue plugins for MathJax. There seem to be several of these:

There are probably other choices as well. I just Googled for it, and these came up. I don't know if they are any good, but you can try them out.

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

No branches or pull requests

2 participants