0

My LaTeX code is here

\documentclass{article}

\begin{equation}
    \nabla_{\theta} \bm{J}(\theta) = \mathbb{E}_{s \sim T^{\bm{\pi}}, a \sim \bm{\pi}_{\theta}} [\nabla_{\theta} \log \bm{\pi}(a | s ) \cdot  Q(s, a) ],
\end{equation}

\end{document}

How can I put the equation in the red box under $\mathbb{E}$ in order to shorten the length of the output?

enter image description here

  • 2
    \underset{s \sim T^{\bm{\pi}}{\mathbb{E}} – Henri Menke Feb 23 '19 at 4:56
3

by use of the stackengine package:

enter image description here

\documentclass{article}
\usepackage{amsmath, amssymb, bm}
\usepackage{stackengine}

\begin{document}

\begin{equation}
    \stackMath
\nabla_{\theta}\bm{J}(\theta)
    = \stackunder{\mathbb{E}}{\substack{s\sim T^{\bm{\pi}},\\
                    a \sim \bm{\pi}_{\theta}}}
    [\nabla_{\theta}\log\bm{\pi}(a|s) \cdot Q(s,a)],
\end{equation}

\end{document}
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.