LaTeX公式嵌套

问题描述 投票:1回答:1

我使用存储数学公式,并使用在网页中呈现数学公式。

<script type="text/javascript" src="http://cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {inlineMath: [['$', '$']]},
        messageStyle: "none"
    });
</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}.$$

我从其他网站抓取了一些数学公式,他们不使用LaTeX。例如x<sup>2</sup>并且是一个公式的一部分,我尝试将x<sup>2</sup>保存在LaTeX公式中,但是LaTeX公式不支持它。

    <script type="text/javascript" src="http://cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">
        MathJax.Hub.Config({
            tex2jax: {inlineMath: [['$', '$']]},
            messageStyle: "none"
        });
    </script>
    $$x = {-b \pm \sqrt{b<sup>2</sup>-4ac} \over 2a}.$$

我也尝试过嵌套公式,但它也不起作用。

        <script type="text/javascript" src="http://cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
        <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                tex2jax: {inlineMath: [['$', '$']]},
                messageStyle: "none"
            });
        </script>
        $$x = {-b \pm \sqrt{$$b^2$$-4ac} \over 2a}.$$

那么如何在LaTeX中嵌套数学公式?

javascript html math formula mathjax
1个回答
0
投票
您不能以这种方式嵌套公式。而且,您无法混合用于LaTeX代码格式化的HTML标签。只需使用LaTeX语法即可。

如果您不了解某些方程式或构造的正确LaTeX语法,请在https://tex.stackexchange.com/处提问。

© www.soinside.com 2019 - 2024. All rights reserved.