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)}

And the expression looks like :

I want the characters z onwards to be in a new line, while being the subscript to E.

Thanks!

1

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:

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest