2

Based on this, I have this MWE:

\documentclass[]{article}
\usepackage{tikz}
\usepackage{hyperref}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt, text width=5em] (char) {#1};}}
\usepackage{lipsum}        

\begin{document}
Numbers aligned with the text:  \label{page1}.
\lipsum[1-20]

Now refer back to page \circled{\pageref*{page1}}
\end{document}

The following output is generated:

image

The hyperlink only points from the number (the red rectangle around it). What I need is the whole circle will be hyperlinked (so, clicking anywhere in the circle would work). Any advice?

hola
  • 4,026
  • 3
  • 35
  • 72

1 Answers1

2

This does it.

\documentclass[]{article}
\usepackage{tikz}
\usepackage{hyperref}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt, text width=5em] (char) {#1};}}
\usepackage{lipsum}        

\begin{document}
Numbers aligned with the text:  \label{page1}.
\lipsum[1-20]

Now refer back to page \hyperref[page1]{\circled{\pageref*{page1}}}
\end{document}