Different Sum signs

During my research I noticed different sum signs:

The first one is mine and is created by $\sum_{i=1}^n$. The second one is from a paper. Any idea how to write it in LaTeX?

• The left one is from a document with \usepackage{mathptmx} (or similar Times-like font), the right one is with the standard font. – egreg Jun 16 '16 at 15:50

Adapting my answer here, Standard AMS-Sum Operator using MnSymbols?, for mathptmx, you can use either font's sum operator (\sum mathptmx and \Xsum computer modern), while retaining the underlying mathptmx math font.

\documentclass{article}
\usepackage{mathptmx,mathtools}
% =============================================
%Import symbols from font cmex without importing the whole package
% =============================================
\DeclareFontFamily{U} {cmex}{}

\DeclareFontShape{U}{cmex}{m}{n}{
<-6> cmex5
<6-7> cmex6
<7-8> cmex7
<8-9> cmex8
<9-10> cmex9
<10-12> cmex10
<12-> cmex12}{}

\DeclareSymbolFont{Xcmex} {U} {cmex}{m}{n}

\DeclareMathSymbol{\Xdsum}{\mathop}{Xcmex}{88}
\DeclareMathSymbol{\Xtsum}{\mathop}{Xcmex}{80}
\DeclareMathOperator*{\Xsum}{\mathchoice{\Xdsum}{\Xtsum}{\Xtsum}{\Xtsum}}
% =============================================
%\usepackage{fonttable}
\begin{document}
\centering
sum under mathptmx:\par
$\sum_{i=1}^2 x_i$
$\sum_{i=1}^2 x_i$
Defined Xsum from cmex:\par
$\Xsum_{i=1}^2 x_i$
$\Xsum_{i=1}^2 x_i$
%\tiny\fonttable{cmex8}
\end{document}


If one uncomments the two lines in the MWE related to fonttable, one will see the computer-modern math extension font table, showing the text and displaystyle sum signs at slots 80 and 88, which are reflected in my \DeclareMathSymbol declarations.

• \mathchoice isn’t actually necessary: see below. – GuM Jun 16 '16 at 16:43

I’m making this an answer because it doesn’t fit in a comment: the \mathchoice machinery is unnecessary, because the functionality it is aimed to is already built into TeX at “machine level”. See The TeXbook, Appendix G, Rule 13 (the sentence that spans the last two lines on page 443).

\documentclass{article}
\usepackage{mathptmx}
% \usepackage{mathtools} % unrelated to the problem, but...
\usepackage{amsfonts} % ... apparently this line is superfluous if the

% No need to re-declare the cmex fonts under a different encoding:
%
% \DeclareFontFamily{U} {cmex}{}
%
% \DeclareFontShape{U}{cmex}{m}{n}{
%      <-7.5> cmex7
%   <7.5-8.5> cmex8
%   <8.5-9.5> cmex9
%   <9.5->    cmex10
% }{}

\DeclareSymbolFont{Xlargesymbols}{OMX}{cmex}{m}{n}
\DeclareMathSymbol{\Xsum}{\mathop}{Xlargesymbols}{80}

\begin{document}

Sum under \texttt{mathptmx}: $$\sum_{i=1}^2 x_i$$.
Now displayed:$\sum_{i=1}^2 x_i$

Defined \verb|\Xsum| from \texttt{cmex}: $$\Xsum_{i=1}^2 x_i$$.
Now displayed:$\Xsum_{i=1}^2 x_i$

\footnotesize

Repeat in \verb|\footnotesize|.

Sum under \texttt{mathptmx}: $$\sum_{i=1}^2 x_i$$.
Now displayed:$\sum_{i=1}^2 x_i$

Defined \verb|\Xsum| from \texttt{cmex}: $$\Xsum_{i=1}^2 x_i$$.
Now displayed:$\Xsum_{i=1}^2 x_i$

\end{document}


This is the output:

• I don't think that cmex5, cmex6 and cmex12 exist. – egreg Dec 21 '17 at 10:41
• @egreg: Indeed, they don’t. I must have absent-mindedly copied Steven’s code. – GuM Jan 2 '18 at 18:21