I want to represent the following sum in LaTeX.
I have tried it in the following way:
$$\sum_{{1 \le k \le n}_{ k odd}} k^2$$
But I have not got the desired result. Please help me.
You need to load the amsmath
package and employ its \substack
directive.
\documentclass{article}
\usepackage{amsmath}
\usepackage{newpxtext} % Palatino text font
\usepackage[euler-digits]{eulervm} % Euler math font
\begin{document}
\[
\sum_{\substack{1 \le k < 100 \\ \textup{$k$ odd}}} k^2
\]
\end{document}
\text
to \textup
. (We don't know if the default text font is sans-serif -- in which case "odd" would look, well, odd, if it were typed in the roman font face...)
$$
, use\[ ... \]
. (and for good measure, read theamsmath
users guide {texdoc amsldoc
).