URL PDF 故障

URL PDF 故障

我对 Latex 还比较陌生,曾尝试将 URL 包含到我的参考书目中。不幸的是,每当我尝试从 PDF 中打开它时,链接都不起作用(我猜是因为它认为换行符处有一个空格)

\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}

非常感谢您的帮助!

答案1

您应该同时加载urlhyperref包。前者提供以可视化方式格式化 URL 字符串的工具。后者包提供创建超链接的机制。

哦,既然你正在加载setspace包,你不妨用\linespread{1.35}替换\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}

相关内容