9

How can I create the following symbol?

enter image description here

PS: It is not the classic \sum_{i=0}^n k

LaRiFaRi
  • 43,807
mle
  • 1,687
  • 3
  • 14
  • 21

3 Answers3

14

At \scriptscriptstyle the output is not satisfying, but I don't think you need it.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\def\mov@rlay#1#2{\leavevmode\vtop{%
   \baselineskip\z@skip \lineskiplimit-\maxdimen
   \ialign{\hfil$\m@th#1##$\hfil\cr#2\crcr}}}
\newcommand{\charfusion}[3][\mathord]{
    #1{\ifx#1\mathop\vphantom{#2}\fi
        \mathpalette\mov@rlay{#2\cr#3}
      }
    \ifx#1\mathop\expandafter\displaylimits\fi}

\newcommand{\sumk}{\charfusion[\mathop]{\sum}{\innerk}}

\newcommand{\innerk}{%
  \mathchoice
    {\mbox{\fontsize\f@size{0}\normalfont\ k}}
    {\mbox{\fontsize\sf@size{0}\normalfont\ k}}
    {\mbox{\fontsize\ssf@size{0}\normalfont\ k}}
    {\mbox{\tiny\normalfont\ k}}%
}
\makeatother

\begin{document}
\[
\sumk\textstyle\sumk\scriptstyle\sumk\scriptscriptstyle\sumk
\]

\[
\sumk_{i=1}^{n} a_{i}
\]
\end{document}

(see my answer to Mathematical symbol for disjoint set union)

enter image description here


A different implementation, where the inner symbol is given as argument.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\sumk}[1]{\mathop{\vphantom{\sum}\mathpalette\sum@k{#1}}}
\newcommand{\sum@k}[2]{%
  \ooalign{%
    \sum@k@vc{#1}{\sum}\cr
    \hidewidth\sum@k@vc{\sum@k@next{#1}}{\mkern8mu#2}\hidewidth\cr}%
}
\newcommand{\sum@k@vc}[2]{%
  $\vcenter{\hbox{$\m@th#1#2$}}$%
}
\newcommand{\sum@k@next}[1]{%
  \ifx#1\displaystyle\displaystyle\fi
  \ifx#1\textstyle\scriptstyle\fi
  \ifx#1\scriptstyle\scriptscriptstyle\fi
  \ifx#1\scriptscriptstyle\scriptscriptstyle\fi
}
\makeatother

\begin{document}
\[
\sumk{k}_{i=1}^n\textstyle\sumk{h}\scriptstyle\sumk{r}
\]
\end{document}

enter image description here

egreg
  • 1,121,712
9
% arara: pdflatex

\documentclass{article}
%\newcommand{\inSum}[1]{\mkern-15mu #1} % if you use that often, you can write \sum_{i=0}^{n}\inSum{j} or alike. Works only in in display math.

\begin{document}
\begin{equation}
\sum_{i=0}^{n}\mkern-16mu \mathrm{k} = \dots
\end{equation}
\end{document}

The \mathrm{} sets the letter in upright style. You may want to take this away, as k can vary and thus is a variable (italic).

Play around with the -16mu to other values, until you like it.

enter image description here

LaRiFaRi
  • 43,807
7

This makes an operator that will do what you wish, with a parameterized style that allows any letter to be put inside the summation:

\documentclass{article}

\usepackage{amsopn}
\newcommand{\suminside}[1]{\operatorname*{\sum \mkern-14mu \makebox[0.77em][l]{\footnotesize #1}}}

\begin{document}

\begin{equation}
\suminside{k}_{i=0}^n a_i = 1
\end{equation}

\begin{equation}
\suminside{d}_{i=0}^n a_i = 2
\end{equation}

\centering
Inline displays as \( \suminside{k}_{i=0}^n a_i = 2 \).

\end{document}

appears as:

Displayed and Inline Equations

cslstr
  • 6,545
  • An adjustment will be needed when it's used in in-line maths. – Gonzalo Medina Mar 09 '14 at 00:46
  • The spacing is not perfect when in-line; limits do behave as they should. This seems to be because of the way the sigma displays differently at the smaller size. – cslstr Mar 09 '14 at 01:20