gpt4 book ai didi

markdown - 使用 Pandoc 时禁用 'TeX math'

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

在 Pandoc 中阅读 Markdown 时如何禁用 TeX 内容?我有许多正在处理的 Markdown 文件,但由于存在明显是 Markdown 式语法来使用它的文本,它会因警告而窒息其中一些文件。

[WARNING] Could not convert TeX math '@#', rendering as TeX:
@#
^
unexpected '#'
expecting "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "{", letter, digit, ".", "\\mbox", "\\text", "\\textbf", "\\textit", "\\textrm", "\\textsf", "\\texttt", "\\bm", "\\boldsymbol", "\\mathbb", "\\mathbf", "\\mathbfcal", "\\mathbffrak", "\\mathbfit", "\\mathbfscr", "\\mathbfsfit", "\\mathbfsfup", "\\mathbfup", "\\mathbold", "\\mathcal", "\\mathds", "\\mathfrak", "\\mathit", "\\mathrm", "\\mathscr", "\\mathsf", "\\mathsfit", "\\mathsfup", "\\mathtt", "\\mathup", "\\pmb", "\\symbf", "\\texttt", "\\sqrt", "\\surd", "\\mspace", "\\hspace", "\\mathop", "\\mathrel", "\\mathbin", "\\mathord", "\\mathopen", "\\mathclose", "\\mathpunct", "\\phantom", "\\boxed", "\\overset", "\\stackrel", "\\underset", "\\frac", "\\tfrac", "\\dfrac", "\\binom", "\\genfrac", "\\substack", "_", "^", "\\begin", "\\ensuremath", "\\bigg", "\\Bigg", "\\big", "\\Big", "\\biggr", "\\Biggr", "\\bigr", "\\Bigr", "\\biggl", "\\Biggl", "\\bigl", "\\", "\\left", "\\not", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "\\operatorname" or end of input

由于我没有在这些文本中使用任何类型的数学或花哨的排版,我宁愿禁用这种解释,而不是试图找出正确的方法来逃避实际上触发它的序列。

但如果这是不可能的,我很想知道逃避@ 的正确方法是什么。大概 '@'?还是有更多我不知道的 TeX 式语法?

最佳答案

您可以使用 -EXTENSIONNAME 禁用任何扩展附加到输入格式。所以在你的情况下,你大概想禁用 tex_math_dollars ,因此格式为 -f markdown-tex_math_dollars ,其内容为“使用格式 Markdown 减去/不使用 tex_math_dollars 扩展名”。完整的命令可能如下所示:

pandoc -f markdown-tex_math_dollars -o output.html input.md

另一种选择是使用 Markdown variants 之一。默认情况下(或根本不支持)不包含 TeX 支持。例如,要使用 GitHub Flavored Markdown (gfm):
pandoc -f gfm -o output.html input.md

关于markdown - 使用 Pandoc 时禁用 'TeX math',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54890232/

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