如何让mathjax里面的inline math不换行?

使用2.7版本的mathjax,inlineMath可以很好的显示,全部显示在一行。

   <!DOCTYPE html>
   <html>
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width">
   <script type="text/javascript" async
     src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML">
   </script>
   <script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
   });
   </script>
   </head>
   <body>
   First of all, we can "relax" the $\forall$-Introduction rule (page 31): $A \to B \vdash A \to \forall x B$, provided that $x$ is not *free* in $A$.
   </body>
   </html>

image.png

现在,我做了个版本升级,并且将mathjax部署在本地。
git clone https://github.com/mathjax/MathJax.git mathjax
然后将mathjax目录全部复制到本地的apache根目录中。

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <script type="text/javascript">
    MathJax = {
      tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']]
      }
    };
    </script>
<script type="text/javascript"
  src="http://127.0.0.1/mathjax/es5/tex-chtml.js?config=TeX-MML-AM_CHTML">
</script>
</head>
<body>
First of all, we can "relax" the $\forall$-Introduction rule : $A \to B \vdash A \to \forall x B$, provided that $x$ is not *free* in $A$.
</body>
</html>

再用浏览器打开

image.png

不能一行显示了!
请问,如何解决?
反复测试过,下载2.7.7,2.7.9版本的mathjax到本地,全部都一行显示。
3.2.0,3.2.1.3.2.2的版本,都有这个问题,如何解决呢?

阅读 1k
1 个回答
✓ 已被采纳

我用 master 分支应该是 3.2.2 测试了是正常的:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <script type="text/javascript">
    MathJax = {
      tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']]
      }
    };
    </script>
<script type="text/javascript"
  src="./es5/tex-chtml.js?config=TeX-MML-AM_CHTML">
</script>
<style>
.it {
    display: inline-block;
    font-style: italic;
}
</style>
</head>
<body>
    First of all, we can "relax" the $\forall$-Introduction rule : $A \to B \vdash A \to \forall x B$, provided that $x$ is not <div class="it">free</div> in $A$.
<p>$\displaystyle \begin{aligned}
\dot{\mathscr{E}}  &=  \sum_{\Gamma} \left[\,f(\underset{\Gamma}{\lambda}) \underset{\Gamma}{\vec{N}} \underset{\Gamma}{\vec{N}}\,\right]^{\bullet} \\
&=  \sum_{\Gamma} \left[\,f'(\underset{\Gamma}{\lambda}) \dot{\underset{\Gamma}{\lambda}} \underset{\Gamma}{\vec{N}} \underset{\Gamma}{\vec{N}}  +  f(\underset{\Gamma}{\lambda}) \dot{\underset{\Gamma}{\vec{N}}} \underset{\Gamma}{\vec{N}}  +  f(\underset{\Gamma}{\lambda}) \underset{\Gamma}{\vec{N}} \dot{\underset{\Gamma}{\vec{N}}}\,\right] \\
&=  \sum_{\Gamma} \left[\,f'(\underset{\Gamma}{\lambda}) \dot{\underset{\Gamma}{\lambda}} \underset{\Gamma}{\vec{N}} \underset{\Gamma}{\vec{N}}  +  f(\underset{\Gamma}{\lambda}) \underset{IJ}{\vec{\Omega}}\underset{I}{\vec{N}}\underset{J}{\vec{N}} \underset{\Gamma}{\vec{N}}  +  f(\underset{\Gamma}{\lambda}) \underset{\Gamma}{\vec{N}} \underset{IJ}{\vec{\Omega}}\underset{I}{\vec{N}}\underset{J}{\vec{N}}\,\right] \\
&=  \sum_{\Gamma} \left[\,f'(\underset{\Gamma}{\lambda}) \dot{\underset{\Gamma}{\lambda}} \underset{\Gamma}{\vec{N}} \underset{\Gamma}{\vec{N}}  +  f(\underset{\Gamma}{\lambda}) \underset{I\Gamma}{\vec{\Omega}}\underset{I}{\vec{N}}\underset{\Gamma}{\vec{N}}  +  f(\underset{\Gamma}{\lambda}) \underset{J\Gamma}{\vec{\Omega}}\underset{\Gamma}{\vec{N}}\underset{J}{\vec{N}}\,\right] \\
\end{aligned}$</p>

<font color="red">
    <p>$\dot{\vec{E}}  =  \vec{F}^T \cdot \vec{d} \cdot \vec{F}$</p> 阿巴阿巴阿巴
</font>
</body>
</html>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏