Take the 2-minute tour ×
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.

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:

\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
\qquad\medspace\rightarrow\medspace
f'(0) = e^{0} - 1 = 0 &\\
\quad f''(x) &= e^{x}
\qquad\qquad\rightarrow
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?
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 at 16:59
1  
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 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 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 at 18:09

1 Answer 1

up vote 12 down vote accepted

I would recommend you use alignat:

enter image description here

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\\
f''(x) &= e^{x}       &&\quad\rightarrow\quad &f''(0) &= e^{0} = 1 \neq 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\\
f''(x) &= e^{x}       &&\quad\rightarrow\quad &f''(0) &= e^{0}         &&= 1     \neq 0
\end{alignat*}
\end{document}
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 at 17:15
    
Thank you! Exactly what I was looking for. –  alignment newbie May 6 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 at 17:32
    
Thanks hughes, I was wondering how to do that! –  alignment newbie May 6 at 17:35

Your Answer

 
discard

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.