4

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}
yori
  • 5,681
  • 29
  • 59

1 Answers1

4

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}
Qrrbrbirlbel
  • 119,821