New Line in Subscript in Share Latex
I Am Trying to Shift This Extra Long Subscript to the Line Below, Because It Is Too Long. the Code Is \Mathop{\Mathbb{E}}_{X \In P_{Data}(X), Z \In P_{Z}(Z)}...
I am trying to shift this extra long subscript to the line below, because it is too long. The code is
\mathop{\mathbb{E}}_{x \in p_{data}(x), z \in p_{z}(z)}
And the expression looks like :
I want the characters z onwards to be in a new line, while being the subscript to E.
Thanks!
3 Answers
you are looking for substack
\mathbb{E}}_{\substack{x \in p_{data}(x)\\z \in p_{z}(z)}}
There are three different specific ways to do this (one command substack and one environment subarray with at least two different alignment options l and c), provided by the package amsmath (see section 7.1 of the guide, at page 21). All of them work in inline math mode as well. To type your code, the package amssymb is necessary too (although \mathop{\mathbb{E}} is maybe redundant).
This code
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
\[
\mathop{\mathbb{E}}_{\substack{x \in p_{data}(x),\\ z \in p_{z}(z)}}
\]
\[
\mathop{\mathbb{E}}_{\begin{subarray}{l}x \in p_{data}(x),\\ z \in p_{z}(z)\end{subarray}}
\]
\[
\mathop{\mathbb{E}}_{\begin{subarray}{c}x \in p_{data}(x),\\ z \in p_{z}(z)\end{subarray}}
\]
\end{document}
gives this output:
Instead of \mathop directive you can use the following:
$\mathbb{E}}_{x \in p_{data}(x),$
$z \in p_{z}(z)}$
Which will render this:
Another alternative
$\mathbb{E}}_{x \in p_{data}(x),$
$_{z \in p_{z}(z)}}$
which will render into: