2

At the moment I have an output with \bar{...} command as

enter image description here

and I want something that extends over the entire term preferably without redefining the original command.

Henri Menke
  • 109,596

2 Answers2

5

I wrote a macro \voverline which has a variable rule width and separation from the content. These parameters are called \voverlinesep and \voverlinewidth. They can be adjusted via \setlength.

\documentclass{article}
\newlength\voverlinesep
\newlength\voverlinewidth
\setlength\voverlinesep{1pt}
\setlength\voverlinewidth{.1pt}
\makeatletter
\newcommand\voverline[1]{%
  \mathpalette\@voverline{#1}%
}
\newcommand\@voverline[2]{%
  \sbox0{$\m@th#1#2$}%
  \rule[\dimexpr\ht0+\voverlinesep]{\wd0}{\voverlinewidth}%
  \llap{\box0}
}
\begin{document}
$\overline{\mathbf{M}_{\mathbf{2}}(\mathbf{q}_{\mathbf{b}})}$
versus
$\voverline{\mathbf{M}_{\mathbf{2}}(\mathbf{q}_{\mathbf{b}})}$
\end{document}

enter image description here

Henri Menke
  • 109,596
  • Actually, \setlength\voverlinesep{1.2pt} would fit better, because the separation to the formula is 3 times the line thickness (default 0.4pt) for \overline. – Henri Menke Nov 19 '15 at 19:01
3

You could write

$\overline{\mathbf{M}_{\mathbf{2}}(\mathbf{q}_{\mathbf{b}})}$
Mico
  • 506,678