Equation alignment

I'm a little new at this so bear with me. What I intend to get is this: I used the following code to obtain it:

\begin{flalign*}
\quad f(x) &= e^{x} - x - 1
\medspace\medspace\rightarrow\medspace\medspace
f(0) = e^{0} - 0 - 1 = 0 &\\
\quad f'(x) &= e^{x} - 1
f'(0) = e^{0} - 1 = 0 &\\
f''(0) = e^{0} = 1 \neq 0 &
\end{flalign*}


I guess there must be an easier way to implement this?

I don't want the equations to be stretched across the whole page with a lot of space in between the individual components. When I try using &\rightarrow and &=, that's how I end up.

• Should I be using alignat instead?
• But then how would I get it flushed to the left?
-
Please always post complete documents (it makes it much easier to test answers). Do you want all equations flush left (eg the global [fleqn] option or just this one (it changes possible answers) –  David Carlisle May 6 '14 at 16:59
You should consider reading section 25 align environments of the mathmode document/A comprehensive review of mathematics in (La)TeX (specifically look at section 25.2 alignat environment). –  Werner May 6 '14 at 17:02
Sorry David, I'll keep that in mind for future reference. I just wanted this one instance flushed left. Also that's a really good resource, Werner, thank you! And thanks strpeter for fixing my original post, this is my first time posting on stackexchange so I'm pretty bad at this. –  alignment newbie May 6 '14 at 17:23
@alignmentnewbie for a first posting it's pretty good at least ypu gave some code for people to go on:-) by the way if you prefix a name with @ the system shows possible user names and if you use one the user gets notified. Othewise they only see your reply comments if they happen to visit the question again –  David Carlisle May 6 '14 at 18:09

I would recommend you use alignat:

Notes:

• alignat provides pairs of right/left alignments. Hence the && to get past the right aligned column and make it a left aligned column.
• As per egreg's suggestion, I have added a \quad spacing around the \rightarrow.

Code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{alignat*}{3}
f(x) &= e^{x} - x - 1 &&\quad\rightarrow\quad &f(0)   &= e^{0} - 0 - 1 = 0\\
f'(x) &= e^{x} - 1    &&\quad\rightarrow\quad &f'(0)  &= e^{0} - 1 = 0\\
\end{alignat*}
or with all the equals also aligned:
\begin{alignat*}{4}
f(x) &= e^{x} - x - 1 &&\quad\rightarrow\quad &f(0)   &= e^{0} - 0 - 1 &&= 0\\
f'(x) &= e^{x} - 1    &&\quad\rightarrow\quad &f'(0)  &= e^{0} - 1     &&= 0\\

Some more space around the arrow would be welcome; I had the same as your first solution (I consider the second to be wrong), but with \quad\rightarrow\quad. –  egreg May 6 '14 at 17:15