在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):MakerGYT/markdown-it-latex2img开源软件地址(OpenSource Url):https://github.com/MakerGYT/markdown-it-latex2img开源编程语言(OpenSource Language):JavaScript 88.0%开源软件介绍(OpenSource Introduction):Markdown-it-latex2img
BackgroundRelated
Demand
Feature
SampleScreenshot:InstallNode.js:npm install markdown-it-latex2img --save Browser (CDN):UsageNode.jsconst md = require('markdown-it')()
.use(require('markdown-it-latex2img'));
md.render(`$\\frac {a+1}{b+2}$`) //JavaScript strings require double backslashes, but HTML input and reading files are not required BrowserDifferences in browser. If you load script directly into the page, without package system, module will add itself globally as <script src="https://cdn.jsdelivr.net/npm/markdown-it-latex2img@latest/dist/markdown-it-latex2img.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/markdown-it.min.js" crossorigin="anonymous"></script>
<script>
var md = window.markdownit();
md.use(window.markdownitLatex2img);
</script> Hexo
npm i hexo-renderer-markdown-it --save
npm i markdown-it-latex2img --save
# _config.yml
markdown:
plugins:
- markdown-it-latex2img Default will load mathjax plugin EVERY PAGE during rendering,Does not reduce page speed after generated.Later will support on-demand rendering to improve rendering speed Options(optional)
If you want to customize options in hexo,please do as follows: # _config.yml
markdown:
plugins:
- name: markdown-it-latex2img
options:
style: 'filter: opacity(90%);transform:scale(0.85);text-align:center;' ConventionMarkup is based on pandoc definition. Mathjax pointed out
However,most still use # inline
$\frac {a+1}{b+2}$ # The opening $ must have a non-space character immediately to its right, while the closing $ must have a non-space character immediately to its left, and must not be followed immediately by a digit. # block
$$
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (2)
}
$$ DependenciesCaseLicenseMIT © MakerGYT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论