Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display two-rows bracket in Latex?

Tags:

latex

Does anyone know how to modify the following string in order to display the two-lines bracket?

str = '$$c_i =\{\begin{array}{l l} 1  \quad L\left(Q_i\right) < 0 \\ 0 \quad L\left(Q_i\right) \geq 0 \\ \end{array}$$';

The current output is the following:

alt text

The sign '{' has to embrace both rows (1 and 0).

like image 200
Niko Gamulin Avatar asked May 14 '10 12:05

Niko Gamulin


2 Answers

$$c_i =\begin{cases} 1 & L\left(Q_i\right) < 0 \\
                     0 &  L\left(Q_i\right) \geq 0
       \end{cases}$$

alt text

The tex file should have \usepackage{amsmath} in the preamble.

like image 74
Niall Murphy Avatar answered Oct 08 '22 19:10

Niall Murphy


This is derived from Niall Murphy's answer, "tidied up" a bit:

\[
c_i =
\begin{cases} 
1 & L (Q_i) < 0 \\ 
0 & L (Q_i) \geq 0 
\end{cases}
\] 

Note that the "\" becomes "\\", and I've removed the \left and \right parenthesis modifiers, which introduce unwanted (I think) space between L and (.

like image 43
Brent.Longborough Avatar answered Oct 08 '22 18:10

Brent.Longborough