# subfloat with array?

the following code produces an error:

missing $inserted. 1.109 \end{array} any suggestions on what I am missing: \begin{figure}[H] \caption{My caption goes in here.} \centering \subfloat[Subfloat 01] {\includegraphics[width=0.30\textwidth]{../PNG/Figure_1.png}} \subfloat[Subfloat 02] {$\begin{array}{ccc} text & text & text\\ text & text & text \end{array}$} \end{figure}  - ## 1 Answer Don't use display style math directly in this instance. Rather use $\begin{array}...\end{array}$. Here's a complete minimal example: \documentclass{article} \usepackage{subfig}% http://ctan.org/pkg/subfig \usepackage{float}% http://ctan.org/pkg/float \usepackage[demo]{graphicx}% http://ctan.org/pkg/graphicx \begin{document} \begin{figure}[H] \caption{My caption goes in here.} \centering \subfloat[Subfloat 01] {\includegraphics[width=0.30\textwidth]{../PNG/Figure_1.png}} \subfloat[Subfloat 02] {$\begin{array}{ccc}
text & text & text\\
text & text & text
\end{array}\$}
\end{figure}

\end{document}


In order to use display style math - which doesn't seem necessary in your example - you need to provide some fixed width for the float in the form of a minipage, say.

The demo option to graphicx is just to make this example compile, since the image Figure_1.png is not available.

-
your solution worked. i understand now the issue and the solution. – joe Jun 14 '12 at 18:39