6

The following looks quite terrible, because \ell, f and x all have different sizes:

\documentclass{amsart}
\begin{document}
$q_\ell^{\scriptscriptstyle {\alpha}_{c\ell}}
 q_f^{\scriptscriptstyle {\alpha}_{cf}}
 q_x^{\scriptscriptstyle {\alpha}_{cx}}
$\\[12pt]
$ c_f^{\scriptscriptstyle \beta_f} 
c_\ell^{\scriptscriptstyle \beta_\ell}
c_m^{\scriptscriptstyle \beta_m}$
\end{document}

specifically like this:

enter image description here

Not only are the vertical sizes non-uniform, but the horizontal gap between c and f is greater than between c and \ell and between c and x. Is there a way to produce output where the three lines of code produce uniform output?

Werner
  • 603,163
Leo Simon
  • 2,199

2 Answers2

6

You can use a number of \vphantoms, choosing the largest component - f - and \vphantom{f} with the other, smaller elements:

enter image description here

\documentclass{amsart}

\begin{document}

$q_\ell^{\scriptscriptstyle {\alpha}{c\ell}} q_f^{\scriptscriptstyle {\alpha}{cf}} q_x^{\scriptscriptstyle {\alpha}{cx}} $\quad $q{\vphantom{f}\ell}^{\alpha_{c\ell\vphantom{f}}} q_f^{\alpha_{cf}} q_{\vphantom{f}x}^{\alpha_{cx\vphantom{f}}} $

\bigskip

$c_f^{\scriptscriptstyle \beta_f} c_\ell^{\scriptscriptstyle \beta_\ell} c_m^{\scriptscriptstyle \beta_m}$\quad $c_f^{\beta_f} c_{\vphantom{f}\ell}^{\beta_{\ell\vphantom{f}}} c_{\vphantom{f}m}^{\beta_{m\vphantom{f}}}$

\end{document}

The spacing can be adjusted using any of the methods suggested in What commands are there for horizontal spacing?.

Werner
  • 603,163
3

You can adjust the sub and superscript parameters see

What do different \fontdimen<num> mean

for a full list

enter image description here

By increasing the default amount they are raised or lowered you can get them lining up, the values here just chosen by eye, the original values shown in the log are

3.62892pt
2.47217pt

With the modified file being

\documentclass{amsart}
\begin{document}
\sbox0{$x$}% force math to load

\typeout{\the\fontdimen14\textfont2} \fontdimen14\textfont2=5pt

\typeout{\the\fontdimen17\textfont2} \fontdimen17\textfont2=5pt

$q_\ell^{\scriptscriptstyle {\alpha}{c\ell}} q_f^{\scriptscriptstyle {\alpha}{cf}} q_x^{\scriptscriptstyle {\alpha}{cx}} $\[12pt] $ c_f^{\scriptscriptstyle \beta_f} c\ell^{\scriptscriptstyle \beta_\ell} c_m^{\scriptscriptstyle \beta_m}$

\bigskip

$q_\ell^{{\alpha}{c\ell}} q_f^{{\alpha}{cf}} q_x^{{\alpha}{cx}} $\[12pt] $ c_f^{\beta_f} c\ell^{\beta_\ell} c_m^{\beta_m}$

\end{document}

I also show the version with normal sized superscripts (which look better to me especially as they are themselves subscripted)

David Carlisle
  • 757,742