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 basically want to type a derivation of a specific mathematical formula with the operations that have been done in each line, for e.g.:

  U = R * I      |:R
U/R = I

Handwritten it looks like this:

enter image description here

share|improve this question
    
What would I do if my "final solution" is a mixture of multiple answers? –  Simon D. Seim Jul 9 at 13:10
    
Probably choose the one that was the most helpful in getting to your final solution. :) –  Svend Tveskæg Jul 9 at 15:11
add comment

3 Answers 3

Use the align environment (within amsmath package):

\begin{align*}
  U          &=RI    &  &\div R\\
  \frac{U}{R}&=I     &  &
\end{align*}

The first and third & align the sets of equations (say first and second column), while the second sign & separates the "columns" of equations

share|improve this answer
2  
Same answer with better explanations ! You should add a * in \end{align} to make it perfect. –  V. Rossetto Jul 3 at 15:35
    
@V.Rossetto Thank you! :-P –  Dox Jul 3 at 17:52
    
You shouldn't use align (or align*) if you have more than one ampersand. In this case, you should use alignat (or alignat*) and specify the number of alignment points. –  Svend Tveskæg Jul 7 at 17:03
1  
Why not? It does the job. And you do not have to add manual horizontal space –  daleif Jul 7 at 18:54
1  
@SvendTveskæg. The align environments are designed to be used with more than two ampersands. –  V. Rossetto Jul 8 at 5:54
add comment

You can use the align* environment:

\begin{align*}
  U&=RI & \div R\\
  \frac{U}{R}&=I &
\end{align*}
share|improve this answer
    
It is better to use two &'s before the 'operation/comment', like in Dox's answer. –  jmc Jul 3 at 15:02
    
@jmc. Why ? This will align the comments on their left. –  V. Rossetto Jul 3 at 15:09
    
@V.Rosetto — Exactly. –  jmc Jul 3 at 15:11
    
@jmc. Somehow, it seems more agreeable to me to have the comments right-aligned. A matter of taste, anyway. Thanks. –  V. Rossetto Jul 3 at 15:16
add comment

Here is another way of doing it:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{alignat*}{2}
  && U &= R \cdot I \qquad \vert\ :R \\
  \ArrowBetweenLines
  && \frac{U}{R} &= I
\end{alignat*}
\vspace{4ex}
\begin{alignat*}{2}
  && U &= R \cdot I \\
  \text{(Divide by $R$)}\Updownarrow \quad &&& \\
  && \frac{U}{R} &= I
\end{alignat*}

\end{document}

output

Of the two approaches, I would use the bottom one.

share|improve this answer
add comment

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.