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?

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}
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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.