I am new to LateX. I am trying to use an example found here: Making TikZ nodes hyperlinkable to create a button with a hyperlink. I am wondering if anyone could tell me how to allow for rounded corners? Currently, the highlight upon mouseover is falling outside the button border at the corners in my MWE. Please see my editable MWE at OverLeaf: https://www.overleaf.com/8987688858pxfhygschhmk I am wondering if there is a way to make the highlight conform to the button border?
Here is another MWE:
\documentclass{article}
\usepackage{tikz, pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{fit, shapes, automata, backgrounds, positioning, shadows, patterns, calc, arrows.meta, shapes.geometric, decorations.shapes, decorations.fractals, decorations.markings, decorations.pathmorphing}
\usepackage[hidelinks]{hyperref}
\tikzset{
test highlight/.style={draw=black, draw opacity=0.8},
hyperlink node/.style={
alias=sourcenode,
append after command={
let \n0={\pgfkeysvalueof{/pgf/outer xsep}},
\n1={\pgfkeysvalueof{/pgf/outer ysep}},
\p1=([shift={(\n0, -\n1)}] sourcenode.north west),
\p2=([shift={(-\n0, \n1)}] sourcenode.south east),
\n2={\x2-\x1},
\n3={\y1-\y2} in
node [inner sep=0pt, outer sep=0pt, anchor=north west, at=(\p1), test highlight] {\hyperlink{#1}{\XeTeXLinkBox{\phantom{\rule{\n2}{\n3}}}}}
}
}
}
\begin{document}
\begin{tikzpicture}[overlay, button/.style={fit={(0cm,0cm) (6.3cm,1.5cm)}, fill=blue, draw=none, drop shadow, text=white, rounded corners=.75cm, inner sep=0pt, outer sep=0pt, label=center:\textcolor{white}{\huge\textsc{Read Me}}}]
\node[button, hyperlink node=bottom] at (0cm,0cm) {};
\end{tikzpicture}
\vfill
\hypertarget{bottom}{{Bottom of Page}}
\end{document}
test highlightis not defined. – Ulrike Fischer May 31 '23 at 08:18