Alignment problem

2x + y &= 5 \\
2x - 3y &= 1
\end{cases} \\
0x + 4y &= 4

Is there any way to keep all equal signs aligned both inside and outside the cases?

  • Welcome to TeX.SE. Just out of idle curiosity: What's the purpose of the curly brace to the left of the first two rows? (Hint: Without that curly brace, a solution would be very simple...) – Mico Dec 6 '18 at 14:50
  • Yes, without it the alignment becomes easy. The braces are used to represent the linear system, while the last line simply represents the answer. – Lean P Dec 6 '18 at 15:18

You can get something like this with blkarray.

2x+y &=5\\
2x-3y &=1\\

enter image description here

Without additional packages it becomes less straightforward/elegant.

2x + y \,&= 5 \\
2x - 3y \,&= 1\\
\end{array} \right.&\\
0x + 4y = 4~~&

enter image description here

  • Sadly, I'm writing to a wiki that doesn't contain this package (and I can't call it as well) and couldn't make it work. However, I appreciate the effort. – Lean P Dec 6 '18 at 15:20
  • 1
    @LeanP Could you perhaps append the information which packages you are using/loading? – marmot Dec 6 '18 at 15:23
  • I'm working in an article for wikiHow and unfortunately don't know which packages their platform preloads by default. Even so, given that there might not be an obvious solution, I'll do my best to align them manually and move on. I'll definitely suggest adding 'blkarray' to their packages, though! – Lean P Dec 6 '18 at 15:32
  • @LeanP I added a version without additional packages but of course it is less elegant. – marmot Dec 6 '18 at 15:35
  • No success until I've manually added some spaces ('\') to align them as much as possible. The result can be seen in [ imgur.com/a/mfgNCX6 ]. Not elegant, I know, but it'll have to do for now. Thank you for the effort! – Lean P Dec 6 '18 at 16:11

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.