[Tex/LaTex] “Average sum” symbol

math-operatorssymbols

Is there a convention for an average sum symbol, for instance \overline{\sum_{i \in I}} to mean \frac{1}{\#I} \sum_{i \in I}?

I can live with the overline option but it does not look good in inline mode as is.

How to typeset a sum symbol with a vertical bar across it?

EDIT: Following the answers given, let me add the requirement that the user should not be concerned whether the symbol is used in inline or display mode, and also stress that the vertical bar should be across the sum symbol (like the horizontal bar is across the integral sign in \fint).

Best Answer

Here's an implementation with \ooalign:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\avsum}{\mathop{\mathpalette\avsuminner\relax}\displaylimits}

\makeatletter
\newcommand\avsuminner[2]{%
  {\sbox0{$\m@th#1\sum$}%
   \vphantom{\usebox0}%
   \ooalign{%
     \hidewidth
     \smash{\vrule height\dimexpr\ht0+1pt\relax depth\dimexpr\dp0+1pt\relax}%
     \hidewidth\cr
     $\m@th#1\sum$\cr
   }%
  }%
}
\makeatother

\begin{document}
\[
\sum_{i=1}^{m} \avsum_{j=1}^{n} a_{ij}
\]
\[
\textstyle\sum_{i=1}^{m} \avsum_{j=1}^{n} a_{ij}
\]
\[
\scriptstyle\sum_{i=1}^{m} \avsum_{j=1}^{n} a_{ij}
\]
\[
\scriptscriptstyle\sum_{i=1}^{m} \avsum_{j=1}^{n} a_{ij}
\]
\end{document}

enter image description here