Reading a paper where authors have labels (red circles) in a figure and they are able to render the labels in the figure reference in the text as well. Thought this was pretty neat. Can someone reveal the Latex magic behind doing this ?

enter image description here


You could use the features of the subcaption package to customize labels and their references. To draw these circled numbers, I think the easiest is to use TikZ.

    \tikz[text=white, font=\bfseries, baseline=(X.base)]{%
        \node[circle, draw=red!70!black, fill=red!70!black, inner sep=1.5pt] (X) {#1};


References to subfigures \subref{fig:A} and \subref{fig:B}.

    \caption{A first subfigure.}
    \caption{A second subfigure.}


Note that in this example, the formatting of the references is defined only for subreferences, that is, for references made using the \subref command. Using simply \ref would not format the references using the circles.

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.