There is a system of equation.
How to align it on the left? (second line should be started right under the first line)

My code of this:

\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.\\
  • 4
    Put the & character before the first \hat at each line and remove the $ symbols. – wipet Dec 13 '14 at 21:49

Just use the cases environment:



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


enter image description here

| improve this answer | |
  • It work properly, but now it system looks smaller than another text. Look at the screenshot s27.postimg.org/rboabhkyb/…. (equation number 5 uses cases). How fix it? – 0x1337 Dec 13 '14 at 22:06
  • 1
    @0x1337 Load mathtools instead of amsmath and use dcases. – Manuel Dec 13 '14 at 22:18
  • @Manuel: forgot that size inside cases is like inside array. Corrected. – Bernard Dec 13 '14 at 22:39
  • @Ox1337: Manuel gave the fix. See my updated answer. Don't load amsmath in that case, since mathtools does it for you (as a rule of thumb, one should load mathtools rather than amsmath). – Bernard Dec 13 '14 at 22:41

Use the & symbol before each expression. For example to align:

\begin {aligned}
\sum^{n}_{i=1} K=0\\

Which is:


Use & at the beginning to align them left:

\begin {aligned}
&\sum^{n}_{i=1} K=0\\

And obtain:

left aligned

Or use it before whathever you want, for example before the = to align them:

\begin {aligned}
\sum^{n}_{i=1} K&=0\\


= aligned

| improve this answer | |
  • 3
    The term "before each expression" is not unambiguous since you haven't made clear what you mean by expression. Using an expression [!] such as "at the start of both rows" would be clearer. Better yet, just post a code example that incorporates your suggestion, and all guesswork is eliminated. – Mico Dec 13 '14 at 23:54
  • You're right, I'll edit. – Renijk Dec 14 '14 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.