I would like to define a very plain caption format that simply typesets the caption label and text as if it were normal inline text. Of course I would like to keep the the functionality of \caption (label/ref, hyperlinks, list of figures, etc.). I want to position the caption manually using TikZ nodes.

Is this somehow possible with the caption package?

An example to illustrate what I am trying to do:


    draw=blue, fill=blue!20, 
    inner sep=1cm,
    minimum width=\linewidth}%


    \node[figure] (fig) {Nice figure.};
    \node[caption] at (fig.north) {Figure 0: My figure};

% Does not work
% \captionsetup[figure]{format=plain,skip=0pt,indention=0pt}
% \begin{figure}
% \begin{tikzpicture}
    % \node[figure] (fig) {Nice figure.};
    % \node[caption] at (fig.north) {%
        % \caption{My figure}\label{fig:myfig}};
% \end{tikzpicture}
% \end{figure}
% This is \autoref{fig:myfig}.


Yes, it's possible with the caption package. Just use the \captionof command, for instance inside a parbox:


    \node[figure] (fig) {Nice figure.};
    \node[caption] at (fig.north) {%
        \parbox{4cm}{\captionof{figure}{My figure}\label{fig:myfig}}};
This is \autoref{fig:myfig}.

alt text

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.