0

I have the following:

\overset{\rightharpoonup}{\calR}

which produces

enter image description here

What I would like to do is to lower the \rightharpoonup so that it is closer to the \calR and doesn't cause a larger gap between lines. How can I do this?

1 Answer 1

1

The main problem is the bounding box of \rightharpoonup.

Some low level programming will help.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\DeclareRobustCommand{\hvec}[1]{{\mathpalette\hvec@{#1}}}
\newcommand{\hvec@}[2]{%
  \vbox{\offinterlineskip
    \ialign{%
      \hfil##\hfil\cr
      $\m@th#1{}_{\rightharpoonup}$\kern-\scriptspace\cr
      $\m@th#1#2$\cr
    }%
  }%
}
\makeatother

\begin{document}

$\hvec{\mathcal{R}}_{\hvec{x}}$
% compare with
$\overset{\rightharpoonup}{\mathcal{R}}_{\overset{\rightharpoonup}{x}}$

\end{document}

enter image description here

1
  • Thanks so much. Works like a charm.
    – amsmath
    Commented Apr 24, 2021 at 11:01

You must log in to answer this question.

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