Similar to putting a tikzpicture inside a \caption{}, I would like to insert an external icon inside figure captions, something like:
\begin{figure}
\caption{text with \includegraphics{icon} somewhere inside}
\includegraphics{image}
\end{figure}
How might this be done?
Best Answer
You need to protect
\includegraphics
inside\caption
; this, however, will add the image also to a possible list of figures, so perhaps you would rather use the optional argument of\caption
; in this case, no protection is needed. The following example code shows both alternatives: