I have a PNG plot with a couple of black patches in it, and I'd like to refer to it in the \caption
of the figure
. According to the TikZ manual, I'd have to
\tikz \fill[black] (1ex,1ex) circle (1ex);
which works perfectly outside a \caption
. Using this inside a \caption
, though, leaves me with the compile error
! Use of \use@pgflibrary doesn't match its definition.
\pgfutil@ifnextchar ...1\def \pgfutil@reserved@a {
#2}\def \pgfutil@reserved@...
l.375 ...blah blah.}
?
The following produces the compile error
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikz \fill[orange] (1ex,1ex) circle (1ex);
\begin{figure}
\caption{\tikz \fill[orange] (1ex,1ex) circle (1ex);}
\end{figure}
\end{document}
Any hints here?