0

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

I used

\begin{equation}

  \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.

\end{equation}

I got

enter image description here

  • 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
4

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} 

enter image description here

4

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}
1

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.

enter image description here

\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}

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.