4

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}
\begin{equation} 
\ell_{p}(n)= \sum_{k=1}^{\infty}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2 
\end{equation}
\begin{equation} 
\ell_{p}(n)= \sum_{k\geq1}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2 
\end{equation}
\end{document}

output of example code enter image description here

  • 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 02 '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 02 '13 at 12:50
  • 2
    Don't, leave it as is. There is no reason in readability to make any changes to (2). – daleif Oct 02 '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 02 '13 at 12:57
  • Don't use \genfrac for this; this is a fraction with a pair of delimiters around it, use \left\lfloor\frac{n}{p^j}\right\rfloor (or \Bigl and \Bigr instead of \left and right); \genfrac is not meant to be used in the document, but only in the preamble for definining new symbols. – egreg Oct 02 '13 at 13:45
  • I now uploaded a picture which shows what I mean. (It was not generated with LaTeX.) – Sophia Antipolis Oct 02 '13 at 14:03
  • 2
    To me this just looks strange an inconsistent. – daleif Oct 02 '13 at 14:05
  • 1
    this symbol just doesn't look like a sum. i don't know a single math editor who would accept it. – barbara beeton Oct 02 '13 at 14:31
  • Of course it looks a bit strange because it is just a quick pixel hack only to illustrate what I mean. But it is not inconsistent. Compare with \ell_{p}(n)= \sum_{k\geq1} \left\lfloor\ n / p^{k} \right\rfloor \bmod2 which shows the standard size relation sum-symbol/summand. – Sophia Antipolis Oct 02 '13 at 15:38

2 Answers2

4

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}
\begin{equation}
\ell_{p}(n)= \sum_{k\geq1}\biggl\lfloor\frac{n}{p^k}\biggr\rfloor\bmod 2
\end{equation}
\begin{equation}
\ell_{p}(n)= \sum_{k\geq1}\Bigl\lfloor\frac{n}{p^{k}}\Bigr\rfloor\bmod2
\end{equation}
\begin{equation}
\ell_{p}(n)= \sum_{k\geq1}
  \mathopen{\raisebox{-.15ex}{$\Big\lfloor$}}
  \frac{n}{p^{k}}
  \mathclose{\raisebox{-.15ex}{$\Big\rfloor$}}
  \bmod2
\end{equation}
\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.

enter image description here

egreg
  • 1,121,712
2

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}
\begin{equation} 
\ell_{p}(n)= \sum_{k=1}^{\infty}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2 
\end{equation}
\begin{equation} 
\ell_{p}(n)= \stackunder[1.5pt]{\displaystyle\scalerel*{\sum}{\sum^\infty}}
  {\scriptstyle k\geq1}{{\genfrac{\lfloor}{\rfloor}{}{}{n}{p^{k}}}}\bmod2 
\end{equation}
\end{document}

enter image description here

  • 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 02 '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 02 '13 at 14:26
  • Yes, I will look at the scalerel package. – Sophia Antipolis Oct 02 '13 at 15:40