
¿Es posible hacer una referencia como parte de un gráfico incluido en un documento LaTeX?
Si es así, ¿cuál sería el formato preferido para dicho gráfico (EPS,...)?
Bosquejo:
Estoy usando pdflatex para compilar.
Respuesta1
Una forma de hacer esto sería colocar el \includegraphics{...}
interior de un TikZ node
y luego colocar otro node
encima de la imagen con TikZ, donde este nodo contiene el comando \ref{...}
o el \label{...}
comando, dependiendo de si desea una referencia o una etiqueta dentro del imagen.
El siguiente código para superponer usando TikZ con \includegrpahics{...}
está tomado deesta preguntaen TeX.SX.
El varwidth
paquete se utiliza para poner un enumerate
entorno dentro de un TikZ node
. Veresta respuestapara una explicación.
\documentclass{article}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{varwidth}
\begin{document}
Here, we will reference a label that is set on top of the picture with \verb|tikz| (\ref{fig:1}).
\begin{figure}[h!]
\centering
\begin{tikzpicture}
\node at (0,0) {\includegraphics[width=.6\textwidth]{example-image}};
\node at (1.2,2) {\begin{varwidth}{2in}\begin{enumerate}[label={Fig.~\arabic*}]\item{Hi, let's reference this\label{fig:1}}\end{enumerate}\end{varwidth}};
\end{tikzpicture}
\end{figure}
Here, we will do the opposite of this; we will put the \verb|\ref{...}| inside the \verb|node|, as a reference to example 1:
\begin{enumerate}
\item{\label{ex:1}Example 1}
\end{enumerate}
\begin{figure}[h!]
\centering
\begin{tikzpicture}
\node at (0,0) {\includegraphics[width=.6\textwidth]{example-image}};
\node at (1.2,2) {Look at example~\ref{ex:1}};
\end{tikzpicture}
\end{figure}
\end{document}