# How can I typeset non-inline math in tables?

I have to typeset mathematics in table and want to avoid it being scaled down because I have to use inline math (). However, using  for example does not work. What is the best way to typeset tables with formulas, in such a way that the math is not scaled down?

MWE:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$test$ % works

\begin{tabular}{cc}
$test$ & $test$\\ % doesn't work
\end{tabular}

\end{document}
-

You can add \displaystyle within the inline math environment, e.g.

\documentclass{article}
\usepackage{amsmath}
\usepackage{fixltx2e}  % fixes that  are fragile
\begin{document}
\begin{tabular}{cc}
$$\lim_{x\to 0} \frac{\sin x}{x}$$ & $$\sum_{i=1}^n x_i$$ \\
$$\displaystyle \lim_{x\to 0} \frac{\sin x}{x}$$ & $$\displaystyle \sum_{i=1}^n x_i$$
\end{tabular}
\end{document}

-
I like your solution, it doesn't require changing all my columns to p. Thanks! –  Ingo Oct 21 '11 at 13:14

use tabularx or alternetively the p-column specifier if you want smaller columns:

\documentclass{article}
\usepackage{amsmath,tabularx}
\begin{document}

\noindent
\begin{tabularx}{\linewidth}{@{}XX@{}}
$test$ & $test$
\end{tabularx}

\end{document}
-

You can use paragraph columns:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$test$ % works
\begin{tabular}{p{3cm}p{3cm}}
$test$ & $test$\\ % works now
\end{tabular}
\end{document}
-

A variation of the answer by @wh1t3 would be:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$test$ % works

\begin{tabular}{cc}
\parbox{2cm}{$test$} & \parbox{2cm}{$test$}\\ % does work
\end{tabular}

\end{document}

The solution consists here, as you can see in putting each equation into a box. With \parbox the width is a required parameter, so you will need to specify it as with p columns.

On the other hand you will not need any extra packages.

-
This requires guessing the width, which isn't necessary with $$\displaystyle ...$$. –  egreg Oct 21 '11 at 13:26
same with p columns... :) Your solution is way more elegant, @egreg. –  Count Zero Oct 21 '11 at 14:12