# how to represent Sum in latex [duplicate]

This question already has an answer here:

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.

## marked as duplicate by Mico math-mode StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 4 '18 at 15:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

## 1 Answer

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}

• @barbarabeeton - Thanks for this. I changed \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...) – Mico Apr 4 '18 at 15:28
• What is \usepackage[euler-digits]? – Sebastiano Apr 4 '18 at 21:23
• @Sebastiano - euler-digits is an option passed to the package eulervm. I included the font-related directives in order to replicate the "look" of the OP's screenshot. – Mico Apr 4 '18 at 21:43