Graphics, Figures & TablesUsing eqnarray in a table.

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rugbyscotty
Posts: 1
Joined: Tue Mar 24, 2015 10:21 am

Using eqnarray in a table.

Post by rugbyscotty »

Hello everyone,

I have been using the Latex language for about a year now and though I was good haha...Well I was wrong.

I am now calling on you all to help my figure out how I can utilize the \begin{eqnarray} function within a cell. My intentions are to line up all the "=" signs in a particular cell without using '$'.

For example:

Code: Select all

\begin{eqnarray*}
Speed&=&\frac{Distance}{Time} \\
&=&\frac{200km}{2\,Hours} \\
&=&100km\,per\,hour
\end{eqnarray*} 
I want to get this code into a cell within a table or another code which will do the same thing as the code above.

Thanks for your troubles :D

Scotty
Last edited by cgnieder on Tue Mar 24, 2015 1:31 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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Using eqnarray in a table.

Post by Johannes_B »

Hi and welcome,

eqnarray is a display environment, i wouldn't use it in tabular cells. In fact, i wouldn't use eqnarray at all. Avoid eqnarray!


Can you give us a short compilable example of what you are trying to do?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Using eqnarray in a table.

Post by Stefan Kottwitz »

Hi Scotty,

welcome to the forum!

See also my post eqnarray vs. align for a short explanation with picture.

I would not used a so called "displayed" math environment, such as eqnarray or align, within a table cell. That's because they are for centered math paragraphs in normal text, with distance before and after them.

You could use multiline math blocks with alignment, such as using aligned within $...$, see amsmath manual for aligned.

Stefan
LaTeX.org admin
Post Reply