# How to change the height of the sum sign

I would prefer to write the definition as in equation (2). However the sum sign is too low in this case. Is there a way to make it higher?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\ell_{p}(n)= \sum_{k=1}^{\infty}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2$$
$$\ell_{p}(n)= \sum_{k\geq1}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2$$
\end{document}


• it is traditionally expected that a sum will be aligned consistently with its center at the math axis, as is obvious here next to the equals sign. although it's possible (by a hack) to move it upward, someone reading it would notice something strange. – barbara beeton Oct 2 '13 at 12:36
• I do not want it to move upward. I would like it to fill the space which was kept free for the upper limit in the traditional setting. (Note that the infinity-limit is not appropriate here since it is in fact a finite sum runnig over a fixed prime.) For my untrained eyes the sum sign should dominate the formula right of it (as it does in (1)). – Sophia Antipolis Oct 2 '13 at 12:50
• Don't, leave it as is. There is no reason in readability to make any changes to (2). – daleif Oct 2 '13 at 12:57
• if i understand correctly, then, you want to change the shape of the sum. do you simply wish to make the whole symbol larger, or just the upper part? (if the whole symbol is made larger -- relatively easy, but a hack --, the lower limit will move lower unless the sum is still vertically centered as expected.) – barbara beeton Oct 2 '13 at 12:57
• To me this just looks strange an inconsistent. – daleif Oct 2 '13 at 14:05

Don't use \genfrac for this. The command is useful in the preamble to define other commands in terms of it, not in the document.

I can offer you three proposals:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\ell_{p}(n)= \sum_{k\geq1}\biggl\lfloor\frac{n}{p^k}\biggr\rfloor\bmod 2$$
$$\ell_{p}(n)= \sum_{k\geq1}\Bigl\lfloor\frac{n}{p^{k}}\Bigr\rfloor\bmod2$$
$$\ell_{p}(n)= \sum_{k\geq1} \mathopen{\raisebox{-.15ex}{\Big\lfloor}} \frac{n}{p^{k}} \mathclose{\raisebox{-.15ex}{\Big\rfloor}} \bmod2$$
\end{document}


I would probably choose the middle one. Changing the size of \sum is not the answer.

And surely I'd use \ell for no purpose whatsoever.

• The third is the most balanced solution proposed so far. I choose it for now. – Sophia Antipolis Oct 2 '13 at 15:42

The OP requested "I would like it to fill the space which was kept free for the upper limit in the traditional setting."

I do not recommend this approach and concur wholeheartedly with barbara and daleif. However, being an accommodating fellow, I tried to satisfy your request. Perhaps seeing it here will convince you why it is not the best of ideas.

\documentclass{article}
\usepackage{amsmath}
\usepackage{scalerel}
\usepackage{stackengine}
\stackMath
\begin{document}
$$\ell_{p}(n)= \sum_{k=1}^{\infty}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2$$
$$\ell_{p}(n)= \stackunder[1.5pt]{\displaystyle\scalerel*{\sum}{\sum^\infty}} {\scriptstyle k\geq1}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2$$
\end{document}


• It is not perfect yet, but with some fiddling (or Metafont?) it comes close to what I mean. A shorter variant of lfloor and rfloor would also help. – Sophia Antipolis Oct 2 '13 at 14:18
• @SophiaAntipolis As far as the floors, I would look to egreg's advice. As to the sum sign, I made it to replace the same vertical footprint as \sum^\infty. There is a \scaleto command in that package which scales an object to a specified vertical size; however, it would place the result on the baseline, which would need to be \raiseboxed in the case of a summation sign. – Steven B. Segletes Oct 2 '13 at 14:26
• Yes, I will look at the scalerel package. – Sophia Antipolis Oct 2 '13 at 15:40