I have a table with two columns inside which I want to use a custom environment called "mgroup". This environment is defined as follows:
Code: Select all
\newenvironment{mgroup}[1]{#1 &}{\tabularnewline}
An example of how I use it:
Code: Select all
\begin{tabular}{ll}%
\begin{mgroup}{g1}%
one%
\end{mgroup}%
\begin{mgroup}{g2}%
two%
\end{mgroup}%
\end{tabular}
The example does not compile successfully. When I remove the ampersand and tabularnewline it does compile but everything is output on the same row (as expected). The mere use of a nested environment (that uses align and/or newline) seems to cause a problem within tabular.
Can anyone fix the above? Or, can anyone offer another way to accomplish the above? Note, I need to use a nested enviroment of some sort because I may need to process the input arguments in future.