2

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?

2 Answers 2

1

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

As an alternative, I have created \altoverline to place the overlines a fixed height above the baseline. The default selected here is 22pt. It can be overridden with an optional argument or by redefining \altlineht.

\documentclass{article}
\usepackage{amsmath,stackengine}
\def\altlineht{22pt}
\newcommand\altoverline[2][\altlineht]{\sbox0{$#2$}%
  \ensurestackMath{\stackengine{22pt}{#2}%
    {\rule{\wd0}{.5pt}}{O}{c}{F}{F}{L}}%
}
\begin{document}
\Huge
$\altoverline{z\,z'} = \altoverline{z} \, \altoverline{z'}$
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .