
有方程組。
如何將其左對齊? (第二行應該從第一行的正下方開始)
我的程式碼:
$\begin{equation}
\left\{\begin{aligned}
\hat a \sum x^2_i + \hat b \sum x_i = \sum x_i \cdot y_i,\\
\hat a \sum x_i + n \cdot \hat b =\sum y_i.\\
\end{aligned}
\right.\end{equation}$
答案1
只需使用cases
環境:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{dcases}
\hat a \sum x^2_i + \hat b \sum x_i = \sum x_i \cdot y_i,\\
\hat a \sum x_i + n \cdot \hat b =\sum y_i.
\end{dcases}
\end{equation}
\end{document}
答案2
在每個表達式之前使用 & 符號。例如對齊:
\begin {aligned}
\sum^{n}_{i=1} K=0\\
a^2+b+c=0\longrightarrow\Psi
\end{aligned}
這是:
在開頭使用 & 將它們左對齊:
\begin {aligned}
&\sum^{n}_{i=1} K=0\\
&a^2+b+c=0\longrightarrow\Psi
\end{aligned}
並得到:
或在您想要的任何內容之前使用它,例如在 = 之前使用它來對齊它們:
\begin {aligned}
\sum^{n}_{i=1} K&=0\\
a^2+b+c&=0\longrightarrow\Psi
\end{aligned}
給予: