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

9
  • 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. Commented Oct 2, 2013 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)). Commented Oct 2, 2013 at 12:50
  • 2
    Don't, leave it as is. There is no reason in readability to make any changes to (2).
    – daleif
    Commented Oct 2, 2013 at 12:57
  • 2
    To me this just looks strange an inconsistent.
    – daleif
    Commented Oct 2, 2013 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. Commented Oct 2, 2013 at 14:31

2 Answers 2

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

1
  • The third is the most balanced solution proposed so far. I choose it for now. Commented Oct 2, 2013 at 15:42
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

3
  • 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. Commented Oct 2, 2013 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. Commented Oct 2, 2013 at 14:26
  • Yes, I will look at the scalerel package. Commented Oct 2, 2013 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .