Vertical alignment of overline

overlinevertical alignment

I would like to have the horizontal lines aligned vertically in next document

\documentclass{standalone}
\begin{document}
\Huge
$\overline{z\,z'} = \overline{z} \, \overline{z'}$
\end{document}

enter image description here

The bar over z is lower than the others.
With \vphantom

\documentclass{standalone}
\begin{document}
\Huge
$\overline{z\,z'} = \overline{\vphantom{z'}z\,z'}
  = \overline{\vphantom{z'}z} \, \overline{\vphantom{z'}z'}$
\end{document}

enter image description here

the two bars on the right are vertically aligned but they are not with the first bar.

  1. Why are the rightmost bar too high?
  2. How can I get the same height as the first?

Best Answer

Your \vphantom{z'} is making a strut that is taller than the z' as superscripts under \overline are set in cramped style.

LuaTeX has a primitive to force cramped style but otherwise mathtools has a macro \cramped that forces essentially the same layout.

enter image description here



\documentclass{standalone}
\usepackage{mathtools}
\begin{document}
\Huge
$\overline{z\,z'} = \overline{\vphantom{\cramped{z'}}z\,z'}
  = \overline{\vphantom{\cramped{z'}}z} \, \overline{\vphantom{\cramped{z'}}z'}$
\end{document}
Related Question