gpt4 book ai didi

latex - MD with Latex to HTML with MathJax with Pandoc

转载 作者:行者123 更新时间:2023-12-03 13:46:26 24 4
gpt4 key购买 nike

有点类似 How to convert HTML with mathjax into latex using pandoc?但在某种意义上,恰恰相反。

如果我使用 Pandoc 来创建带有 LaTeX 的 MD 文件,甚至只是 MD 文件,我如何使用 Pandoc 将这些文件转换为 HTML 并使用正确的 \(\) , \[\]数学标签?

最佳答案

以下讨论here ,我可以转换 test.md (包含 LaTeX 代码)到 test.html成功地。

pandoc --toc --standalone --mathjax -f markdown -t html test.md -o test.html
--mathjax 上的文档可以找到 here :

Use MathJax to display embedded TeX math in HTML output. TeX math will be put between (...) (for inline math) or [...] (for display math) and wrapped in tags with class math. Then the MathJax JavaScript will render it. The URL should point to the MathJax.js load script. If a URL is not provided, a link to the Cloudflare CDN will be inserted.



选项 --standalone很重要,没有它就无法正确呈现 LaTeX 代码。

附注。包裹内联方程,如 $INLINE EQUATION$并包装显示方程,如 $$DISPLAY EQUATION$$ .

关于latex - MD with Latex to HTML with MathJax with Pandoc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37533412/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com