2

I am running this code for an equation that runs over into the margins:

\begin{eqnarray}
        N(t,x) &=& \inf_{u_{I+1} \in [-u_{I+1}, w_{I+1}], T_{I+1} \in \Real_+} \left\{ \inf_{u_I \in [-u_I, w_I], T_I \in \Real_+} \left\{ c(t - T_I-T_{I+1}, x + T_Iu_I+T_{I+1}u_{I+1})\\          
        &+& T_I\varphi_I(u_I) + T_{I+1}\varphi_{I+1}(u_{I+1}) \right\} \right\} \nonumber
\end{eqnarray}

Which gives:

enter image description here

and I keep getting myriad errors:

Extra }, or forgotten \right. &
Missing \right. inserted. &
Missing \right. inserted. &
Missing } inserted. &
Missing } inserted. ..._I) + T_{I+1}\varphi_{I+1}(u_{I+1}) \right
Extra \right. ...) + T_{I+1}\varphi_{I+1}(u_{I+1}) \right\}
Extra \right. ...1}\varphi_{I+1}(u_{I+1}) \right\} \right\}
Incomplete \ifcase; all text was ignored after line 64. \end{eqnarray}
Missing $ inserted. \end{eqnarray}
Extra alignment tab has been changed to \cr. \end{eqnarray}
Extra \or. \end{eqnarray}
Extra \or. \end{eqnarray}
Forbidden control sequence found while scanning definition of \reserved@a. \end{eqnarray}
Extra alignment tab has been changed to \cr. \end{eqnarray}
Extra \else. \end{eqnarray}
Missing $$ inserted. \end{eqnarray}
Too many columns in eqnarray environment. \end{eqnarray}
Extra \fi. \end{eqnarray}

I am not sure how to extend the double brackets across two lines.

Jacob
  • 23
  • 5

3 Answers3

7

Another possibility with geometry and \substack + the aligned environment:

\documentclass{article}
\usepackage{mathtools}
\usepackage{geometry}

\begin{document}

\begin{equation}%
N(t,x) = \inf_{\substack{u_{I+1} \in [-u_{I+1}, w_{I+1}],\\ T_{I+1} \in \mathbf{R}_+}} \Biggl\{ \inf_{\substack{u_I \in [-u_I, w_I],\\ T_I \in \mathbf{R}_+}} \Biggl\{\begin{aligned} c(t - T_I-T_{I+1}, x + T_Iu_I+T_{I+1}u_{I+1})\\
    {}+ T_I\varphi_I(u_I) + T_{I+1}\varphi_{I+1}(u_{I+1})
    \end{aligned} \Biggr\} \Biggr\}%
 \end{equation}

\end{document}

enter image description here

Bernard
  • 271,350
  • 2
    +1 for the use of \substack. :-) I might be tempted to use a gathered environment for the material inside the inner curly brace, and I'd prefix {} to + T_I\varphi_I(u_I) in order to get TeX to treat + as a binary rather than as a unary operator. – Mico Nov 26 '21 at 20:15
  • 1
    @Mico: Semantically, I prefer a right alignment. For the spacing of +, you're right, and I'll fix it in a moment. I was mislead because initially, I didn't remove the \vphantom, and moved the + afterwards. – Bernard Nov 26 '21 at 20:20
3

This will work (more or less), but your first line is too long:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{eqnarray}
        N(t,x) &=& \inf_{u_{I+1} \in [-u_{I+1}, w_{I+1}], T_{I+1} \in \mathbf{R}_+} \left\{ \inf_{u_I \in [-u_I, w_I], T_I \in \mathbf{R}_+} \left\{ c(t - T_I-T_{I+1}, x + T_Iu_I+T_{I+1}u_{I+1})\right.\right.\\          
        &+& \left.\left.\vphantom{\inf_{u_I \in [-u_I, w_I], T_I \in \mathbf{R}_+}}T_I\varphi_I(u_I) + T_{I+1}\varphi_{I+1}(u_{I+1}) \right\} \right\} \nonumber
\end{eqnarray}
\end{document}

You shall get this:

enter image description here

By the way, I urge you to use align instead of eqnarray.

3

A variation of nice @Bernard answer with use multlined for right side of equation and \left\{ and \right\} for outer brace:

\documentclass{article}
\usepackage{mathtools}
\usepackage{geometry}

\begin{document} \begin{equation}% N(t,x) = \inf_{\substack{u_{I+1} \in [-u_{I+1}, w_{I+1}],\ T_{I+1} \in \mathbf{R}+}} \left{ \inf{\substack{u_I \in [-u_I, w_I],\ T_I \in \mathbf{R}+}} \Biggl{\begin{multlined} c(t - T_I-T{I+1}, x + T_Iu_I+T_{I+1}u_{I+1})\ {}+ T_I\varphi_I(u_I) + T_{I+1}\varphi_{I+1}(u_{I+1}) \end{multlined} \Biggr} \right} \end{equation} \end{document}

enter image description here

egreg
  • 1,121,712
Zarko
  • 296,517