I have a piecewise function with three "parts." I would like to have all three conditions aligned at the variable x. How do I achieve that? Here is the code I have so far:
\[
f(x) = \begin{cases}
mx^2 +nx +1, & x \le -1 \\
2m e^{|x|-1} + \sin \pi x - 3n, & -1 < x < 1 \\
3x^2 - (m+n)x, & x \ge 1
\end{cases}
\]





alignedatis apparently a "blocked word"; interestingly, if I replace\begin{alignedat}{2}withbegin{aligned}(also for the\end), then it compiles in that editor, and the result looks almost the same as the image in this post. Not sure what the difference is, though... Cheers! – sdaau Feb 20 '15 at 19:21