# Inversion bracket with long text in Latex

How can you write following equation in Latex. Basically I have faced problem with long text

I used

$$\max\limits_{x,\lambda,\nu} L_(x,\lambda,\nu=\left\{ \begin{array}{@{}ll@{}} f(x), & \text{if}\text{if x satisfy the primal condition} \\ \infty, & \text{otherwise} \end{array}\right.$$


I got

• you presumably got an error message that \text is undefined. After (any) error message the pdf output is not usable, and you should ask about the error not show the output. (load the amsmath package to define it) – David Carlisle Dec 18 '19 at 17:15

With the cases* environment from mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

$\theta_{\mathcal{P}}(w) = \begin{cases*} f(w) & if w satisfies primal constraints \\ 0 & otherwise \end{cases*}$
\end{document}


Please note that questions like this is generally frowned upon here as it has the characteristics of a do this for me question. Generally you should show what you have do far. Any good latex instructions should tell you how to construction expressions like this.

\theta_{\mathcal{P}}(w) =
\begin{cases}
f(w) & \text{if $w$ ... }
\\
\infty & \text{otherwise}
\end{cases}


If you want, a day, to use the enviroment array instead of the best specific environment cases or dcases, you can to use this MWE.

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\theta_{\mathcal{P}}(w) = \left\lbrace
\begin{array}{ll}
f(w) & \text{if $w$ satisfy the primal condition}\\
\infty & \text{otherwise}
\end{array}
\right.
\end{equation*}
\end{document}