1

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}

\linespread{1.35}
\begin{document}

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

\end{document}

Many thanks for your help in advance!

Troy
  • 13,741
Helena
  • 45
  • 1
    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. – daleif Sep 13 '17 at 12:46

1 Answers1

2

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}
\usepackage[colorlinks,urlcolor=blue]{hyperref}

\setstretch{1.35}

\begin{document}

\begin{thebibliography}{9}

\bibitem{auth:17} Author (2017): ``Title.'' 
    Retrieved from: \url{http://tex.stackexchange.com} 
   [Accessed: 1 January 2017].

\end{thebibliography}

\end{document}
Mico
  • 506,678