6

I have something like this:

\int\limits _{\left[a,c\right]}f

I would like to add the arrow over the [a,b] to emphasize the directionality, but when I try to use:

\int\limits _{\overrightarrow{\left[a,c\right]}}f

it seems that arrow prevents the upper symbol to look small. I have tried many options but none look good... Many thanks for helping.

Radek

rk85
  • 151

2 Answers2

7

Here's a macro \overrightsmallarrow that “demotes” the arrow to be in the smaller style:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\overrightsmallarrow}{\mathpalette{\overarrowsmall@\rightarrowfill@}}
\newcommand{\overarrowsmall@}[3]{%
  \vbox{%
    \ialign{%
      ##\crcr
      #1{\smaller@style{#2}}\crcr
      \noalign{\nointerlineskip}%
      $\m@th\hfil#2#3\hfil$\crcr
    }%
  }%
}
\def\smaller@style#1{%
  \ifx#1\displaystyle\scriptstyle\else
    \ifx#1\textstyle\scriptstyle\else
      \scriptscriptstyle
    \fi
  \fi
}
\makeatother

\begin{document}
\[
\int\limits_{\overrightarrow{[a,c]}}f
\int\limits_{\overrightsmallarrow{[a,c]}}f
\int\limits_{\overrightsmallarrow{\![a,c]\!}}f
\]
\end{document}

enter image description here

I added a possible improvement with \! for avoiding clash of symbols.

Note that \left and \right do nothing here and it's not recommended to use them for every pair of delimiters. Add them only if you really need to.

egreg
  • 1,121,712
2

Well-placed \scripstyle solves the problem:

\documentclass{article}

\begin{document}
You have 
\[
\int\limits _{\overrightarrow{\left[a,c\right]}}f
\]
You want to
\[
\int\limits _{\overrightarrow{\scriptstyle\left[a,c\right]}}f
\]

\end{document}

enter image description here