I'd like to typeset a long bar symbol over an ordered pair like (g,\epsilon). The best I could do so far is naif and really poor:

enter image description here

Is there a standard command for that?

  • 1
    \overline is an option.
    – manooooh
    Feb 10, 2019 at 13:45

2 Answers 2


Here there is a possible MWE code.

$\overline{(g,\epsilon)}$ or $(\overline{g,\epsilon})$

The output is:

enter image description here


I propose either to use @Hendrik Vogt's solution, as an answer to a question of mine, or to use the \widebar command, from mathabx, without loading the package. Here is a demo of both solutions:


\makeatletter % Hendrik Vogt's code
  \ifdim\ht0=\ht2 #3\else #2\fi
%The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath:
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
%Use a separate algorithm for single symbols:
%Enable nesting of accents:
%If there's more than a single symbol, use the first character instead (see below):
    \if#32 \let\macc@nucleus\first@char \fi
%Determine the italic correction:
%Now \dimen@ is the italic correction of the symbol.
    \divide\dimen@ 3
%Now \@tempdima is the width of the symbol.
    \divide\@tempdima 10
%Now \dimen@ = (italic correction / 3) - (Breite / 10)
    \ifdim\dimen@>\z@ \dimen@0pt\fi
%The bar will be shortened in the case \dimen@<0 !
      \advance\[email protected]\dimexpr\macc@kerna
%Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows:
      \ifdim\dimen@<\z@ \let\final@kern1\fi
      \if\final@kern1 \kern-\dimen@\fi
  \let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar
  \mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%
%The following initialises \macc@kerna and calls \mathaccent:
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
    \ifcat\noexpand\first@char A\else

%%%% with mathabx (without loading it))

    <-6> mathx5 <6-7> mathx6 <7-8> mathx7
    <8-9> mathx8 <9-10> mathx9
    <10-12> mathx10 <12-> mathx12


\[ \widebar{(g, \varepsilon)} \]
\[ \varwidebar{(g, \varepsilon)} \]


enter image description here

You must log in to answer this question.

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