I'm trying to use package subfig and amsmath align (in order to align equations) inside the subfloat block. Are there any incompatibilities or am I doing something wrong? Details follow. This is my problem, my code:
\begin{figure}
\centering
\subfloat[First]{
\begin{align*}
ciao &= 2\\
ciao &= 3
\end{align*}}
\subfloat[First]{
\begin{align*}
ciao &= 2\\
ciao &= 3
\end{align*}}
\end{figure}
I get the error (in ShareLatex)
Missing \endgroup inserted.
\endgroup l.374 \end{align*}} I've inserted something that you may have forgotten. (See the above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear.
This code (used inside subfloat)... :
\begin{align*}
ciao &= 2\\
ciao &= 3
\end{align*}
...but moved out of the subfigure is working just fine.
Also the figure with plain text inside the subfloat[]{} works without errors. (I have only a warning for underfull \hbox, I don't know what does it means but I think "there is simply not so much inside the figure")
Any tip is appreciated. Regards
$\begin{aligned}
instead of\begin{align*}
and the closing with\end{aligned}$