'How to display two-rows bracket in 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:
The sign '{' has to embrace both rows (1 and 0).
Solution 1:[1]
$$c_i =\begin{cases} 1 & L\left(Q_i\right) < 0 \\
0 & L\left(Q_i\right) \geq 0
\end{cases}$$
The tex file should have \usepackage{amsmath}
in the preamble.
Solution 2:[2]
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 (.
Solution 3:[3]
Try add \left
before \{
and \rigth.
at the end.
It should look like
$$\alpha_t = \left \{ {{\sqrt{\frac1N},\; t = 0 } \atop {\sqrt{\frac2N},\; t \ne 0 } } \right.$$
or
$$
\left\{\begin{tabular}{l} \textbf{Y} = 0,299\textbf{R} + 0,587\textbf{G} + 0,114\textbf{B} \\ \textbf{Cb} = 128 + 0,5\textbf{R} - 0,418688\textbf{G} - 0,081312\textbf{B} \\ \textbf{Cr} = 128 - 0,168736\textbf{R} - 0,331264\textbf{G} - 0,53\textbf{B} \end{tabular} \right.
$$
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Glorfindel |
Solution 2 | |
Solution 3 |