One can use \bar
to put a bar over a letter in math mode, but often the bar isn't wide enough. An alternative is \overline
, but this isn't an accent, so it doesn't take into account the skew of the letter. In the following example, the bar extends too far to the left:
Now the mathabx
package offers a \widebar
accent, but this has several drawbacks:
-
mathabx
changes a lot of other things, -
The
\widebar
sits slightly higher than\bar
and\overline
, -
In previewers (checked with
kpdf
andacroread
), the\widebar
appears fuzzy, which\bar
and\overline
don't.
So my question is: How can I put a wide bar over a letter in math mode without the above drawbacks?
Best Answer
Here's a new implementation of
\widebar
, based on\overline
. It works by hacking intoamsmath
's accent placement, so it needs that package. Here's a comparison of\widebar
(first line) and\overline
(second line):I think the placement of the bars in the first line is better, except for the
\sin z
, where there's no difference. Note that\widebar
works well together with superscripts, but not necessarily with subscripts. (\overline
has the same issue.) It also works well over combined symbols likeAB
in most cases.Here is my previous simpler implementation; the intended use is for single symbols. It also works when applied to several symbols, but then the placement of the bar may not be appropriate (see
AW
at the end). Moreover, subsequent superscripts may be placed too close to the bar.