Math & Scienceadd descriptions to each line of a multiline equation?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
pythonscript
Posts: 4
Joined: Sun Sep 12, 2010 9:44 pm

add descriptions to each line of a multiline equation?

Post by pythonscript »

I'm using eqnarray to create multi line equations that show the steps of a problem, but I'm wondering how I can add descriptions to the ends of those lines? I've been using eqnarray* on and off to suppress/add labels, but adding a short text description, non math mode, to the right side of each line in the eqnarray would be really helpful.

Thanks for the help!
Last edited by pythonscript on Mon Sep 13, 2010 7:03 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

add descriptions to each line of a multiline equation?

Post by gmedina »

Hi,

don't use eqnarray anymore (read Avoid eqnarray!). In its stead you can use align or some other environment from amsmath. Try something like this:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
  a(b + c) &= ab + ac && \text{(por distributividad)}\\
  &= ba + ca && \text{(por conmutatividad)}\\
  &= (b + c)a && \text{(por distributividad)}
\end{align*}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
pythonscript
Posts: 4
Joined: Sun Sep 12, 2010 9:44 pm

Re: add descriptions to each line of a multiline equation?

Post by pythonscript »

Thank you! That was extremely helpful and exactly what I was looking for.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

add descriptions to each line of a multiline equation?

Post by localghost »

Now that the problem is obviously solved, please be so kind and mark the topic accordingly as clearly written in Section 3 of the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
Post Reply