9

I'm new to LaTeX. I'm trying to create a table where one of the cells contains aligned equations.

The naive approach of nesting an align environment inside the table environment does not work:

\begin{tabular}{l r}
A & B\\
\begin{align}
x &= y+1\\
x &= (y+1) (y-1)
\end{align}
\end{tabular}

This gives the error 'Argument of \align has an extra }.'

I must admit I have no idea what that error message means... Why is it not possible to nest align and table environments? How do I put aligned equations in a table?

Thanks!

1 Answers1

14

As you've discovered, you can't use an align (or align*) environment inside a tabular environment, unless you go to some lengths to "hide" the align environment.

A simple remedy is available: Use an aligned environment. Optionally, use a [t] or [b] placement specifier to specify if you want top- or bottom-alignment. If you don't provide a placement indicator, any adjacent material will be centered vertically relative to the material in the aligned environment.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{lr}
A & B\\
\hline
$\begin{aligned}[t] % placement: default is "center", options are "top" and "bottom"
x &= y+1\\
x &= (y+1) (y-1)
\end{aligned}$ & abc xyz\\
\end{tabular}
\end{document}
Mico
  • 506,678