方程组左对齐

方程组左对齐

有一个方程组。
如何将其左对齐?(第二行应在第一行正下方开始)
https://i.stack.imgur.com/fyg9r.png

我的代码:

$\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}

给予:

= 对齐

相关内容