如何使用 Pandoc 将带有 mathjax 的 HTML 转换为 Latex? [英] How to convert HTML with mathjax into Latex using Pandoc?

查看:50
本文介绍了如何使用 Pandoc 将带有 mathjax 的 HTML 转换为 Latex?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些带有 MathJax 方程的 HTML 文档,我想将它们转换为 Latex,然后再转换为 pdf.我想使用 Pandoc.

I have some HTML documents with MathJax equations, and I want to convert them to Latex, and then to pdf. I'd like to use Pandoc.

但是,Pandoc 将 $ 替换为 $ 并将公式中的 替换为 extbackslash{}.

However, Pandoc replaces $ with $ and it replaces in formulas with extbackslash{}.

是否可以让 Pandoc 将 MathJax 公式从 HTML 直接传递到 Latex?

Is it possible to get Pandoc to pass MathJax formulas literally from HTML to Latex?

推荐答案

使用最新版本的pandoc(1.12.2),你可以这样做:

With the latest version of pandoc (1.12.2), you can do this:

pandoc -f html+tex_math_dollars+tex_math_single_backslash -t latex

好多了!如果您不想转换由 () 分隔的数学,只需执行

Much nicer! If you don't want to convert math delimited by ( and ), just do

pandoc -f html+tex_math_dollars -t latex

这篇关于如何使用 Pandoc 将带有 mathjax 的 HTML 转换为 Latex?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆