So, I want to display cases inside a table. This is my Latex document, as minimized as I could to reproduce the problem. Apparently, it says:
(./redundant.aux)
! Missing $ inserted.
<inserted text>
$
l.12 \begin{cases}
I don't get it. The cases environment works totally fine outside tables. What's wrong with my Latex code and how do I fix it?
\documentclass[11pt, fullpage, lefteqn]{article}
\usepackage{amsmath}
\begin{document}
\begin{table}[h!]
\centering
\begin{tabular}{|c|c|}
\hline
$a^2 - x^2$
&
\[
\begin{cases}
a \sin x \\ a \cos x
\end{cases}
\] & \\
\end{tabular}
\end{table}
\end{document}
Edit: when I try to change the c
s to p
s, I get
! Missing number, treated as zero.
<to be read again>
|
l.9 $
a^2 - x^2$
c
columns are single line like\mbox
and can not have display constructs, use ap
column such asp{5cm}
which is like\parbox
and can have vertical display material like\[
c
s top
s, it says "Missing number, treated as zero."p{5cm}
as I showed