My code is

\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) ],


And I want to break {s \sim T^{\bm{\pi}}, a \sim \bm{\pi}_{\theta}} into two lines, not put it under \mathbb{E}. In the picture below, how to move the second part after the comma and stack under the first part?

enter image description here

How can I do that? Thank you in advance.

  • Off-topic: To "snug up" the \nabla and \theta symbols, consider writing \nabla_{\!\theta}. The \! (negative thinspace) directive moves the subscript term to the left, i.e., closer to the \nabla symbol. – Mico Feb 23 '19 at 6:34
  • Possible duplicate of Putting equations under a symbol – Zarko Feb 23 '19 at 12:12

I suggest you do two things:

  • Using \DeclareMathOperator, make \E a "math operator"

  • Use the \substack macro to break the long line into two parts.

Both of these directives require loading of the amsmath package -- which you may be doing already.

enter image description here

\usepackage{amsmath}  % for '\DeclareMathOperator' and '\substack' macros
\usepackage{amssymb}  % for '\mathbb' macro
\usepackage{bm}       % for '\bm' macro
\DeclareMathOperator{\E}{\mathbb{E}} % define expectations operator

\nabla_{\!\theta} \bm{J}(\theta) = 
\E_{\substack{s \sim T^{\bm{\pi}}\\ a \sim \bm{\pi}_{\theta}}}
[\nabla_{\!\theta} \log\bm{\pi}(a\mid s ) \cdot Q(s,a) ]
| improve this answer | |

Your Answer

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

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