19

I have been trying to use the \stackrel and the \underset commands to stack the expressions i=1 and j=1 under the summation symbol. The two commands do not seem to produce the effect I expect: \stackrel makes i=1 smaller than j=1 whereas \underset does the opposite.

I would like i=1 and j=1 to be of the same size. I would appreciate any help in making the two expressions to be of the same size. Here is a minimum working example.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsmath}
\usepackage{babel}

\begin{document}
Stacking indexes using \textbackslash{}stackrel:
\[\sum_{\stackrel{i=1}{j=1}}^{m}x_{i}y_{j}.\]
Stacking indexes using \textbackslash{}underset:
\[\sum_{\underset{j=1}{i=1}}^{m}x_{i}y_{j}.\]
\end{document}
0

1 Answer 1

25

You can use \substack.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsmath}
\usepackage{babel}

\begin{document}
Using \verb|\substack|
\[\sum_{\substack{i=1\\j=1}}^{m}x_{i}y_{j}.\]
Stacking indexes using \textbackslash{}stackrel:
\[\sum_{\stackrel{i=1}{j=1}}^{m}x_{i}y_{j}.\]
Stacking indexes using \textbackslash{}underset:
\[\sum_{\underset{j=1}{i=1}}^{m}x_{i}y_{j}.\]
\end{document}

enter image description here

1
  • Very good examples!! Your helped me very much. Thanks.
    – Silvinha
    Commented Mar 31, 2021 at 13:55

You must log in to answer this question.

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