I understand that I am supposed to use \bar instead of \overline in math mode, if I want the respective character to mean "something different", because \bar is actually an accent (similar to \dot, a prime, \hat, etc.) Opposed to that \overline is meant to be used as an operator, like a conjugation or similar.

However, with Libertinus and PdfLaTeX, I usually use \overline, because it gives me better visual results.



\texttt{\textbackslash overline}  &  \texttt{\textbackslash bar} \\\hline
$\overline{c}$     &  $\bar{c}$ \\
$\overline{d}$     &  $\bar{d}$ \\
$\overline{f}$     &  $\bar{f}$ \\
$\overline{\i}$    &  $\bar{\i}$ \\\hline

Result with PdfLaTeX:

Result with PdfLaTeX

In my personal opinion, \overline is better, because the "accent" is wider, covers the whole width of the letter and therefore is easier to spot.

Recently, I switched to LuaLaTex. The same MWE compiled with LuaLaTeX:

Result with LuaLaTeX

  • Pro \overline: Generally, the "accent" is still wider and easier to spot, especially for the d and the f
  • Pro \bar: The thickness of the accent's "ink" matches the thickness of the letters
  • Con \overline: The overline is horizontally misplaced for the f and the d. In both cases the "accent" is too much on the left. \overline does not take into account that the characters are slanted and their ascending stems stick out to the right.
  • Con \bar: In case of the d, the bar seems to be too short or strangely misplaced. If it remains as short as it is, the accent should be more to the right above the ascending stem of the d.


1) Is it possible to fix \bar for the d-letter such that is either becomes wider and covers the width of the whole body of the d or alternatively is placed over the stem of the d as it is the case with the f?

2) Is it possible to fix \bar for the f-letter such that is becomes a little bit wider and looks more similar to the overline as it is the case with PdfLaTeX?

  • 3
    \bar{d} looks like a bug in the font. Report it. And use \imath for the dotless i. Commented Feb 16, 2020 at 18:32
  • 2
    the overline f looks terrible I much prefer the bar in that case, even though it's a bit short Commented Feb 16, 2020 at 19:58
  • it works fine with xelatex, the reason why it may be a problem with package fontspec
    – user187802
    Commented Feb 17, 2020 at 8:44
  • \bar is a maths accent. If it is misplaced it is (probably) a bug in the font. Commented Feb 17, 2020 at 11:46

1 Answer 1


This is either a bug in LuaTeX (or maybe luaotfload) or the font itself, nothing to do with fontspec or unicode-math. Here is a plain TeX example:

%!TEX TS-program = XeTeX

  \input luaotfload.sty


{\bf Default \TeX}

Regular symbols:
 a + b + c \quad \alpha + \beta + \gamma

Testing overline:
 \overline{a} + \overline{b} + \overline{c} + \overline{d} + \overline{e} + \overline{f} + \overline{\alpha} + \overline{\beta} + \overline{\gamma}


{\bf Loading new OpenType maths font (red glyphs)}

\font\mymm = "\otf{LibertinusMath-Regular}:color=FF0000" at 10pt\relax



 \Umathcode`\a = 7 1 "1D44E\relax
 \Umathcode`\b = 7 1 "1D44F\relax
 \Umathcode`\c = 7 1 "1D450\relax
 \Umathcode`\d = 7 1 "1D451\relax
 \Umathcode`\e = 7 1 "1D452\relax
 \Umathcode`\f = 7 1 "1D453\relax
 \Umathcode"03B1 = 7 1 "1D6FC\relax
 \Umathcode"03B2 = 7 1 "1D6FD\relax
 \Umathcode"03B3 = 7 1 "1D6FE\relax

Regular symbols:
 a + b + c \quad \alpha + \beta + \gamma

Testing overline:
 \overline{a} + \overline{b} + \overline{c} + \overline{d} + \overline{e} + \overline{f} + \overline{\alpha} + \overline{\beta} + \overline{\gamma}

  • Who reports the bug to the maintainers of LuaTeX, luaotfload or the Libertinus font project? I must admit that I feel very inexperienced to decide which of the projects is the right one.
    – nagmat84
    Commented Feb 17, 2020 at 16:31
  • it works fine with xetex, the reason why it must be a problem with latex and/or luaotfload
    – user187802
    Commented Feb 20, 2020 at 20:40

You must log in to answer this question.

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