8

In some case limits and nolimits need to be used together, e.g. an expression \prod\nolimits^{B}\limits_{x \in X}, in which B is in the right-upper corner and x \in X under the \prod, is not displayed it should be, B is displayed above the \prod, not in the right-upper corner. How to resolve this?

Popopo
  • 831

2 Answers2

12

The amsmath package provides \sideset:

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

\[
\sideset{}{^{B}}\prod_{x \in X}A_{x}
\]

\end{document}

enter image description here

You may want to define your own command:

\newcommand{\prodB}{\sideset{}{^{B}}\prod}
egreg
  • 1,121,712
6

enter image description here

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

\[
{\prod_{\mathclap{x \in X}}}^{B}
\]
\end{document}
David Carlisle
  • 757,742
  • Using \mathclap may give undesirable spacing when the subscript is large. – Aditya Mar 31 '13 at 18:58
  • @Aditya true (it hides the size of the subscript) although if you don't do anything it pushes B to the right if the subscript is wider than the base. sideset as in egregs answer is another possibility. – David Carlisle Mar 31 '13 at 19:51
  • 1
    You can use \smashoperator{\prod_{x \in X}} instead of that mathclap. – Manuel Mar 31 '13 at 19:57