使用 MathJax 生成 Sigma 问题(1 次成功,1 次失败)
Issue Generating a Sigma using MathJax (1 success and 1 Fail)
所以我尝试使用类似于
的HTML代码生成一个小写的sigma
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>MathJax example</title>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML" async>
</script>
</head>
<body>
<p id="This_Is_What_I_Want"> $$ \sigma^2 $$</p>
<p id="Output"></p>
<p id="Activate"><button onclick="RUN()">Test This out</button></p>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML,http://myserver.com/MathJax/config/local/local.js">
function RUN() {
document.getElementById("Output").innerHTML = "$$ \sigma^2 $$";
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
</script>
</body>
第一个 sigma 加载正确,但当我按下按钮时,第二个 sigma 无法正确加载
为什么!
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>MathJax example</title>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML" async>
</script>
</head>
<body>
<p id="This_Is_What_I_Want"> $$ \sigma^2 $$</p>
<p id="Output"></p>
<p id="Activate"><button onclick="RUN()">Test This out</button></p>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML,http://myserver.com/MathJax/config/local/local.js">
function RUN() {
document.getElementById("Output").innerHTML = "$$ \sigma^2 $$";
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
</script>
</body>
显然我没有阅读文档中的说明,但默认情况下您需要两个 \ 而不是一个
所以我尝试使用类似于
的HTML代码生成一个小写的sigma<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>MathJax example</title>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML" async>
</script>
</head>
<body>
<p id="This_Is_What_I_Want"> $$ \sigma^2 $$</p>
<p id="Output"></p>
<p id="Activate"><button onclick="RUN()">Test This out</button></p>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML,http://myserver.com/MathJax/config/local/local.js">
function RUN() {
document.getElementById("Output").innerHTML = "$$ \sigma^2 $$";
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
</script>
</body>
第一个 sigma 加载正确,但当我按下按钮时,第二个 sigma 无法正确加载
为什么!
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>MathJax example</title>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML" async>
</script>
</head>
<body>
<p id="This_Is_What_I_Want"> $$ \sigma^2 $$</p>
<p id="Output"></p>
<p id="Activate"><button onclick="RUN()">Test This out</button></p>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML,http://myserver.com/MathJax/config/local/local.js">
function RUN() {
document.getElementById("Output").innerHTML = "$$ \sigma^2 $$";
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
</script>
</body>
显然我没有阅读文档中的说明,但默认情况下您需要两个 \ 而不是一个