1 2 3 4 5 6 7 8
``` % pandoc -f latex \newcommand{\a}{\ifmmode x \else y \fi} $\a$ and \a ^D <p><span class="math inline"><em>x</em></span> and y</p> ```