1

I have a long formula , I use autobreak as follows,but it doesn't work

\begin{align}
\begin{autobreak}
{E_{{S_{t + 1}}}}\left[ {\left. {E\left[ {\left. {{G_{t + 1}}} \right|{S_t},{S_{t + 1}}} \right]} \right|{S_{t + 1}}} \right] = {E_{{S_{t + 1}}}}\left[ {\left. {E\left[ {\left. {{G_{t + 1}}} \right|{S_{t + 1}}} \right]} \right|{S_{t + 1}}} \right] = \sum\limits_{{S_{t + 1}}} {P\left( {\left. {{S_{t + 1}}} \right|{S_t}} \right)V\left( {{S_{t + 1}}} \right)} 
\end{autobreak}
\end{align}

It still overflows the page,how to let long formula breakline?

Is there some useful and general template how to insert formula into document?That solve these problems?

4
  • 1
    Duplicate of autobreak not working if left and right delimeter breaks but that also has no answer. Sep 21 '19 at 2:48
  • @Henri Menke , maybe my problem is not the same as this,since I don't have \left ,\right. And I have an additional question,a "perfect" template for equation.
    – yi li
    Sep 21 '19 at 2:54
  • Ctrl+F "\left": 11 matches. ??? Sep 21 '19 at 2:55
  • Oh...you are right. my ignorant eye
    – yi li
    Sep 21 '19 at 2:59
1

You can use multline or align, take your pick.

However you should drop all \left and \right here, and also the useless braces. For the outer brackets, \bigl[ and \bigr] suffice.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{multline}
E_{S_{t + 1}}\bigl[E[G_{t + 1}\mid S_t,S_{t + 1}] \mid S_{t + 1}\bigr] \\
=E_{S_{t + 1}}\bigl[E[G_{t + 1}\mid S_{t + 1}] \mid S_{t + 1}\bigr] =
\sum_{S_{t + 1}} P(S_{t + 1}\mid S_t) V(S_{t + 1})
\end{multline}

\begin{align}
E_{S_{t + 1}}\bigl[E[G_{t + 1}\mid S_t,S_{t + 1}] \mid S_{t + 1}\bigr]
&=E_{S_{t + 1}}\bigl[E[G_{t + 1}\mid S_{t + 1}] \mid S_{t + 1}\bigr] \notag \\
&=\sum_{S_{t + 1}} P(S_{t + 1}\mid S_t) V(S_{t + 1})
\end{align}

\end{document}

enter image description here

Another possibility is split:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{split}
E_{S_{t + 1}}\bigl[E[G_{t + 1}\mid S_t,S_{t + 1}] \mid S_{t + 1}\bigr]
  &=E_{S_{t + 1}}\bigl[E[G_{t + 1}\mid S_{t + 1}] \mid S_{t + 1}\bigr] \\
  &=\sum_{S_{t + 1}} P(S_{t + 1}\mid S_t) V(S_{t + 1})
\end{split}
\end{equation}

\end{document}

enter image description here

1

I wouldn't use autobreqak environment. With manual breaking of your equation (using split environment and \MoveEqLeft function from amsmath package

\documentclass{article}
\usepackage{mathtools}
%\usepackage{autobreak}

\begin{document}
\begin{equation}
\begin{split}
    \MoveEqLeft
E_{S_{t + 1}} \bigl[E [G_{t + 1} \big| S_t, S_{t + 1}] \big| S_{t + 1} \bigr]       \\
    & = E_{S_{t + 1}}\bigl[E [ G_{t + 1} \big| S_{t + 1} ] \big| S_{t + 1} \bigr]
      = \sum_{S_{t + 1}} P\bigl(S_{t + 1} \big| S_t \bigr) V(S_{t + 1})
\end{split}
\end{equation}
\end{document}

enter image description here

Addendum: one more solution, using multlined from the package mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{equation}
\begin{multlined}[0.8\linewidth]
E_{S_{t + 1}} \bigl[E [G_{t + 1} \big| S_t, S_{t + 1}] \big| S_{t + 1} \bigr]       \\
     = E_{S_{t + 1}}\bigl[E [ G_{t + 1} \big| S_{t + 1} ] \big| S_{t + 1} \bigr]
     = \sum_{S_{t + 1}}P\bigl(S_{t + 1} \big| S_t \bigr) V(S_{t + 1})
\end{multlined}
\end{equation}
\end{document}

enter image description here

(red lines indicate text borders)

1
  • It seems quite nice ,thx
    – yi li
    Sep 21 '19 at 7:42

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.