URL PDF Malfunction

I'm relatively new to Latex and tried to include an URL into my bibliography. Whenever I try to open it from the PDF unfortunately the link does not work (I guess because it thinks there's a space where the line break is)

\documentclass[12pt] {article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{stackengine}
\usepackage{tabularx}
\usepackage{tikz}
\usepackage{url}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,decorations.pathreplacing}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[toc,page]{appendix}

\begin{document}

Author (2017): titel,''. Retrieved from: {\url{http://tex.stackexchange.com}} [Accessed: 1 January 2000]

\end{document}


• If you want the link to be clickable then use hyperref. I think now what you are seeing is your PDF previewer trying to be smart and guessing that this is an URL attempting to making it clickable, and as you mention, getting confused by the line break. Sep 13 '17 at 12:46

You should load both the url and the hyperref packages. The former provides tool to format URL strings visually. The latter packge provides the machinery to create hyperlinks.

Oh, since you're loading the setspace package, you might as well replace \linespread{1.35} with \setstretch{1.35}.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{setspace,amsmath,amssymb,graphicx}
\usepackage{caption,stackengine,tabularx,tikz}
\usetikzlibrary{arrows,positioning,decorations.pathreplacing}
\usepackage[toc,page]{appendix}

\usepackage[hyphens,spaces]{url}

\setstretch{1.35}

\begin{document}

\begin{thebibliography}{9}

\bibitem{auth:17} Author (2017): Title.''
[Accessed: 1 January 2017].

\end{thebibliography}

\end{document}

• Thanks for your help! When I use the hyperref package, my table of content disappears. Sep 13 '17 at 13:04
• Did you rerun latex twice after adding the hyperref package?
– Mico
Sep 13 '17 at 13:07
• No, I didn't! Thank you very much! It's working now (both the url and the table of content). Thanks!! Sep 13 '17 at 13:08