I'm trying to make 2 subtables with 2 different captions inside of a table, but I keep getting the following error:
Missing \endcsname inserted.
<to be read again>
\relax
l.9 \begin
{tabular}{| r | r | r | r |}
?
Here is the code:
\documentclass [12pt,letterpaper]{report}
\usepackage{subcaption}
\begin{document}
\begin{table}[htbp]
\begin{center}
\begin{subtable}[htbp]
\begin{tabular}{| r | r | r | r |}
\hline
A & B & C & D \\ \hline
1 & 2 & 3 & 4 \\ \hline
\end{tabular}
\caption{Caption A}
\end{subtable}
\begin{subtable}[htbp]
\begin{tabular}{| r | r | r | r |}
\hline
A & B & C & D \\ \hline
1 & 2 & 3 & 4 \\ \hline
\end{tabular}
\caption{Caption B}
\end{subtable}
\caption{Caption of both A and B}
\end{center}
\end{table}
\end{document}
Stuff I read on google said that this error is usually caused by an extra \
in an environment name, but I double checked and can't find any examples of this. Any solutions must work for the report
document class.