[Tex/LaTex] XeLaTeX, unicode-math and Linux Libertine: changing the look of \overrightarrow

fontsmath-modexetex

I am using Linux Libertine and thus far everything has been working flawlessly with regard to the math mode, fonts look very well and match the text perfectly.

However, I found that I do not like the way \overrightarrow is typeset, because the tip of the arrow is very big and touches the letters below. I have found somewhere that the solution to that is to use unicode-math, which is something I should probably do anyways, and turning it on does indeed solve my issue: the arrow changes the tip to something manageable.

The issue is, \setminus disappears; additionally, bold symbols are no longer bold while I do need them for vectors. Therefore, my main question is how can I get a nicer looking arrow without losing \setminus and with working \bm ?

An MWE:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Linux Libertine}

\usepackage{amsmath}
\usepackage{bm}
\usepackage{unicode-math}

\begin{document}

Overarrow: $\overrightarrow{u, v}$

Setminus: $U\setminus V$

Vector: $x$, $\bm{x}$

\end{document}

EDIT: As @egreg pointed out, the issues with missing \setminus are known. However, even when solved, I need bold symbols in my equations. unicode-math effectively precludes using them, apart from the work-around with FakeBold, see here.

Therefore, is there a way of changing the \overrightarrow without the use of unicode-math?

Best Answer

Using Latin Modern Math along with Linux Libertine is disputable: they are different fonts.

Notice also that bm doesn't work with unicode-math (at the moment, work is in progress). But you can use \mathbfit.

\documentclass{article}

\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
% the redefinition for the missing \setminus must be delayed
\AtBeginDocument{\renewcommand{\setminus}{\mathbin{\backslash}}}

\begin{document}

Overarrow: $\overrightarrow{u, v}$

Setminus: $U\setminus V$

Bold vector: $\mathbfit{x}$

\end{document}

enter image description here

The same with Latin Modern for all the document fonts:

enter image description here

The same with Linux Libertine for text and Latin Modern for math:

enter image description here

I see no touching of the arrow, but also visual clash between the text and the math fonts.