[Tex/LaTex] Use \ref in PDF images included with \includegraphics

cross-referencinggraphics

I prepare my figures in a drawing tool (OmniGraffle), export them to PDF and then use \includegraphics to include them in my tex file (which is compiled using pdflatex).

Some of these figures have references to theorems of the text. It would be great if I could just write "Theorem \ref{thm:foobar}" in the drawing tool, and have \ref{thm:foobar} replaced by the actual number when the PDF file is included during compilation.

This is probably not possible, but I figured I might as well give it a try.

Best Answer

The easiest solution seems to be the overpic package.

I also had a look at the pstool package. It allows you to replace text in EPS files and then automatically transforms them to PDFs to be used with pdflatex. However, this is still cumbersome, and I did not manage to get pstool working with my MacTeX distribution.