# diacritic marks in formulas

I have the following code

\documentclass{report}
\usepackage{fontspec}
\begin{document}
Ārā
$$\Phi_{Ārā}$$
\end{document}


I use xelatex to compile this code containing Latvian characters - see Which inputenc for these Latvian letters?

The output is the following

The letters with diacritic marks are displayed correctly in text but are missing in the formula. How to fix?

You should use \mathrm or \text for this. But don't overuse diacritic in math, they can be confused with accents like \bar and so change the mathematical meaning.

\documentclass{report}
\usepackage{amsmath}
\usepackage{fontspec}
\begin{document}
Ārā
$$\Phi_{\mathrm{Ārā}} \Phi_{\text{\normalfont Ārā}}$$
\end{document}


You probably don't want that text in math italic anyway. use the amsmath package and the \text command:

\documentclass{report}
\usepackage{fontspec}
\usepackage{amsmath}
\begin{document}
Ārā
$$\Phi_{\text{Ārā}}$$
\end{document}