## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ hyperlinks in tikz Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
omerangel
Posts: 2
Joined: Sat Oct 29, 2016 8:55 pm

I wish to have a figure with numerous hyperlinks to theorems in the paper. I have the following construction:

\documentclass{article} \usepackage{amsthm}\newtheorem{theorem}{Theorem} \usepackage{tikz}\usetikzlibrary{calc} \usepackage{hyperref} \begin{document} \section{A graph for Omer} \begin{tikzpicture}  \node(A) at (0,0) {$A$};  \node(B) at (10,0) {$B$};  \draw[->] (A)-- node[below]{\hyperlink{tikz_thm1}{Theorem 1}} (B);\end{tikzpicture} \begin{theorem}\label{thm1}\hypertarget{tikz_thm1}  1+1+2.\end{theorem}\end{document}

However, I would much prefer if I could use the theorem labels already in place, instead of having a separate hypertarget anchors, and if the link text could be created automatically, similarly to using \ref{thm1} in the above context (or better yet \cref{thm1} with cleveref.) Can this be done?

rais
Posts: 149
Joined: Sun Nov 16, 2014 8:51 pm
you mean, like this?
     \documentclass{article}      \usepackage{amsthm}     \newtheorem{theorem}{Theorem}      \usepackage{tikz}     \usetikzlibrary{calc}      \usepackage{hyperref}      \begin{document}      \section{A graph for Omer}      \begin{tikzpicture}       \node(A) at (0,0) {$A$};       \node(B) at (10,0) {$B$};       \draw[->] (A)-- node[below]{\autoref{thm1}} (B);     \end{tikzpicture}      \begin{theorem}\label{thm1}       1+1+2.     \end{theorem}     \end{document}

KR
Rainer

omerangel
Posts: 2
Joined: Sat Oct 29, 2016 8:55 pm
Looks great. Thanks!