\begin{figure} Foo \caption{Bar} \label{fig} \end{figure} \ref{fig}