TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

\quad f(x) &= e^{x} - x - 1
f(0) = e^{0} - 0 - 1 = 0 &\\
\quad f'(x) &= e^{x} - 1
f'(0) = e^{0} - 1 = 0 &\\
\quad f''(x) &= e^{x}
f''(0) = e^{0} = 1 \neq 0 &

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?
share|improve this question
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
up vote 12 down vote accepted

I would recommend you use alignat:

enter image description here


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



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\\
f''(x) &= e^{x}       &&\quad\rightarrow\quad &f''(0) &= e^{0} = 1 \neq 0
or with all the equals also aligned:
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\\
f''(x) &= e^{x}       &&\quad\rightarrow\quad &f''(0) &= e^{0}         &&= 1     \neq 0
share|improve this answer
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
Thank you! Exactly what I was looking for. – alignment newbie May 6 '14 at 17:25
@alignmentnewbie if this answer has resolved the issue, you might consider 'accepting' it by clicking on the green check mark next to the answer :) Welcome! – cmhughes May 6 '14 at 17:32
Thanks hughes, I was wondering how to do that! – alignment newbie May 6 '14 at 17:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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