我正在使用 MathJax 尝试使用 .NET 和 DocFX 呈现方程。
此等式为浏览器中的\right错误提供缺失或无法识别的分隔符。
\(D_{text{mi}} = 1 - \frac{U_{c}}{U_{i}} = C_{t} - 0.05 - \lbrack \left( 16C_{t} - 0.5 \right) I_{\text{amb}}/1000\rbrack\)
但是,如果我在https://www.mathjax.org/#demo中运行它,那么它会正确预览。
这是我的脚本:
{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
<script type="text/javascript" src="{{_rel}}styles/docfx.vendor.js"></script>
<script type="text/javascript" src="{{_rel}}styles/docfx.js"></script>
<script type="text/javascript" src="{{_rel}}styles/main.js"></script>
<!-- configure MathJax object to define tex macros -->
<!-- Don't forget to escape \, since js also uses \ -->
<script>
MathJax = {
tex: {
packages: ['base'], // extensions to use
inlineMath: [ // start/end delimiter pairs for in-line math
['\\(', '\\)']
],
displayMath: [ // start/end delimiter pairs for display math
['$$', '$$'],
['\[', '\]'],
['\(', '}\)'],
['\(','\)'],
['\\[', '\\]'],
],
}
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>