开发者

Two statements next to curly brace in an equation

How can I wri开发者_如何学Gote an equation with one curly brace ({), and on the right-hand side next to the curly, two statements in two different lines?


You can try the cases env in amsmath.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  f(x)=\begin{cases}
    1, & \text{if $x<0$}.\\
    0, & \text{otherwise}.
  \end{cases}
\end{equation}

\end{document}

Two statements next to curly brace in an equation


That can be achieve in plain LaTeX without any specific package.

\documentclass{article}
\begin{document}
This is your only binary choices
\begin{math}
  \left\{
    \begin{array}{l}
      0\\
      1
    \end{array}
  \right.
\end{math}
\end{document}

This code produces something which looks what you seems to need.

Two statements next to curly brace in an equation

The same example as in the @Tombart can be obtained with similar code.

\documentclass{article}

\begin{document}

\begin{math}
  f(x)=\left\{
    \begin{array}{ll}
      1, & \mbox{if $x<0$}.\\
      0, & \mbox{otherwise}.
    \end{array}
  \right.
\end{math}

\end{document}

This code produces very similar results.

Two statements next to curly brace in an equation


Are you looking for

\begin{cases}
  math text
\end{cases}

It wasn't very clear from the description. But may be this is what you are looking for http://en.wikipedia.org/wiki/Help:Displaying_a_formula#Continuation_and_cases


To answer also to the comment by @MLT, there is an alternative to the standard cases environment, not too sophisticated really, with both lines numbered. This code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{cases}

\begin{document}

\begin{numcases}{f(x)=}
  1, & if $x<0$\\
  0, & otherwise
\end{numcases}

\end{document}

produces

Two statements next to curly brace in an equation

Notice that here, math must be delimited by \(...\) or $...$, at least on the right of & in each line (reference).


Or this:

f(x)=\begin{cases}
0, & -\pi\leqslant x <0\\
\pi, & 0 \leqslant x \leqslant +\pi
\end{cases}


Here is a way to manually control the size of brace, if cases or \left\{ doesn't provide suitable brace size you want.

\begin{math}
    \biggl\{
        \begin{array}{l}
            statement1\\
            statement2
        \end{array}
\end{math}

You can choose among \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ to adjust brace size from the smallest to the largest.

Image of different braces

From left to right: cases \left\{ biggl\{ Bigl\{

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜