4

My question is similar to these two, but all the solutions have been about raising the overline. In contrast, I would like to lower the overline so that it is the same height for all lowercase letters. For example, I'd like this

enter image description here

to look more like this

enter image description here

How could I do this?

\documentclass[12pt]{minimal}
\begin{document}
$\overline{a} + \overline{b}$
\end{document}

3 Answers3

4

Smash, but keep the height of the lowercase letter and of the symbol you're typesetting.

\newcommand{\lowoverline}[1]{%
  \overline{\smash{#1}\vphantom{x}}\vphantom{#1}%
}

Full example.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\lowoverline}[1]{% \overline{\smash{#1}\vphantom{x}}\vphantom{#1}% }

\begin{document}

\begin{equation} \lowoverline{a}+\lowoverline{b} \end{equation}

\end{document}

enter image description here

You can similarly define \lowbar, which I deem preferable.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\lowoverline}[1]{% \overline{\smash{#1}\vphantom{x}}\vphantom{#1}% } \newcommand{\lowbar}[1]{% \bar{\smash{#1}\vphantom{x}}\vphantom{#1}% }

\begin{document}

\begin{equation} \lowoverline{a}+\lowoverline{b} \quad \lowbar{a}+\lowbar{b} \end{equation}

\end{document}

enter image description here

egreg
  • 1,121,712
3

By smashing things. In the following example, the argument b is vertically smashed (its height doesn't count). The \lowoverline gets its height from the optional argument, which defaults to a. This argument is horizontally smashed and made invisible by \phantom.

\documentclass{article}
\usepackage{mathtools}
\newcommand\lowoverline[2][a]{\ensuremath\overline{{\smash{#2}\vphantom{#1}}}}
\begin{document}
\begin{equation}
\overline{a}\quad \lowoverline{b}
\end{equation}
\end{document}

Edited: my original code used \mathclap{\phantom{#1}}, but Jordan Mitchell Barrett and egreg pointed out the simpler alternative \vphantom{#1}.

enter image description here

Ian Thompson
  • 43,767
1

You can use \smash{b} to set the height of b to zero, and then \vphantom{a} to make something with zero width and the height of an a.

\documentclass[12pt]{minimal}
\newcommand{\ol}[1]{\overline{\smash{#1}\vphantom{a}}}

\begin{document} $\overline{a} + \overline{b}$

$\ol{a} + \ol{b}$ \end{document}