[Tex/LaTex] How to put a \caption to an image when I’m using overpic

captionsoverpic

I am trying to do something like this:

\begin{overpic}[scale=0.3]{Sistema}\label{fig1}

\caption[Fig1]{Sistema de flujo (abierto) definido por la línea interrumpida.}

\end{overpic} 

I want to put the description, like when I use \includegraphics , but there seems to be something that it's not good, and I can't see it.
Oh, and, how can I put this image in the List of Figures?

Can anyone help me? Please.

Best Answer

Use the overpic environment inside the figure float environment, and place the caption outside of the overpic environment but in the figure environment, if you want to be able to use \caption. Like you would do with \includegraphics.

As a result, this will be added to the list of figures.

Example here:

\documentclass{report}
\usepackage{overpic}

\begin{document}

\begin{figure}

\begin{overpic}[scale=0.3]{example-image-a}

\end{overpic}

\caption[Fig1]{Sistema de flujo (abierto) definido por la línea interrumpida.}
\label{fig1}
\end{figure}


\end{document}
Related Question