mathjax的cdn
时间: 2023-09-14 17:11:08 浏览: 198
MathJax 的 CDN 可以通过以下方式获取:
- https://cdn.mathjax.org/mathjax/latest/MathJax.js
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js
这两个地址分别是 MathJax 官方的 CDN 和 Cloudflare 的 CDN,可以根据自己的需求选择使用。
相关问题
如何引入MathJax
要在网页中引入MathJax,可以按照以下步骤操作:
1. 在网页的`<head>`标签中添加MathJax的引用:
```html
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
```
2. 在需要使用数学公式的地方,使用`<span>`或`<div>`标签包裹公式,并添加`class="tex2jax"`属性:
```html
<div class="tex2jax">$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$</div>
```
3. 在页面加载完成后,调用MathJax的渲染函数,将LaTeX公式渲染成数学符号:
```javascript
window.addEventListener("load", function() {
MathJax.typesetPromise();
});
```
需要注意的是,MathJax的渲染函数只有在页面加载完成后才能调用,否则无法正常渲染数学公式。
pycharm中安装MathJax
MathJax是一个JavaScript引擎,可以在网页上渲染数学公式,而PyCharm不支持直接安装MathJax。但是,如果你想在PyCharm的markdown文件中显示MathJax公式,可以通过以下步骤实现:
1.在PyCharm中安装markdown插件。在PyCharm中选择File -> Settings -> Plugins,在插件列表中搜索markdown,然后安装并启用它。
2.在markdown文件中添加MathJax引用。在markdown文件的头部添加以下代码:
```html
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
```
这将从MathJax的CDN加载MathJax引擎。
3.在markdown文件中使用MathJax语法。在markdown文件中,使用MathJax语法来编写数学公式。例如:
```latex
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
```
这将显示一个高斯分布的公式。
4.在PyCharm中预览markdown文件。在PyCharm中,打开markdown文件并按下Ctrl + Shift + P,选择“Markdown Preview”以预览文件。如果一切正常,你应该能够在预览窗口中看到MathJax公式的渲染结果。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)