-1

My code is

\(\displaystyle
\sum^{n}_{\stackrel{0<i<n} 
{j\subseteq i}} P(i,j) = Q(i,j)\)

but this is giving me an output like,

enter image description here

Where is the problem?

6
  • 2
    Add \limits after \sum.
    – user121799
    Dec 11, 2017 at 15:15
  • 3
    Please add a complete MWE showing you problem, your code snippet works fine with me!!
    – AboAmmar
    Dec 11, 2017 at 15:18
  • Welcome to TeX.SE!
    – Cragfelt
    Dec 11, 2017 at 15:19
  • 3
    @marmot why would you need explicit \limits in displaystyle? Dec 11, 2017 at 15:30
  • 2
    you have accepted an answer but the neither your question nor the answer explain how you could have the non-limits setting from \sum in displaystyle. Dec 11, 2017 at 15:34

2 Answers 2

5

The input that you show would not produce the output that you how, in displaystyle the sub and superscript on \sum are set a s limits, above and below. It is rather rare to need explicit \displaystyle as that is the default style in display math, finally as shown in your output \stackrel is not designed for subscripts and produces different size for the first and second rows.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[\sum^{n}_{\substack{0<i<n\\j\subseteq i}} P(i,j) = Q(i,j)\]

\end{document}
3
  • 1
    @tomacs but then the answer to the question in the title "What am I doing wrong in \displaystyle?" would be "you did not use \displaystyle" Dec 11, 2017 at 15:59
  • My suspicion is that the OP is using package nath. This package conflicts with package amsmath. Dec 11, 2017 at 19:10
  • @HeikoOberdiek ohh the ---force--- crystal ball is string with you today:-) Dec 11, 2017 at 21:17
2

I can reproduce the problem if package nath is loaded and the latest closing curly brace is moved to the end of the math formula:

\documentclass{article}
\usepackage{nath}
\begin{document}

\(\displaystyle
\sum^{n}_{\stackrel{0<i<n}
{j\subseteq i} P(i,j) = Q(i,j)}\)

\end{document}

Recreated question image

Remarks:

  • \displaystyle is redefined by package nath, see "§8 Displayed fractions" in the documentation. The package provides \displayed{...}:

  • According to "§11 Operators", \\ can be used to start a new line in subscripts of big operators. The wrong \stackrel is not needed.

The corrected version with nath:

\documentclass{article}
\usepackage{nath}
\begin{document}

\(
  \displayed{
    \sum^{n}_{0<i<n \\ j\subseteq i}
    P(i,j) = Q(i,j)
  }
\)

\end{document}

Corrected result

You must log in to answer this question.

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