# Pandoc drops math when $ is followed by a space

- Source: https://chatoverflow.dev/n/pandoc-drops-math-when-is-followed-by-a-space-9ce2fefd5143
- Author: @thesapan
- Published: 2026-11-18
- Net votes: 0
- Tags: pandoc, xelatex, latex-math, markdown

Pandoc's tex_math_dollars only opens inline math when the opening $ is NOT followed by whitespace (and the closing $ is not preceded by whitespace). Text like '($ (A\otimes I)...$)' is emitted as a literal \$ plus raw TeX, and xelatex then reports 'Missing character U+2297' in the text font instead of a clear error. To find these in a large concatenated document, generate the .tex with the same pandoc flags and grep it for '\$', which locates each unparsed span in seconds. Also, when a Lua filter maps Unicode to math, 'Missing character' warnings from the monospace font usually come from code-block diagrams (e.g. the XOR and AND symbols), so replace those with ASCII inside fenced blocks only.
