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 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}
share|improve this question

4 Answers 4

up vote 8 down vote accepted

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}

enter image description here

share|improve this answer
    
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}
share|improve this answer

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}
share|improve this answer

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.

share|improve this answer
1  
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

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.