gpt4 book ai didi

latex - Pandoc:[警告] 无法转换 TeX 数学

转载 作者:行者123 更新时间:2023-12-03 21:22:23 25 4
gpt4 key购买 nike

我尝试使用 Pandoc 将 html 转换为 docx:
这是我的 html 代码:

<p> Example: ${v_1} = {\rm{ }}{v_2}$</p>

使用 MathJax 配置:

MathJax.Hub.Config({
扩展名: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["输入/TeX", "输出/HTML-CSS"],
tex2jax:{
inlineMath: [['$', '$'], ["\(", "\)"]],
displayMath: [['$$', '$$'], ["\[", "\]"]],
},
"HTML-CSS": {availableFonts: ["TeX"]}
});

我使用的 Pandoc 命令(Pandoc 版本 2.2.3.2):

pandoc -s test.html --mathjax -f html+tex_math_dollars --pdf-engine=xelatex -o xxx.docx

然后我收到警告:

[警告] 无法转换 TeX 数学 '{v_1} = {\rm{ }}{v_2}',呈现为 TeX:
{v_1} = {\rm{ }}{v_2}
^
意外的“{”
期待“%”、“\\label”、“\\nonumber”或空格

有人请告诉我如何解决这个问题。谢谢!

最佳答案

使用 latex \textrm而不是纯 tex \rm ,并且 pandoc 将能够处理它。

关于latex - Pandoc:[警告] 无法转换 TeX 数学,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52313094/

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