1

I prefer \bar over \overline because of two reasons: \overline

  1. places the line too far below, consider for example \overline{r}.
  2. has a thicker line than \bar, possibly it's even a different font.

But one disadvantage of \bar is the length of the line, which is often too short, consider for example \bar{M}. However, I've come across this wonderful solution, which I think uses the same font/thickness and almost the same placement as \bar: https://tex.stackexchange.com/a/16344/136549

But even so, the line of \widebar{x+y} is still too short. How can I make it long enough while using the style of \bar?

Consider the equation \overline{r}=\overline{x+y}. I want the lines to be a bit higher and thinner like in \bar{r} = \bar{x+y}, where the line on the right side is merely too short. The solution \widebar{r} = \widebar{x+y} is not bad, but the line is still not long enough.

Can the style and the placement of \overline be modified so that it behaves like \bar (but draws long lines)? This would allow me to combine the respective advantages of both commands.

Thrash
  • 653
  • Did you try with mathabx? – Bernard Feb 07 '22 at 22:06
  • Yes, the same. The code of \widebar I'm using so far and to which my link refers is precisely an extract from mathabx.sty and mathabx.dcl. – Thrash Feb 07 '22 at 22:11
  • What's so bad about $\overline{x+y\mathstrut}$? – Mico Feb 07 '22 at 23:16
  • Consider the equation \overline{r}=\overline{x+y}. I want the lines to be a bit higher and thinner like in \bar{r} = \bar{x+y}, but stretch the line on the right side of the latter. – Thrash Feb 07 '22 at 23:20
  • If you want the line drawn by \overline to be placed a bit higher up, give $\overline{x+y\vphantom{k}}$ a try. It won't address the line thickness issue, though. – Mico Feb 07 '22 at 23:22
  • Can the style and the placement of \overline be modified so that it behaves like \bar? This would allow me to combine the respective advantages of both commands. – Thrash Feb 07 '22 at 23:49

1 Answers1

5

The wide math accents in legacy TeX fonts have a maximum width.

If you're willing to go with XeLaTeX or LuaLaTeX…

\documentclass{article}
\usepackage{unicode-math}

\begin{document}

[ \wideoverbar{b}+\wideoverbar{a+b}+\wideoverbar{a+b+c}+\wideoverbar{a+b+c+d} ]

[ \overline{b}+\overline{a+b}+\overline{a+b+c}+\overline{a+b+c+d} ]

\end{document}

enter image description here

egreg
  • 1,121,712