Why are certain accents in math mode invisible? I am using unicode-math
and compile with XeLaTeX. Here is a MWE:
\documentclass{scrartcl}
\usepackage{unicode-math}
\begin{document}
x̃ŷz̄ $x̃ŷz̄$
\end{document}
This produces accents on the text mode letters but not on the math mode ones. Strange!
Best Answer
There is no Unicode “LATIN SMALL LETTER X WITH TILDE” so you get “x̃” by typing
x
followed by U+0303 “COMBINING TILDE”.This can't work in math mode, which strictly works from left to right and a following character doesn't influence what's before it.
You can make existent Unicode points such as “LATIN SMALL LETTER O WITH TILDE” to behave like
\tilde{o}
in math mode with a trick such asOne can think to do something like this for
x
(doing a lookahead to see if a combining character follows) but it would be slow and not particularly robust. It's really better to make your intentions clearer by typingJust as a proof of concept, here's how you could manage
x̃
(I also left the precomposedõ
). The\@ifnextchar
test should be extended to the other needed composite characters.