I have a tikzpicture with a matrix of math nodes. It by itself compiles fine. If I put it in a figure environment, it still compiles fine. However, if i put it in a subfigure environment, it returns that there is a $ missing. Any ideas?
EDIT (@Werner): Here's something that reproduces the problem:
\documentclass{article}
\usepackage{subfig}% http://ctan.org/pkg/subfig
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usetikzlibrary{matrix}
\begin{document}
\begin{figure}
\subfloat[something]{% <---- \subfloat begin
\begin{tikzpicture}[every node/.style={anchor=west}]
\matrix (m) [matrix of math nodes, nodes in empty cells]{
\quad & 1.\quad (x)(Q\supset Fx) & \\
& 2.\quad Q\supset Fx & \textrm{I,\textbf{UI}} & \\
& 3.\quad Q \\
& 4.\quad Fx & 2, 3, \textrm{ M.P.}\\
& 5.\quad (x)Fx & 4, \textrm{ \textbf{UG}} \\
& 6.\quad Q\supset(x)Fx & 3-5, \textrm{ C.P.} \\
& 7.\quad \parbox[t]{2.9cm}{%
$(x)(Q\supset(x)Fx)\supset$\\
$[Q\supset(x)Fx]$} & 1-6, \textrm{ C.P.}\\};
\draw[-stealth] (m-7-2.north east)
-| (m-1-1.west) |- (m-1-2);
\draw[-stealth] (m-6-2.north east)
-| (m-3-1.east) |- (m-3-2);
\end{tikzpicture}%
}% <---- \subfloat end
\caption{This is a caption}
\end{figure}
\end{document}


{ .. }or even\hbox{ .. }. – Martin Scharrer Sep 27 '11 at 15:38\subfloat[something]{\scantokens{\begin{tikzpicture} ... \end{tikzpicture}\endinput}}works. :) – egreg Sep 28 '11 at 21:04