enter image description here我想在我的表单中显示数学符号,是否有脚本这样做?
//一些代码喜欢这个图片
[数学符号] [2] enter image description here
答案 0 :(得分:2)
您的符号仅限于纯HTML,有些是:
<p>I will display ∑</p>
<p>I will display −</p>
<p>I will display ×</p>
<p>I will display √</p>
<p>I will display ∫</p>
<a href="https://www.w3schools.com/charsets/ref_utf_math.asp">SOURCE</a>
&#13;
如果您认真,请考虑使用此库(它有启动文档):
文档位于:
http://docs.mathjax.org/en/latest/start.html
你可以这样做(使用mathjax):
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
然后输入如下的数学字符串:
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}.$$
他们的一个例子是:
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<div>
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}.$$
</div>
&#13;
(对不起,我看不到你发布的图片,它不会加载)
无论如何,希望这有帮助!