In an attempt to show the code and the output side by side, I have used a table inside a minipage. The table entries are two minipages and one contains an align environment. Having the align environment in the given setting causes problems.
I get a meaningless error message
Argument \flalign* has an extra }.
as a result.
If I put the minipage that contains the align environment inside an fbox the problem disappears. For some reason, I thought I saw the answer to this problem in SX sometime ago, but now I cannot find it. Why do I get this error message?
The following is the working example. I have commented out the \fbox
so that you can see the effect.
\documentclass[11pt]{amsart}
\begin{document}
\begin{minipage}{1\textwidth}
\begin{tabular}{l r}
\begin{minipage}[t]{.65\textwidth}
\begin{verbatim}
\begin{flalign*}
P &=x^2+y^+2xy &\\
&=(x+y)^2
\end{flalign*}
\end{verbatim}
\end{minipage}
&
%\fbox{
\begin{minipage}[t]{.35\textwidth}
\begin{flalign*}
P &=x^2+y^2+2xy &\\
&=(x+y)^2
\end{flalign*}
\end{minipage}
%}
\end{tabular}
\end{minipage}
\end{document}