# Problem using tikz with a caption and floatrow together

I have this MWE drawing a caption over an image but when I load the floatrow package, the caption will be drawn under the image. When I only write a text over the image it works.

\documentclass{article}

\usepackage{graphicx}
\usepackage{tikz}

%problem!
\usepackage{floatrow}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\node [draw=black, anchor=south west] at (0,0) {\includegraphics[width=\textwidth]{fig1}};

\node [draw=black, anchor=south west, text width=.3\textwidth] at (0,0) {        \caption{A picture of a X.}};
\end{tikzpicture}
\end{figure}
\end{document}

-
Put a \RawFloats after \begin{figure}. For details see floatrow documentation, section 2.4 "Running Floats in the Raw LATEX Mode". –  Axel Sommerfeldt Oct 16 '13 at 17:58
@AxelSommerfeld Thanks, his solves the problem. –  susis strolch Oct 16 '13 at 18:10

I don’t know the floatrow package but it seems like you want to use \RawCaption:

This command allows to “release” caption contents from special box register created by floatrow package for the creation of necessary layout.

## Code

\documentclass{article}
\usepackage{tikz}
\usepackage{floatrow}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\fill (up:4) -| (right:4) -| (2,2) -| (up:4);

\node [anchor=south west, text width=2cm-2*\pgfkeysvalueof{/pgf/inner xsep}]
{\RawCaption{\caption{A picture of a Y.}}};
\end{tikzpicture}
\end{figure}
\end{document}

-