15

I am a bit too new to figure out how to simultaneously make something that looks like this:

\sum_a^b

but instead is a lowercase \sigma that has been enlarged so that I can write a little letter inside it.

Essentially I want what's on the left in this image with the normal sigma summation sign to the right for reference as to the size of it.

enter image description here

10

The blackness of the symbol is not fully satisfying, but here's a possible solution:

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

\makeatletter
\newcommand{\sigmaop}[1]{\mathop{\mathpalette\@sigmaop{#1}}\slimits@}
\newcommand{\@sigmaop}[2]{%
  \vphantom{\sum}%
  \sbox\z@{$\m@th#1\sum$}%
  \dimen@=\ht\z@ \advance\dimen@\dp\z@
  \dimen\tw@=\wd\z@
  \ifx#1\displaystyle\dimen@=.9\dimen@\fi
  \ooalign{%
    \hidewidth
    $\vcenter{\hbox{$\m@th#1#2$\kern.3\dimen\tw@}%
     \ifx#1\scriptstyle\kern-.25ex\fi}$\hidewidth\cr
    $\vcenter{\hbox{%
      \resizebox{!}{\dimen@}{$\m@th\sigma$}%
    }\ifx#1\scriptstyle\kern-.25ex\fi}$\cr
  }%
}
\makeatother

\begin{document}
\[
\sigmaop{s}_{i=1}^n \sum_{i=1}^n
\textstyle \sigmaop{s}\limits_{i=1}^n \sum\limits_{i=1}^n
\scriptstyle \sigmaop{s}\limits_{i=1}^n \sum\limits_{i=1}^n
\]
\end{document}

enter image description here


Some possible refinements, in particular the inner symbol is slightly moved down and it is in script style when the symbol is used in text style.

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

\makeatletter
\newcommand{\sigmaop}[1]{\mathop{\mathpalette\@sigmaop{#1}}\slimits@}
\newcommand{\@sigmaop}[2]{%
  \vphantom{\sum}%
  \sbox\z@{$\m@th#1\sum$}%
  \dimen@=\ht\z@ \advance\dimen@\dp\z@
  \dimen\tw@=\wd\z@
  \ifx#1\displaystyle\dimen@=.9\dimen@\fi
  \ooalign{%
    \hidewidth
    $\vcenter{%
     \vspace{.1\dimen@}%
     \hbox{$\m@th\@demotestyle#1#2$\kern.3\dimen\tw@}%
     \ifx#1\scriptstyle\kern-.25ex\fi}$\hidewidth\cr
    $\vcenter{\hbox{%
      \resizebox{!}{\dimen@}{$\m@th\sigma$}%
    }\ifx#1\scriptstyle\kern-.25ex\fi}$\cr
  }%
}
\newcommand\@demotestyle[1]{%
  \ifx#1\displaystyle
  \else
    \ifx#1\textstyle
      \scriptstyle
    \else
      \scriptscriptstyle
    \fi
  \fi
}
\makeatother

\begin{document}
\[
\sigmaop{s}_{i=1}^n \sum_{i=1}^n
\textstyle \sigmaop{s}\limits_{i=1}^n \sum\limits_{i=1}^n
\scriptstyle \sigmaop{s}\limits_{i=1}^n \sum\limits_{i=1}^n
\]
\[
\sigmaop{t}_{i=1}^n \sum_{i=1}^n
\textstyle \sigmaop{t}\limits_{i=1}^n \sum\limits_{i=1}^n
\scriptstyle \sigmaop{t}\limits_{i=1}^n \sum\limits_{i=1}^n
\]
\[
\sigmaop{g}_{i=1}^n \sum_{i=1}^n
\textstyle \sigmaop{g}\limits_{i=1}^n \sum\limits_{i=1}^n
\scriptstyle \sigmaop{g}\limits_{i=1}^n \sum\limits_{i=1}^n
\]
\end{document}

enter image description here

|improve this answer|||||
  • \resizebox{!}{\dimen@}{\Huge$\m@th\sigma$} would reduce the blackness at least a little bit. – Manuel Jun 19 '15 at 10:19
  • @Manuel I tried it, but as the cmsy font is available only at maximum size of 10pt, there's no gain. – egreg Jun 19 '15 at 10:20
  • @Manuel No difference at all. – egreg Jun 19 '15 at 10:27
  • 1
    @Manuel Yes, I see a tiny difference in positioning; in the picture, the red symbol is built with \Huge: picture The blackness doesn't change. – egreg Jun 19 '15 at 10:36
  • 1
    wouldn't you want the internal "s" scaled similarly in all three instances? the largest version looks okay by itself, but if more than one size is used, the difference is a bit too striking for my taste. – barbara beeton Jun 19 '15 at 13:43
3

Here's an alternative that perhaps provides a more natural syntax. I define \foo as an operator in which \sigma is scaled to the same vertical extent as \sum. Note that \foo operates without any inset lettering. Then I define an auxiliary macro \fooinset{inset} if one wishes an inset a letter inside of \foo. The way I've defined it, normal sub and superscripting (using _ and ^) can be added seamlessly to either \foo or \fooinset{}, in any math style.

\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}
\usepackage{scalerel}
\stackMath
\DeclareMathOperator*{\foo}{\scalerel*{\sigma}{\sum}}
\newsavebox{\foobox}
\newcommand\fooinset[1]{\ThisStyle{\savebox\foobox{$\SavedStyle\foo$}%
  \stackinset{c}{-.11\wd\foobox}{c}{-.5\LMpt}{%
  \scaleto{#1}{.6\ht\foobox}}{\phantom{\SavedStyle\foo}}\kern-\wd\foobox\!}\foo}
\begin{document}
\[
\foo_{i=3}^{6}(f^2(i))
\]
\centering This is inline: \(\foo_{i=3}^{6}(f^2(i)) \)
\[
\fooinset{s}_{i=1}^n x\quad
\textstyle\fooinset{t}_{i=1}^n x\quad
\scriptstyle\fooinset{g}_{i=1}^n x\quad
\scriptscriptstyle\fooinset{s}_{i=1}^n x\quad
\]
\[
\sum_{i=1}^n x\quad
\textstyle\sum_{i=1}^n x\quad
\scriptstyle\sum_{i=1}^n x\quad
\scriptscriptstyle\sum_{i=1}^n x\quad
\]
\end{document}

enter image description here

One can even do stuff as versatile as this:

\[
\fooinset{\frac{x+y}{y}}_{i=1}^n x_i
\]

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy