I try desperately to make a macro which allows me to simply add a circled number with connector on a figure. To do that, I try to use into the command \put of overpic a tikz function which makes the job. I actually get a circled number with a connector on the figure but it seems that the bottom left of the tikz drawing box has a positive offset on the position given for a given value in \put{} of the overpic package. Here to make obvious the offset, I want to have my connector at (0,0).
In addition, this offset is picture scale sensitive. That is the reason why I put twice the picture with different size as an example in the dummy code below.
If in addition, the legend connector could remain proportional to the figure size it could be also great.
Actually my dream macro would be: specifying a coordinate for the connector tip, a connector angle, a connector length (in percentage of the picture width for example) and text (here a circled number).
If there is a dedicated package for doing that it would be even better. I can not imagine I am the only one who wants to do that...
One may suggest to do directly everything in tikz. But as I already have used overpic for other graphics, if I can avoid changing everything it would be great.
Thank you very much in advance!!
I put the dummy code here, you can use any graphic to test it.
% !TEX TS-program = pdflatex
\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
%% Concerned packages:
\usepackage[percent]{overpic}
\usepackage{tikz}
%%
\title{Title}
\author{Name}
\begin{document}
\maketitle
\begin{figure}[htbp]
\centering
\begin{overpic}[width=1\columnwidth,grid,tics=5]{example-image-a} %,grid,tics=5
\put(0,0){
\begin{tikzpicture}
\path (0,0) node (x) {}
(0.5,0.5) node[circle,draw](y){1};
\draw[black] (x) -- (y);
\end{tikzpicture}}
\end{overpic};
\caption{Picture with the legend added with the overpic and tikz package.}
\label{fig:mouse}
\end{figure}
\begin{figure}[htbp]
\centering
\begin{overpic}[width=0.7\columnwidth,grid,tics=5]{example-image-a} %,grid,tics=5
\put(0,0){
\begin{tikzpicture}
\path (0,0) node (x) {}
(0.5,0.5) node[circle,draw](y){1};
\draw[black] (x) -- (y);
\end{tikzpicture}}
\end{overpic};
\caption{Picture with the legend added with the overpic and tikz package.}
\label{fig:mouse}
\end{figure}
\end{document}