mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.11k stars 1.16k forks source link

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

Open dragonliuhu opened 1 month ago

dragonliuhu commented 1 month ago

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中使用

dpvc commented 1 month ago

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.