Вы можете сделать это с помощью фильтра pandoc. E.g.:
-- Do nothing unless we are targeting TeX.
if not FORMAT:match('tex$') then return {} end
function Math (m)
local delimiter = m.mathtype == 'InlineMath' and '$' or '$$'
return pandoc.RawInline('tex', delimiter .. m.text .. delimiter)
end
Сохранить в файл dollar-math.lua
и передать его в pandoc через --lua-filter=dollar-math.lua
.