# \overrightarrow with garamond: gap in the arrow

Typesetting $\overrightarrow{OQ}$ yields a very unpleasant gap in the arrow when used with garamond. Here's a minimal working example that shows the problem. It looks okay without the garamond line.

\documentclass{article}
\usepackage[garamond]{mathdesign}
\begin{document}
$\overrightarrow{OQ}.$
\end{document}


This is clearly an unwanted feature. Is it possible to fix this? (discarding garamond is not an option, I've already typeset and printed several hundreds of pages with it, and I want uniformity in my documents for my students).

-

The problem is that the minus sign and the arrow in the math font that's used with the garamond option is shorter than usual and this breaks \rightarrowfill that's used in \overrightarrow.

You should repair the glitch by redefining \rightarrowfill:

\documentclass{article}
\usepackage[garamond]{mathdesign}

\makeatletter
\def\rightarrowfill{%
$\m@th\smash-\mkern-9mu \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill \mkern-9mu\mathord\rightarrow$}
\makeatother

\begin{document}
$\overrightarrow{OQ}$

\makebox[1.0em]{\rightarrowfill}
\makebox[1.1em]{\rightarrowfill}
\makebox[1.2em]{\rightarrowfill}
\makebox[1.3em]{\rightarrowfill}
\makebox[1.4em]{\rightarrowfill}
\makebox[1.5em]{\rightarrowfill}
\makebox[1.6em]{\rightarrowfill}

\makebox[1.7em]{\rightarrowfill}
\makebox[1.8em]{\rightarrowfill}
\makebox[1.9em]{\rightarrowfill}
\makebox[2.0em]{\rightarrowfill}
\makebox[2.1em]{\rightarrowfill}

\end{document}


Using amsmath (which is implicitly loaded by amsart and amsbook) the patch should also be to \arrowfill@; it's simpler to use etoolbox:

\usepackage{etoolbox}
\makeatletter
\patchcmd\arrowfill@{-7mu}{-9mu}{}{}
\patchcmd\arrowfill@{-7mu}{-9mu}{}{}
\patchcmd\rightarrowfill{-7mu}{-9mu}{}{}
\patchcmd\rightarrowfill{-7mu}{-9mu}{}{}
\makeatother

-
Thanks so much, it works fine! Well, in fact I'm using the amsbook class, which uses \rightarrowfill@ instead of \rightarrowfill... so I redefined \overrightarrow as found in base/fontmath.ltx and with your fix it seems to work perfectly! – gniourf_gniourf Sep 30 '12 at 16:26
@gniourf_gniourf I've added the patch for amsmath – egreg Sep 30 '12 at 16:32
fantastic! I'm now using your patch for amsmath, it's much nicer than my solution. Thanks a lot! – gniourf_gniourf Sep 30 '12 at 16:40