I want to represent, say, the closure of a set or the extended reals, e.g., $\bar{\mathbb{R}}$ but unfortunately this creates a bar that is much too small (horizontally) and can barely be seen. On the other hand, $\overline{\mathbb{R}}$ creates a line that is too long. I need something that's just right, in between the bar and the overline. What would be my best choice?


Here is a command \xoverline[width percent]{symb} that will do it. Note that it will not scale inside sub or superscripts. If you need that, everthing has to go through a \mathchoice resulting in a lot more complex code.


    \setbox\myboxB\null% Phantom box
    \wd\myboxB=#1\wd\myboxA% Scale phantom
    \sbox\myboxB{$\m@th\overline{\copy\myboxB}$}%  Overlined phantom
    \setlength\mylenA{\the\wd\myboxA}%   calc width diff
       \rlap{\hskip 0.5\mylenA\usebox\myboxB}{\usebox\myboxA}%
        \hskip -0.5\mylenA\rlap{\usebox\myboxA}{\hskip 0.5\mylenA\usebox\myboxB}%





enter image description here

  • 11
    Someone should do the \mathchoice thing and package this into a package! – Mariano Suárez-Álvarez Jun 27 '14 at 5:38

I usually define a command \overbar, which reduced the width of \overline by 1.5mu on each side.



\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}

$\bar{\mathbb{R}}$ $\overbar{\mathbb{R}}$ $\overline{\mathbb{R}}$


  • 1
    Would this solution have the same issues regarding subscripts/superscripts as described in Danie's solution? – Tony Mottaz Jan 24 '16 at 21:48
  • 1
    @Anthony I believe not, it doesn’t go out of math mode and thus stays in the style it was invoked in. – Alex Shpilkin Aug 1 '16 at 21:33
  • Great command, makes the bar look identical to an excerpt from Understanding Analysis by Stephen Abbott (although \overline might still be a good alternative). – Joshua Detwiler Oct 12 '17 at 20:26

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.