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}
- 7,931
- 2
- 15
- 31
Here are two further solutions:
Instead of enlarging the summation symbol, shrink the matrix, by using a
psmallmatrixenvironment instead of apmatrixenvironment.Load the
relsizepackage and employ\largerinstructions to enlarge the size of the\sumsymbol. In the code below, I create a macro called\bigsum. By default, the applies\largerthree times, for a total magnification of(1.2)^3=1.728. (Doubling the\sumsymbols 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}
- 506,678
-
-
@Kuttens -- Thanks! :-) What I like about the
\bigsumapproach, as opposed to thensumapproach, 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. – Mico May 03 '18 at 09: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? – gvgramazio May 03 '18 at 09:55
-
@giusva - In LaTeX, if the document font size is 10pt,
\largeis 20% larger than\normalsize,\Largeis 20% larger than\large,\LARGEis 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 factor2has 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. – Mico May 03 '18 at 10:52 -
@giusva - Oddly, when it comes to math typesetting and the choice of scaling factors for subscript- and subsubscript-mode material, a widely used scaling factor (incl. in TeX) is
0.7, not1/1.2=0.833:\scriptsizecorresponds to0.7*\normalsize, and\scriptscriptstyle(text-mode equivalent:\tiny) is0.5\normalsize:0.7*0.7=0.49\approx 0.5. I have no idea if Knuth himself has ever written about how he came up with the1.2factor for upscaling in text mode and the0.7factor for downscaling in math mode. – Mico May 03 '18 at 11:00 -
1If you are intersted in this topic, I've asked a question with this purpouse in mind. – gvgramazio May 03 '18 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.
- 44,045
-
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. – Mico May 03 '18 at 09:41 -
1In case my previous comment was too cryptic: Give
\newcommand\bigsum{\mathop{\vcenter{\hbox{\bigmath ∑}}}\limits}a try. :-) – Mico May 03 '18 at 09:48 -
1Now that you use unicode-math, you could just use the font in the question: Cambria Math – Manuel May 03 '18 at 09:58
-




\sum_k^n \begin{matrix}0&1\\1&1\end{pmatrix}if you're using amsmath. – May 03 '18 at 02:55