# Arrows in superscripts

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.

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jun 2 '15 at 22:43
• It will look better, if you use the $...$ style for this integral or \displaystyle\int\limits_{...}, however, this will enlarge your equation of course – user31729 Jun 2 '15 at 22:50
• Remove \left and \right to begin with. – egreg Jun 2 '15 at 23:08
• Are you doing \usepackage{amsmath}? If not, do. – egreg Jun 2 '15 at 23:44

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}


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.

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}


• I see no difference whatsoever – egreg Jun 2 '15 at 23:12
• @egreg Without \scripstyle the interval was as if in the \textstyle. – Przemysław Scherwentke Jun 2 '15 at 23:19
• Sorry, no. It is in script style anyway. – egreg Jun 2 '15 at 23:28
• @egreg Sorry, not in my picture. (OP wants the interval in script style). – Przemysław Scherwentke Jun 2 '15 at 23:37
• I used amsmath, of course. – egreg Jun 2 '15 at 23:43