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?
Best Answer
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}% LaTeX can find displaystyle
\DeclareMathSymbol{\Xsum}{\mathop}{Xcmex}{80}
% =============================================
%\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.
\begin{alignat*}{2}
\sum a &\le &\sum b &\le \sum c \\
\log \sum a &\le{} &\log \sum b &\le \log \sum c
\end{alignat*}
produces:
I needed to add two extra alignment characters between the columns, and a {} to make the \le a binary operator. The number of &'s should be 2n-1 where n is the argument given (2 in the case above).
Although now that I read the question again I realize I didn't answer it. It seems that you want the \sum term to be centered...
The only way I can think of doing it is a bit ugly:
\newlength{\yuckkyhack}
\settowidth{\yuckkyhack}{$\displaystyle\log \sum b$}
\begin{alignat*}{2}
\sum a &{}\le{} &\makebox[\yuckkyhack]{$\displaystyle\sum b$} {}&\le \sum c \\
\log \sum a &\le{} &\log \sum b &\le \log \sum c
\end{alignat*}
which gives the desired result (I think):
but requires manual selection of the largest bit of text, and use of a length...any ideas for improvement?
The reason is the different height of the subscripts, t is smaller than k. One way to fix this (not beautiful, I know) is to put an invisible k below the first sum via \vphantom:
Best Answer
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 underlyingmathptmx
math font.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.