答案1
我不知道 Noodle,但是使用 amsmath 包你可以简单地使用
\[
f(x) =
\begin{cases}
(x+2)^{2}\,, & x<-2 \\
4-x^{2}\,, & x\ge -2
\end{cases}
\]
答案2
我将添加其他几种可能性,由 定义,由其加载mathtools
的扩展,由(加载)或由包定义。其中一些可以单独编号:amsmath
empheq
mathtools
cases
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{empheq}
\usepackage{cases} %
\begin{document}
\begin{align*}
\shortintertext{With \texttt{cases} and \texttt{dcases}:}
& f(x) = \begin{cases}
(2x +1)^2& \text{if } x < - \frac{1}{2}\\
1-4x^2 & \text{if } x \ge -\frac{1}{2}
\end{cases}
& & f(x) = \begin{dcases}
(2x +1)^2& \text{if } x < - \frac{1}{2}\\
1-4x^2 & \text{if } x \ge -\frac{1}{2}
\end{dcases}
\end{align*}
\begin{align*}
\shortintertext{With \texttt{rcases} and \texttt{drcases}:}
& f(x) = \begin{rcases}
(2x +1)^2& \text{if } x < - \frac{1}{2}\\
1-4x^2 & \text{if } x \ge -\frac{1}{2}
\end{rcases}
& & f(x) = \begin{drcases}
(2x +1)^2& \text{if } x < - \frac{1}{2}\\
1-4x^2 & \text{if } x \ge -\frac{1}{2}
\end{drcases}
\end{align*}
With \texttt{numcases}:
\begin{subnumcases}{f(x) = }
(2x +1)^2& if $ x < - \frac{1}{2} $\\
1-4x^2 & if $ x \ge -\frac{1}{2} $
\end{subnumcases}
With \texttt{empheq};
\begin{subequations}
\begin{empheq}[left = {f(x) = \empheqlbrace}]{alignat = 2}
& (2x +1)^2 & \quad & \text{if } x < - \frac{1}{2}\\[1ex]
& 1-4x^2 & & \text{if } x \ge -\frac{1}{2}
\end{empheq}
\end{subequations}
\end{document}