I'd like to create a table, but I get the strange error "Missing $ inserted \end{frame}". Here is the code. See below for a similar example, where it worked.
Unfortunately, I cannot find my mistake.
Thank you very much for the help.
The non-working example:
\documentclass{beamer}
\usepackage{graphicx}
\title{MyTitle}
\author{Bibabutzemann}
\date{August 2023}
\begin{document}
\maketitle
\section{Introduction}
\begin{frame}
\begin{definition}
The blahblah is given by:
\begin{center}
\begin{tabular}{@{}l@{}l@{}l@{}l@{}l@{}l@{}}
\hline
(\begin{array}{|c|ccccc|}
& a & \cdots & m & \cdots & p\ \hline
[W_{1}] & & & & & \
\vdots & & & \vdots & & \
[W_{i}] & \cdots & \cdots & \psi(x,y) & \cdots & \cdots \
\vdots & & & \vdots & & \
[W_{k}] & & & \vdots & & \
\hline
\end{array})\
\end{tabular}
\end{center}
\end{definition}
\end{frame}
\end{document}
The working example:
\documentclass{beamer}
\usepackage{graphicx}
\title{MyTitle}
\author{Bibabutzemann}
\date{August 2023}
\begin{document}
\maketitle
\section{Introduction}
\begin{frame}
\begin{center}
\begin{tabular}{@{}l@{}l@{}l@{}}
\hline
(\begin{array}{|l|ccc|}
& u & v & w \ \hline
X & 1 & 1 & 1\
Y & 1 & 1 & 1\
Z & 1 & 1 & 1\
\hline
\end{array})\
\end{tabular}
\end{center}
\end{frame}
\end{document}
array. Remove them and it compiles just fine. See https://tex.stackexchange.com/questions/34466/error-with-square-bracket-in-table – Bibi Aug 28 '23 at 14:58\relaxat the end of lines preceding them. – Bibi Aug 28 '23 at 15:04