[Tex/LaTex] How to create the own math operator with limits

math-modemath-operators

How can i write my own math operator with limits? I want it to look like:
\sum\limits_{e=1}^{m}
but with a capital A (if possible bigger than the normal text) instead of the sum.
Thanks for the help!

Best Answer

We can scale the symbol to the height plus depth of the summation and then vertically center it with respect to the formula axis.

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\DeclareRobustCommand\bigop[1]{%
  \mathop{\vphantom{\sum}\mathpalette\bigop@{#1}}\slimits@
}
\newcommand{\bigop@}[2]{%
  \vcenter{%
    \sbox\z@{$#1\sum$}%
    \hbox{\resizebox{\ifx#1\displaystyle.9\fi\dimexpr\ht\z@+\dp\z@}{!}{$\m@th#2$}}%
  }%
}
\makeatother

\newcommand{\bigstar}{\DOTSB\bigop{\star}}
\newcommand{\bigA}{\DOTSB\bigop{\mathrm{A}}}

\begin{document}
\[
\sum_{i=1}^n\bigA_{i=1}^n x_i\dots\bigstar_{i=1}^n x_i
\qquad
\textstyle
\sum\bigA\bigstar_{i=1}^n x_i
\qquad
\scriptstyle
\sum\bigA\bigstar_{i=1}^n x_i
\qquad
\scriptscriptstyle
\sum\bigA\bigstar_{i=1}^n x_i
\]
\end{document}

enter image description here

A simpler but not not scalable version (it won't work in

\newcommand{\opA}{\mathop{\vphantom{\sum}\mathchoice
  {\vcenter{\hbox{\huge A}}}
  {\vcenter{\hbox{\Large A}}}{\mathrm{A}}{\mathrm{A}}}\displaylimits}

In this way the "A" will be as large as the \sum symbol.

enter image description here

An enhanced version, where one can specify a correction factor for the big symbol in display style, as different symbols seem to require different factors.

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\DeclareRobustCommand\bigop[2][1]{%
  \mathop{\vphantom{\sum}\mathpalette\bigop@{{#1}{#2}}}\slimits@
}
\newcommand{\bigop@}[2]{\bigop@@#1#2}
\newcommand{\bigop@@}[3]{%
  \vcenter{%
    \sbox\z@{$#1\sum$}%
    \hbox{\resizebox{\ifx#1\displaystyle#2\fi\dimexpr\ht\z@+\dp\z@}{!}{$\m@th#3$}}%
  }%
}
\makeatother

\newcommand{\bigstar}{\DOTSB\bigop{\star}}
\newcommand{\bigA}{\DOTSB\bigop[0.92]{\mathrm{A}}}
\newcommand{\bigDelta}{\DOTSB\bigop[1.05]{\Delta}}

\begin{document}
\[
\sum_{i=1}^n\bigA_{i=1}^n\bigDelta_{i=1}^n x_i\dots\bigstar_{i=1}^n x_i
\]
\begin{center}
$\textstyle
\sum \bigA \bigstar \bigDelta_{i=1}^n x_i
\qquad
\scriptstyle
\sum \bigA \bigstar \bigDelta_{i=1}^n x_i
\qquad
\scriptscriptstyle
\sum \bigA \bigstar \bigDelta_{i=1}^n x_i
$
\end{center}
\end{document}

enter image description here

Related Question