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.
$$

其中,$$...$$的功能爲行間公式。

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