如何在markdown中的扰流块中添加数学表达式

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

我想在剧透块中包含数学表达式,实际上是 github 存储库的 markdown 中的

details/summary
块。当我尝试在块中使用
$$
来使用数学语法时,数学表达式无法正确显示。

示例代码:

<details> 
  <summary>a)</summary>
$$
    \omega = \sqrt{\frac{4 m g h}{M_{1} R^{2}}}
$$
^ this is not displayed nicely
</details>


$$
    \omega = \sqrt{\frac{4 m g h}{M_{1} R^{2}}}
$$
^ this is displayed nicely
github math markdown mathjax github-flavored-markdown
1个回答
1
投票

在 HTML 和 MathJax 标记之间添加一个空行。

<details> 
  <summary>a)</summary>
  
$$
    \omega = \sqrt{\frac{4 m g h}{M_{1} R^{2}}}
$$
</details>


$$
    \omega = \sqrt{\frac{4 m g h}{M_{1} R^{2}}}
$$

示范

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