# How to use package setspace whit package hyperref, like this: \ node {\ href {https://google.com} {\ begin {spacing} {2} Text \ end {spacing}}}?

How to use package setspace whit package hyperref. because I've been getting the following error below when I try to generate the tex file described in my MWE:

! Missing \endgroup inserted. \endgroup l.5 ...google.com}{\begin{spacing}{2} \end{spacing}} };

Here my MWE:

\documentclass{article}
\usepackage{hyperref,setspace,tikz}
\begin{document}
\begin{tikzpicture}
\end{tikzpicture}
\end{document}


Re-written like this, there are no problems:

\documentclass{article}
\usepackage{hyperref,setspace,tikz}
\begin{document}
\end{document}


But I got the same error rewriting like this:

\documentclass{article}
\usepackage{hyperref,setspace,tikz}
\begin{document}
\begin{tikzpicture}

• The first thing one may try out before putting something in a node is whether it works outside of a node. Just putting \href{https://google.com}{\begin{spacing}{2} \end{spacing}} produces ! pdfTeX error (ext1): \pdfendlink cannot be used in vertical mode. \close@pdflink ...\Hy@VerboseLinkStop \pdfendlink l.4 ...ogle.com}{\begin{spacing}{2} \end{spacing}} so I suggest you first try to invent something that works outside TikZ before trying to embed it in a node. – user121799 Mar 24 '19 at 19:35
• I cannot compile the document you refer to as working with pdflatex, but xelatex works. And with xelatex also \documentclass{article} \usepackage{hyperref,setspace,tikz} \begin{document} \begin{tikzpicture} \draw node[text width=4cm] {\href{https://google.com}{\begin{spacing}{2} Line1 \linebreak Line2 \end{spacing}}}; \end{tikzpicture} \end{document} works, so I can put it into a node. – user121799 Mar 24 '19 at 20:26