I want to overline (/bar) a character. Depending on the font weight and font size of this character, though, I want the overline to be of different thickness – it should scale with both font size and font weight.
How can I accomplish this?
Ideally, the distance between the overline and the character should also be (auto-)configurable. Smaller characters need more space between character and overline, relatively, than taller ones.
Background
Our physics experiment is called PANDA, with an \overline
on top of the P.
While this looks decently enough for usual text, as soon PANDA is printed bold or in a bigger text size (section headings), it starts looking wrong.
(The first always is a \overline{P}
, the second \bar{P}
. Here's the ShareLatex code (section 1).)
Attempts
I searched around and fiddled a bit, but I did not get the look I'm looking for. At section 2 of above ShareLatex file I summarized the three main possibilities I found.
In the fntguide (http://mirrors.ctan.org/macros/latex/base/fntguide.pdf, page 8) I also found the internal macros which hold the current font style. \f@series
is responsible for the font thickness. I know too little TeX, though, for writing an \if
using macro around this variable.