4

I am trying to insert this expression in my Latex file:

enter image description here

When I start entering :

\begin(cases) 

I got an error saying “ unrecognizable environment “

I tried this ( nested arrays) :

MA_{c_1,c_2}(i,j)=\left\{\begin{array}{lr}
Max(i,j), &\text{if min(i,j)=0}\\
Min & {\begin {array} {lr}
\end{array}
\end{array} 

When I start the nested array , document review disappeared.

I need help “coding” this expression in Latex .

I am using Texstudio as a Latex editor.

4
  • 1
    Used editor is not relevant to your problem. Please show us what you try so far.
    – Zarko
    Commented Nov 16, 2019 at 2:09
  • I searched online i found this command (\begin(cases)) , but this command is not available in Latex ..l
    – Paulo
    Commented Nov 16, 2019 at 2:11
  • of course, it is :-) . Of course, t should not be enclosed in parenthesis.
    – Zarko
    Commented Nov 16, 2019 at 2:22
  • Are the lower brackets really cases, or is it just the minimum of three different expressions? In the latter case I would typeset the formula in a way that this gets reflected.
    – user194703
    Commented Nov 16, 2019 at 3:01

2 Answers 2

6
\documentclass[margin=3mm, varwidth]{standalone}
\usepackage{mathtools}% for cases*, also load amsmath

\begin{document}
\begin{equation}\setlength\arraycolsep{1pt}
xxx = \begin{cases*}
    \max(t,f) & if $\min(t,f) = 0$   \\
\min\left\{\begin{array}{rl}
    xxx & + 1 \\
    xxx & + 1 \\
xxx xxx & + 1 \\
    \end{array}\right. &  otherwise
        \end{cases*}
\end{equation}
\end{document}

enter image description here

0
1

Your text is very hard to read (which is why most likely some characters are misrepresented below). Yet I could not make sense of having \min in front of cases. So I am wondering if the lower part, i.e. the second case, is the minimum of a list. If so, maybe the following is more appropriate.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
 MA_{C_0f_0}(i,j)=
 \begin{dcases}
  \max(i,j) & \text{if}~\min(i,j)=0\;,\\
  \begin{array}{@{}r@{}l@{}l@{}}
  \min\bigl\{
    &MA_{C_0f_0}(i-1,j)+1,\\
    &MA_{C_0f_0}(i,j-1)+1,\\
    &MA_{C_0f_0}(i-1,j-1)+1\bigr\}\\
  \end{array}& 
  \text{otherwise}\;.
 \end{dcases}
\end{equation}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .