Accented characters in LaTeX subscript in math mode

When using an accented capital letter in a subscript, LaTeX lowers the subscript box:

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

$A_\textup{foo}$ $A_\textup{Cech}$ $A_\textup{Čech}$

\end{document}


The first two subscripts are vertically aligned, while the last one is lowered because it contains a Č as part of a proper name. In my opinion, this is undesirable if both subscripts appear on the same line.

I know that I can lower the non-accented subscript boxes by using

A_\text{\vphantom{Č}foo}


However, this stretches out the line too much, and it means a lot of work and ugly code to add a \vphantom to all the subscripts.

Rather, I would like to tell LaTeX to put the Čech-subscript box on the same height as the other ones. Since I'm using a macro for \textup{Čech} anyway, I'm hoping to replace it by something which does the job.

1 Answer

You can use \smash:

\documentclass[border = 5pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

$A_\textup{foo}$ $A_\textup{Cech}$ $A_\textup{\smash{Čech}}$

\end{document}


• better to smash the whole word, so you don't lose inter-letter kerning Jan 3 '18 at 18:42
• @DavidCarlisle: I didn't know kerning is lost in smashing. I've just tested, and indeed, for this pair, the difference is 0.1 pt, but I can imagine that it will be more for other pairs. Jan 3 '18 at 19:45
• the \smash alone works here, but i'd be tempted to add a \vphantom{C} for insurance. (i tend toward overkill.) Jan 3 '18 at 20:19