开源软件名称(OpenSource Name):mitya57/python-markdown-math开源软件地址(OpenSource Url):https://github.com/mitya57/python-markdown-math开源编程语言(OpenSource Language):Python 80.8%开源软件介绍(OpenSource Introduction):Math extension for Python-MarkdownThis extension adds math formulas support to Python-Markdown. InstallationInstall from PyPI
Install locallyUse The extension name is UsageTo use this extension, you need to include MathJax library in HTML files, like: <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js">
</script> Also, you need to specify a configuration for MathJax. Please note that
most of standard configurations include Example of configuration for MathJax 2.x: <script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"]
});
</script> If you want to use MathJax 3.x, you need to teach it to understand 2.x-style
To pass the extension to Python-Markdown, use >>> md = markdown.Markdown(extensions=['mdx_math'])
>>> md.convert('$$e^x$$')
'<p>\n<script type="math/tex; mode=display">e^x</script>\n</p>' Usage from the command line:
Math DelimitersFor inline math, use For standalone math, use The single-dollar delimiter ( If you want to use GitLab-style delimiters ( If you want to this extension to generate a preview node (which will be shown
when MathJax has not yet processed the node, or when JavaScript is unavailable),
use NotesIf you use ReText, this extension is not needed as it is included by default. This extension also works with Katex. Use the following in your page <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex/dist/contrib/mathtex-script-type.min.js" defer></script> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论