使用 Pandoc 时禁用 'TeX math'

Disable 'TeX math' when using Pandoc

在 Pandoc 中阅读 Markdown 时如何禁用 TeX 内容?我有许多我正在处理的降价文件,但由于存在显然是降价式语法的文本,它会在其中一些文件上发出警告。

[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

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

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

您可以禁用任何附加到输入格式的 -EXTENSIONNAME 扩展名。所以在你的情况下,你可能想禁用 tex_math_dollars,因此格式将是 -f markdown-tex_math_dollars,它显示为“ 使用格式降价 minus/without 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