LaTex CSDN 大括号分支公式

很多时候,数学公式需要几个分支来实现,如下:
f(x)={x+3,0x<3x22x+1,x3 f(x)=\left\{ \begin{aligned} x+3&, 0\leq x < 3 \\ x^2-2x+1&, x\ge 3 \end{aligned} \right.
在LaTex中可通过如下代码实现:

\begin{equation}
	f(x)=\left\{
		\begin{aligned}
		x+3&, 0\leq x < 3 \\ 
		x^2-2x+1&, x\ge 3
	\end{aligned}
	\right.
\end{equation}

其中,代码中的&用于不同分支之间的对齐,示例中为以分割的逗号对齐。

若在CSDN博客创作时需要这样的公式需要写,可以通过非常类似的代码完成:

$$
f(x)=\left\{
	\begin{aligned}
	x+3&, 0\leq x < 3 \\ 
	x^2-2x+1&, x\ge 3
\end{aligned}
\right.
$$

其中,$$...$$的功能为行间公式。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章