4

I have the following code

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

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

The output is the following

enter image description here

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

Viesturs
  • 7,895

2 Answers2

7

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ā
\begin{equation}
  \Phi_{\text{Ārā}}
\end{equation}
\end{document}
Au101
  • 10,278
Herb Schulz
  • 3,410
6

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ā
\begin{equation}
  \Phi_{\mathrm{Ārā}} \Phi_{\text{\normalfont Ārā}}
\end{equation}
\end{document}
Ulrike Fischer
  • 327,261