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}
2
  • Please, don't use the minimal class for examples, it's not meant for such applications.
    – egreg
    Oct 14 at 12:41
  • 1
    What's it meant for then? I thought this was exactly its purpose. Oct 14 at 14:32
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

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

3
  • Beat me to it! :) Oct 14 at 12:04
  • 1
    Why \mathclap{\phantom{#1}} when \vphantom{#1} suffices?
    – egreg
    Oct 14 at 12:37
  • @egreg --- Indeed; see my comment to the OP's answer. Oct 14 at 13:09
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}
4
  • I always forget about \vphantom. Oct 14 at 12:02
  • Shouldn't it be \vphantom{#1}?
    – egreg
    Oct 14 at 12:39
  • @egreg: no, because you want the overline to be the same height as the "a", rather than whatever's provided. Oct 14 at 14:33
  • OK, I explained wha I meant in my answer.
    – egreg
    Oct 14 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.