mathjax3-vue

0.0.18 • Public • Published

mathjax3-vue

  • This plugins implements the browser version of Mathjax v3 into vue.

  • Support vue2 and vue3

  • Click to view online example:online example

online

electron-vite-react-debug.gif

Install

yarn add mathjax3-vue

Use vue2

1.main.js config of MathJax3

import YyMathjax from 'mathjax3-vue'
const config={
    tex: {
        inlineMath: [['$', '$']],
        processEscapes: true
    }
}
Vue.use(YyMathjax,config)

2. App.vue

<template>
  <div>
    <yy-mathjax :latex="latexStr"></yy-mathjax>
    <div>input:abc$\frac{2}{3}$def</div>
    <textarea type='textarea' v-model='latexStr'/>
  </div>
</template>

<script>
export default {
  name: "App",
  components: {
  },
  data(){
    return {
      latexStr:""
    }
  }
};
</script>

<style>
</style>

Use vue3

1.main.js config of MathJax3

import { createApp } from 'vue'
import App from './App.vue'

import YyMathjax from 'mathjax3-vue'
const config={
    tex: {
        inlineMath: [['$', '$']],
        processEscapes: true
    }
}

createApp(App).use(YyMathjax,config).mount('#app')

2. App.vue

<template>
    <yy-mathjax :latex="latexStr"></yy-mathjax>
    <div>input:abc$\frac{2}{3}$def</div>
    <textarea type='textarea' v-model='latexStr'/>
</template>

<script>
export default {
  name: "App",
  components: {
  },
  data(){
    return {
      latexStr:""
    }
  }
};
</script>

<style>
</style>

Package Sidebar

Install

npm i mathjax3-vue

Weekly Downloads

4

Version

0.0.18

License

ISC

Unpacked Size

6.14 kB

Total Files

6

Last publish

Collaborators

  • yuyang0760