2

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

  • What would I do if my "final solution" is a mixture of multiple answers? – dersimn Jul 9 '14 at 13:10
  • Probably choose the one that was the most helpful in getting to your final solution. :) – Svend Tveskæg Jul 9 '14 at 15:11
8

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

| improve this answer | |
  • 2
    Same answer with better explanations ! You should add a * in \end{align} to make it perfect. – Tom-Tom Jul 3 '14 at 15:35
  • 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 '14 at 17:03
  • 1
    Why not? It does the job. And you do not have to add manual horizontal space – daleif Jul 7 '14 at 18:54
  • 1
    @SvendTveskæg. The align environments are designed to be used with more than two ampersands. – Tom-Tom Jul 8 '14 at 5:54
3

You can use the align* environment:

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

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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