# 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}
\end{tikzpicture}
\end{document}


Note: I've already tried using the align = center key advised by @marmot when answering an earlier question of my own. See:I could not use spacing inside the node

• 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, 2019 at 19:35
• Hi @marmot, I rewrote the tex file and generated the pdf without problems, thus (without the preamble): \ begin {document} \ href {google.com} {\ begin {spacing} {2} Line1 \ linebreak Line2 \ end {spacing}} \ end {document}. But I got the same error rewriting like this (without the preamble): \ begin {tikzpicture} \ href {google.com} {\ begin {spacing} {2} Line1 \ linebreak Line2 \ end {spacing}} \ end {tikzpicture}. Mar 24, 2019 at 19:53
• 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, 2019 at 20:26