I am trying to make some consistent tables and looked into the nenenvironmentcommand. However, I am having trouble having a caption and using the defined environment at the same time.
newenvironment definition:
\newenvironment{mytable}[1]
{
\begin{table}[ht]
#definitions go here
\begin{tabular}{#1}
}
{
\end{tabular}
\end{table}
}
If I have this, I get no error, and everything works ok:
\begin{mytable}{ccc}
cell & cell & cell \\
\end{mytable}
However, if I just add the \caption command like this:
\begin{mytable}{ccc}
cell & cell & cell \\
\caption{caption}
\end{mytable}
I get this error:
Missing \endgroup inserted. [\caption{caption}]
tabularenvironment, which is not allowed. – egreg Mar 17 '13 at 00:45\begin{tabular}and\end{tabular}, losing in flexibility. – egreg Mar 17 '13 at 00:47