【发布时间】:2017-02-04 10:42:46
【问题描述】:
如何在带有上划线的 calci 按钮的输入文本框中显示平方根。例如,如果我们想显示一个字符串 80(√2345)68,其中平方根在 2345 处带有上划线(忽略大括号。)。请帮忙!!
【问题讨论】:
-
我认为您不能在输入字段中绘制完整的平方根。
标签: javascript css html button sqrt
如何在带有上划线的 calci 按钮的输入文本框中显示平方根。例如,如果我们想显示一个字符串 80(√2345)68,其中平方根在 2345 处带有上划线(忽略大括号。)。请帮忙!!
【问题讨论】:
标签: javascript css html button sqrt
您可以使用google charts infographic。
例如:
<img src="https://chart.googleapis.com/chart?cht=tx&chl=\sqrt(1234)%2Ba^2">
【讨论】:
我认为您需要使用引擎来呈现与数学相关的文本/公式。一个流行的是MathJax,查看他们的Documentation。
【讨论】:
MathJax 扩展:forminput mathjax-ext-contrib 具有 sample
下面是上面示例的代码
<!DOCTYPE html>
<html>
<head>
<title>Add \Input to MathJax</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["http://cs.jsu.edu/mathjax-ext/github/forminput/forminput.js"],
styles: {
".MathJax_Input": { "margin": "0 2px" },
".red_background": { "background-color": "#F88" }
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<p>
Here is an equation with form elements:
\(\FormInput{a}x+\FormInput[][red_background]{b}\).
</p>
<p>
Here is another:
\[
\int_{\FormInput[][][2]{lowlim}}^{\FormInput{highlim}} x^3\,dx =
\left.\frac{x^{\FormInput[2]{n}}}{\FormInput{m}}\right]_2^7
\]
</p>
</body>
</html>
编辑
匹配问题的表达方式
<!DOCTYPE html>
<html>
<head>
<title>Add \Input to MathJax</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["http://cs.jsu.edu/mathjax-ext/github/forminput/forminput.js"],
styles: {
".MathJax_Input": { "margin": "0 2px" },
".red_background": { "background-color": "#F88" }
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<p>
<b>square root in the input text box with overline</b> for 80(√2345)68
\[
\ 80\left(\sqrt{\FormInput[][][]{sqrt}}\right)68
\]
</p>
</body>
</html>
【讨论】: