# why are the overarrows too short and the sqrt missing its vinculum?

I've been fighting with XeLaTeX (from a full TeX Live 2011 install on a linux box) for the past few hours and am finally almost at the result I want, but (as shown above) the overarrows aren't stretching to cover all the letters and the sqrt doesn't have its vinculum/overbar and I'm at a loss. What can I do to fix it?

\documentclass{article}
\usepackage{geometry}
\geometry{papersize={350pt,45pt},margin=0pt}

% no page numbers (and maybe other cleanness?)
\pagestyle{empty}

% don't hyphenate, don't indent
\hyphenpenalty=100000
\setlength{\parindent}{0mm}

% color
\usepackage{color}
\pagecolor{black}

% XeTeX fonts
\usepackage{unicode-math}
\usepackage{amsmath}
\usepackage{xltxtra}
\usepackage{sfmath}

\setmainfont[Mapping=tex-text]{Bera Sans}
\setmathfont{STIXGeneral}
\setmathfont[range=\mathup]{Bera Sans}
\setmathfont[range=\mathbfup]{Bera Sans Bold}
\setmathfont[range=\mathbfit]{Bera Sans Bold Oblique}
\setmathfont[range=\mathit]{Bera Sans Oblique}

\begin{document}\fontsize{9}{13}\selectfont\color{white}
This means that $\overleftrightarrow{AD}$ contains $F$  We write that as $3=\sqrt{9}$.  The \emph{square root} symbol is sometimes called a \emph{radical} symbol.
\end{document}

-
Use \setmathfont{XITS Math} – egreg Feb 17 '12 at 23:34
@egreg: Thanks. Changing the STIXGeneral to XITS Math fixed the radical and moved the overarrow to the center, but didn't stretch it—see i.stack.imgur.com/DqJZc.png – Isaac Feb 17 '12 at 23:36
I don't think that \overleftrightarrow is stretchable. – egreg Feb 17 '12 at 23:39
@egreg: codecogs.com/latex/eqneditor.php renders it as if it's stretchable... I thought I'd seen it stretchable elsewhere, but maybe not. Is there something I should use instead for the same effect? – Isaac Feb 17 '12 at 23:42
It is with pdflatex; it doesn't seem to be so with unicode-math. – egreg Feb 17 '12 at 23:47

The arrow stretches for me if I add

\usepackage{amsmath}
\let\savedoverleftrightarrow\overleftrightarrow


then use \savedoverleftrightarrow in the expression.

-
Yes, because it uses the amsmath definition. Something that the developers of unicode-math should look at. – egreg Feb 18 '12 at 0:18
This did it—I put \let\savedoverleftrightarrow\overleftrightarrow right after loading amsmath, then \def\overleftrightarrow{\savedoverleftrightarrow} after all the other package loads and now \overleftrightarrow works as expected. – Isaac Feb 18 '12 at 0:19
@egreg: Since I'm loading unicode-math before amsmath, wouldn't the amsmath definition overwrite one coming from unicode-math? If so, wouldn't the problem be in xltxtra or sfmath? – Isaac Feb 18 '12 at 0:20
@Isaac a whole load of definitions appear to be delayed (you set up the math fonts later for example) but I didn't trace exactly where the erroneous definition is coming from (actually that was the first time I've run xelatex:-) – David Carlisle Feb 18 '12 at 0:26
@Isaac amsmath should be loaded before unicode-math and sfmath doesn't make much sense in this context. – egreg Feb 18 '12 at 0:27