# Stretch mathematical symbols in mathmode

For an exercise I have to stretch the summation and other symbols vertically like As you see does the size not change horizontally. Any suggestions on how to do this? I've been looking for quite some time now :/

*note I don't have the code of this picture the exercise is about finding out how to remake this picture.

• How do you stretch it vertically? – egreg Jan 6 '14 at 20:48
• That's what I would like to know, I have to remake this example as exercise – Lukas Jan 6 '14 at 21:00
• Why do you need to stretch them? For subtract readability to the expressions? Take into account that the symbols and letters are designed to be read as they appear, to deform and lose legibility are at risk for becoming parodies drawn wrong. You should find another typographical solution that doesn't compromise the integrity of the characters and symbols. – Aradnix Jan 6 '14 at 21:01
• I find this also quite useless but it's an exercise for school and I have to remake that line. I know it's really impractical :/ and I'd never use it in the future... – Lukas Jan 6 '14 at 21:06
• @Lukas: Could you provide the code that you used to provide the picture in your post? Also, provide a picture of what you're after. – Werner Jan 6 '14 at 21:10

Like this? Of course, since this is an exercise, I shouldn't disclose the code I produced the image with. ;-)

The basis is, of course, \resizebox{1}[1.6]{...} from the graphicx package. However, proper positioning is not really easy, but not terribly difficult either.

Well here's the commented code

\documentclass{article}
\usepackage{graphicx,calc,amsmath}
\newcommand{\ssum}{%
\mathop{%
% get the dimensions of \sum in \displaystyle
\sbox0{$\displaystyle\sum$}%
% lower the stretched \sum by its height and raise it by the height
% of the unstretched symbol; give it the height it should have
% and the right depth
\raisebox{-\height+\ht0}[\ht0][\dp0]{\scalebox{1}[1.6]{\copy0}}%
}\displaylimits
}
\newcommand{\sbrace}{%
#1{% #1 is either \mathopen or \mathclose, #2 is \lbrace or \rbrace (or any delimiter)
% get the dimensions of the unstretched delimiter so that
% it covers \sum with subscript and superscript
\sbox0{$\displaystyle\left#2\vphantom{\sum_{i=1}^{n}}\right.\kern-\nulldelimiterspace$}%
% as before, place the symbol, but in this case we want its
% depth to be zero; the stretching is somewhat different
\raisebox{-\height+\ht0}[\ht0][0pt]{\scalebox{1}[1.7]{\copy0}}%
}%
}
\newcommand{\slbrace}{\sbrace{\mathopen}{\lbrace}} % stretched left brace
\newcommand{\srbrace}{\sbrace{\mathclose}{\rbrace}} % stretched right brace

\begin{document}
$0=\ssum_{i=1}^{n} m(X_{i},\hat{\theta}_{i}) =\ssum_{i=1}^{n} m(X_{i},\hat{\theta}_{0}) +\slbrace \ssum_{i=1}^{n}\frac{\partial m(X_{i},\theta^{*}_{n})}{\partial \theta^{T}} \srbrace (\hat{\theta}_{n}-\theta_{0}).$
\textbf{\qquad l 2} \emph{Omdat $\hat{\theta}_{n}\xrightarrow{p}\theta^{*}_{0}$
en $\theta^{*}_{0}$ een waarde is die tussen $\hat{\theta}_{n}$ en
$\theta^{*}_{0}$ ligt, zal}
\end{document}


I'm not sure if a student is really supposed to know all that, but maybe the instructor will learn something. ;-)

• Plus one for the last comment ;) – Hasan Zakeri Jan 6 '14 at 22:57

Revised for both sigma distortion and brace distortion:

\documentclass{article}
\usepackage{scalerel}
\usepackage{stackengine}
\stackMath
\newcommand\ssum{\stackunder[1pt]{\stackunder[-7pt]{%
\stackon[1.5pt]{\displaystyle\stretchrel*{\sum}{\sum_{i_x}}}{\scriptstyle n}%
}{\scriptstyle i=1}#1}{\rule{0ex}{3ex}}%
}
\begin{document}
$0 = \ssum{m(X_i,\hat\theta_n)} + \ssum{m(X_i,\theta_0)} + \stretchleftright{\{}{\ssum{\frac{\partial m(X_i,\hat\theta_n^*)}{\partial\theta^T}}}{\}}% (\hat\theta_n - \theta_0)$
\end{document} • @Lukas I reedited the result to achieve compaction. – Steven B. Segletes Jan 7 '14 at 1:17