等式中大括号旁边的两个语句

y2p*_*y2p 90 latex

我想{在右边写一个带有一个花括号()的方程式,在两个不同的行旁边写着两个语句.我该怎么做?谢谢.

Lac*_*zar 170

你可以cases在amsmath中尝试env.

\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}
Run Code Online (Sandbox Code Playgroud)

amsmath案件

  • @Lucho右边这两个方程有两个不同的数字吗? (3认同)

Bru*_*ILS 17

这可以在没有任何特定包的普通LaTeX中实现.

\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}
Run Code Online (Sandbox Code Playgroud)

这段代码产生的东西看起来像你需要的东西.

两条线前面的花括号

  • 这个解决方案给出了`amsmath`的`cases`环境的输出identycal,除了稍微小一点的花括号,这有时可能是一个优点. (2认同)

sre*_*ean 7

你在找吗?

\begin{cases}
  math text
\end{cases}
Run Code Online (Sandbox Code Playgroud)

从描述中不太清楚.但也许这就是你要找的http://en.wikipedia.org/wiki/Help:Displaying_a_formula#Continuation_and_cases


Mat*_*gro 6

要回答@MLT的评论,还有标准cases环境的替代品,实际上并不太复杂,两行都有编号.这段代码:

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

\begin{document}

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

\end{document}
Run Code Online (Sandbox Code Playgroud)

产生

输出pdf的屏幕截图

请注意,在这里,数学必须由\(...\)$...$至少&在每一行(参考)的右边界定.