-
-
Notifications
You must be signed in to change notification settings - Fork 898
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
数学公式支持 MathJax #89
Comments
同需要mathjax!想知道具体在哪个文档代码处能把katex配置改成mathjax配置 |
mathjax 从包大小,渲染速度、效果都不如 katex,这个需求会在 bug 修复的差不多后再支持。 |
@Vanessa219 可以考虑以扩展方式增加,即可以选择性引入或开启。 因为首先考虑能用,兼容性, 其次是渲染速度和包大小。 毕竟现在算力和流量不算贵。 说明下原因。 实际上大量用markdown替代富文本的普通用户群体, 一方面是程序员, 一方面就是对数学公式需求量大的用户。 而数学公式需求量大,就必须用markdown编辑器了。web的富文本主要是图文。 |
建议加入配置项,让用户能够选择所需的数学公式渲染引擎。 |
另外建议对mathjax的配置增加自定义宏(Macros)的支持。比如给一个输入框,可以输入mathjax的自定义macros,这样可以定义新命令。原因:mathjax可以满足大部分公式需求。但用到latex宏包的地方会无法使用,这种不满足的情形可以用macro的形式把latex宏包在mathjax上模拟出来。 以下为mathjax的配置项,Macros的部分是我对LaTeX精算宏包actuarialsymbol在mathjax中的模拟: <script type="text/x-mathjax-config">
MathJax.Hub.Config({
showProcessingMessages: false,
messageStyle: "none",
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
preview: 'none',
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
},
TeX: {
TagSide: "left",
Macros: {
actuarialangle: ['{\\mkern1mu\\overline\{#1\\,\}\\kern-3mu\\lower-1mu\\small|}',1],
angl: ['{\\actuarialangle\{#1\\mkern1mu\}}',1],
angln: '{\\angl n}',
anglk: '{\\angl k}',
anglr: '{\\angl r}',
term: ['{\\overset\{1\}\{#1\}:\\angl\{#2\}}',2],
termxn: '{\\term\{x\}\{n\}}',
pureendow: ['{#1:\\overset\{1\}\{\\angl\{#2\}\}}',2],
pureendowxn: '{\\pureendow\{x\}\{n\}}',
endow: ['{#1:\\angl\{#2\}}',2],
endowxn: '{\\endow\{x\}\{n\}}',
joint: ['{\\overline\{#1\}}',1],
actsymb: ['{\\sideset\{_\{#1\\mkern3mu\}^\{#2\\mkern3mu\}\}\{^\{#4\}_\{#5\}}\{#3\}}',5],
Ax: ['{\\actsymb\{#1\}\{#2\}\{A\}\{#3\}\{#4\}}',4],
Axz: ['{\\actsymb\{#1\}\{#2\}\{\\bar\{A\}\}\{#3\}\{#4\}}',4],
Axzz: ['{\\actsymb\{#1\}\{#2\}\{\\ddot\{A\}\}\{#3\}\{#4\}}',4],
ax: ['{\\actsymb\{#1\}\{#2\}\{a\}\{#3\}\{#4\}}',4],
axz: ['{\\actsymb\{#1\}\{#2\}\{\\bar\{a\}\}\{#3\}\{#4\}}',4],
axzz: ['{\\actsymb\{#1\}\{#2\}\{\\ddot\{a\}\}\{#3\}\{#4\}}',4],
Ex: ['{\\actsymb\{#1\}\{\}\{E\}\{\}\{#2\}}',2],
px: ['{\\actsymb\{#1\}\{\}\{p\}\{\}\{#2\}}',2],
qx: ['{\\actsymb\{#1\}\{\}\{q\}\{\}\{#2\}}',2],
sx: ['{\\actsymb\{\}\{\}\{s\}\{\}\{#1\}}',1],
sxz: ['{\\actsymb\{\}\{\}\{\\bar\{s\}\}\{\}\{#1\}}',1],
sxzz: ['{\\actsymb\{\}\{\}\{\\ddot\{s\}\}\{\}\{#1\}}',1],
Vx: ['{\\actsymb\{#1\}\{\}\{V\}\{\}\{#2\}}',2],
}
},
"HTML-CSS": {
availableFonts: ["MathJax TeX"],
preferredFonts: "MathJax TeX" }
});
</script>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script> 加载上述mathjax自定义宏后,输入精算符号时需要使用的代码及其效果可以看这个帖子: |
@AGJackie 谢谢反馈,等后续会研究一下。 |
@88250 谢谢! |
因为mathjax公式用的比较多。
比如下面的就用不了了。
The text was updated successfully, but these errors were encountered: