当前位置:网站首页>mathjax 入门(web显示数学公式,矢量的)
mathjax 入门(web显示数学公式,矢量的)
2022-07-02 11:23:00 【徐同保】
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>MathJax Font</title>
<!-- <script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML"></script> -->
<!-- <script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-mml-chtml.js"
></script> -->
<script
id="MathJax-script"
src="./mathjax/es5/tex-mml-chtml.js"
></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS" : {
availableFonts : ["STIX"],
preferredFont : "STIX",
webFont : "STIX-Web",
imageFont : null
}
});
</script>
</head>
<body>
<p>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and
they are \[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]
</p>
<p>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and
they are \[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]
</p>
</body>
</html>
在vue中数据变化后需要重新渲染一下才能更改公式:
clearTimeout(timer);
timer = setTimeout(() => {
this.$nextTick(() => {
window.MathJax.typeset();
});
}, 500);
https://jsbin.com/vujogafize/edit?html,output
https://www.osgeo.cn/mathjax/basic/accessibility.html
自制mathjax在线编辑器。
<template>
<div>
<div>mathValue:</div>
<p v-html="mathValue"></p>
<el-input
:value="mathValue"
type="textarea"
@input="handleMathValue"
></el-input>
</div>
</template>
<script>
import { MathfieldElement } from "mathlive";
let mf;
export default {
data() {
return {
mathValue: "\\( x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a} \\)",
};
},
mounted() {
this.formatMath();
},
methods: {
formatMath() {
window.MathJax.typeset();
},
handleMathValue(e) {
this.mathValue = e;
this.$nextTick(() => {
this.formatMath();
});
},
},
};
</script>
<style></style>
富文本里也可以:
在线编辑器:
边栏推荐
- Fabric. Usage of JS eraser (including recovery function)
- 求轮廓最大内接圆
- NLA natural language analysis makes data analysis more intelligent
- Why can't browsers read JSX?
- [apipost] tutorial
- Simple verification code generator for 51 single chip microcomputer experiment
- < schéma de développement de la machine d'exercice oral > machine d'exercice oral / trésor d'exercice oral / trésor de mathématiques pour enfants / lecteur LCD de calculatrice pour enfants IC - vk1621
- Method of creating linked server for cross server data access
- freemarker的使用
- PTA题库 ===>复数四则运算,一帮一,考试座位号(7-73)
猜你喜欢
博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”
Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people
There is no solution to the decryption error of the remote user 'sa' and the service master password mapped from the remote server 'to the local user' (null) /sa '
关于Flink框架窗口(window)函数最全解析
Design and implementation of car query system based on php+mysql
Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
Tencent cloud tstor unified storage passed the evaluation of the first batch of basic file storage capabilities of the ICT Institute
buuctf-pwn write-ups (7)
STM32库函数进行GPIO初始化
buuctf-pwn write-ups (7)
随机推荐
富文本编辑器添加矢量公式(MathType for TinyMCE ,可视化添加)
Packet capturing tool Fiddler learning
天猫商品详情接口(APP,H5端)
Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
NLA自然语言分析实现数据分析零门槛
Quick analysis: easy to share the Internet
【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境
Pychart connects to the remote server
<口算練習機 方案開發原理圖>口算練習機/口算寶/兒童數學寶/兒童計算器 LCD液晶顯示驅動IC-VK1621B,提供技術支持
A white hole formed by antineutrons produced by particle accelerators
复用和分用
How many knowledge points can a callable interface have?
关于Flink框架窗口(window)函数最全解析
taobao.trade.get( 获取单笔交易的部分信息),淘宝店铺订单接口,淘宝oAuth2.0接口,淘宝R2接口代码对接分享
freemarker的使用
Fabric. Keep the original level when JS element is selected
OpenCV调用USB摄像头的点滴
[development environment] Dell computer system reinstallation (download Dell OS recovery tool | use Dell OS recovery tool to make USB flash disk system | install system)
检查密码
OpenHarmony笔记-----------(四)