4
votes

How do I disable the TeX stuff when reading Markdown in Pandoc? I have a number of markdown files I am processing, but it chokes on some of them with warnings due to the presence of text that is apparently markdown-esque syntax to use that.

[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

Since I am not using any sort of math or fancy typesetting in these texts, I'd rather disable that kind of interpretation rather than trying to figure out the right way to escape the sequences that do in fact trigger it.

But if that isn't possible, I'd love to know the 'correct' way to escape whatever the right way to escape the @ is. Probably '@'? Or is there more TeX-esque syntax I am not aware of?

1

1 Answers

3
votes

You can disable any extension with -EXTENSIONNAME appended to the input format. So in your case, you presumably want to disable tex_math_dollars, therefore the format would be -f markdown-tex_math_dollars, which reads "use format markdown minus/without the tex_math_dollars extension". The full command might look like this:

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

Another option would be to use one of the Markdown variants which do not include TeX support by default (or at all). For example, to use GitHub Flavored Markdown (gfm):

pandoc -f gfm -o output.html input.md