Want to write a summation symbol in the similar form in the attachment. Please advice.
3 Answers
\documentclass[]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}
% https://tex.stackexchange.com/questions/22773/making-a-big-summation-sign
\newcommand{\nsum}[1][1.4]{
\mathop{%
\raisebox
{-#1\depthofsumsign+1\depthofsumsign}
{\scalebox
{#1}
{$\displaystyle\sum$}%
}
}
}
\begin{document}
\[
\sum_k^n \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \nsum[2]_k^n \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
\]
\end{document}
Here are two further solutions:
Instead of enlarging the summation symbol, shrink the matrix, by using a
psmallmatrix
environment instead of apmatrix
environment.Load the
relsize
package and employ\larger
instructions to enlarge the size of the\sum
symbol. In the code below, I create a macro called\bigsum
. By default, the applies\larger
three times, for a total magnification of(1.2)^3=1.728
. (Doubling the\sum
symbols seems excessive to me...)
The following code also re-implements the \nsum
macro shown in @caverac's answer, so that TeX does all the hard work, mainly via a \vcenter
instruction. This seems nicer than performing several length calculations and then employing a \raisebox
instruction.
\documentclass{article}
\usepackage{mathtools} % for 'pmatrix' environment
\usepackage{relsize} % for '\larger' macro
\usepackage{graphicx} % for '\scalebox' macro
\newcommand\nums{0 & 1 \\ 1 & 0} % handy shortcut macro
% default enlargement applied by `\bigsum`: 3 steps of 1.2
\newcommand\bigsum[1][3]{\mathop{\vcenter{\hbox{%
\larger[#1]{$\displaystyle\sum$}}}}}
% reimplementation of '\nsum': make TeX do all the hard work
\newcommand{\nsum}[1][1.44]{\mathop{\vcenter{\hbox{% % 1.44=(1.2)^2
\scalebox{#1}{$\displaystyle\sum$}}}}}
\begin{document}
\[
\sum_k^n \begin{psmallmatrix} \nums \end{psmallmatrix}
= \sum_k^n \begin{pmatrix} \nums \end{pmatrix}
= \bigsum_k^n \begin{pmatrix} \nums \end{pmatrix}
= \nsum[1.728]_k^n \begin{pmatrix} \nums \end{pmatrix} % 1.728=(1.2)^3
\]
\end{document}
-
-
@Kuttens -- Thanks! :-) What I like about the
\bigsum
approach, as opposed to thensum
approach, is that it gives an explicit nod to the typographic principle that when scaling objects and symbols, it's rarely a good idea to use arbitrary scaling factors. Given that many TeX fonts are organized around geometric progressions with a scaling factor of 1.2, it's usually a good starting point to choose powers of 1.2 as well.– MicoMay 3, 2018 at 9:44 -
@Mico I'm interested to the organization of fonts around the geometric progressions with a scaling factor of two. I never heard of this thing. Have you perhaps some reference? May 3, 2018 at 9:55
-
@giusva - In LaTeX, if the document font size is 10pt,
\large
is 20% larger than\normalsize
,\Large
is 20% larger than\large
,\LARGE
is 20% larger than\Large
, etc. The 20% steps are not unique to LaTeX. Why 20% and not, say, 15% or 25%? I've never found an explicit reference on this topic; however, I suspect that 20% came about in part because 1.2 is quite close to the 4th root of 2. (1.189^4=2
) Since the factor2
has special significance in many parts of Western culture, incl. music, I think it's not surprising that some typographers chose 1.2 as a basic scaling factor.– MicoMay 3, 2018 at 10:52 -
1If you are intersted in this topic, I've asked a question with this purpouse in mind. May 3, 2018 at 11:18
In unicode-math
, you can load another copy of a math font with the scale=
parameter to increase the size of a math symbol. This would be wrapped in several different macros to insert the glyph from text mode and treat it as a math operator with limits above and below. Based on suggestions in the comments, this also centers the symbol vertically and sets the font to Cambria Math, although scaled Cambria Math gives a summation symbol that’s thicker than you wanted.
\documentclass[varwidth, preview]{standalone}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{Cambria}
\setmathfont{Cambria Math}
\newfontface\bigmath{Cambria Math}[Scale=3.0]
\newcommand\bigsum{\mathop{\vcenter{\hbox{\bigmath ∑}}}\limits}
\begin{document}
\(
\bigsum_k^n \begin{pmatrix}0&1\\1&1\end{pmatrix}
\)
\end{document}
You could vary the scale=
parameter using the font features commands from fontspec
, although if you want a specific height, you probably want a \resizebox
from graphicx
.
-
2Note that in your current solution, the large summation symbol is placed on the (text) baseline instead of being centered vertically on the mathline. One could employ a
\vcenter{\hbox{...}}
wrapper in order to get the (vertical) centering right.– MicoMay 3, 2018 at 9:41 -
1In case my previous comment was too cryptic: Give
\newcommand\bigsum{\mathop{\vcenter{\hbox{\bigmath ∑}}}\limits}
a try. :-)– MicoMay 3, 2018 at 9:48 -
1Now that you use unicode-math, you could just use the font in the question: Cambria Math– ManuelMay 3, 2018 at 9:58
-
\sum_k^n \begin{matrix}0&1\\1&1\end{pmatrix}
if you're using amsmath.