我尝试使用Pandoc将html转换为docx:
这是我的html代码:
<p> Example: ${v_1} = {\rm{ }}{v_2}$</p>
MathJax配置位于头部:
MathJax.Hub.Config({ extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"], jax: ["input/TeX", "output/HTML-CSS"], tex2jax: { inlineMath: [['$', '$'], ["\(", "\)"]], displayMath: [['$$', '$$'], ["\[", "\]"]], }, "HTML-CSS": {availableFonts: ["TeX"]} });
我使用的Panoc命令(Pandoc版本2.2.3.2):
pandoc -s test.html --mathjax -f html+tex_math_dollars --pdf-engine=xelatex -o xxx.docx
然后我得到警告:
[WARNING] Could not convert TeX math '{v_1} = {\rm{ }}{v_2}', rendering as TeX: {v_1} = {\rm{ }}{v_2} ^ unexpected "{" expecting "%", "\\label", "\\nonumber" or whitespace
请告诉我如何解决此问题。谢谢!