I am trying to insert a hyperlink--> http://pages.cs.wisc.edu/~cao/cs537/lecture17.txt in my document, but since its a text file the last part of that link is not working, and it is taking me to the homepage only. I have used the command
\href{http://pages.cs.wisc.edu/~cao/cs537/lecture17.txt}
The complete code
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{jgklgi}
\author{mancdmejldmuxsvsyf}
\date{February 2020}
\begin{document}
\maketitle
\section{Introduction} \usepackage{hyperref} \href{http://pages.cs.wisc.edu/~cao/cs537/lecture17.txt}
\end{document}
\title{jgklgi} \author{mancdmejldmuxsvsyf } \date{February 2020}
\begin{document}
\maketitle
\section{Introduction} \usepackage{hyperref} \href{http://pages.cs.wisc.edu/~cao/cs537/lecture17.txt} \end{document}
– Turing101 Feb 19 '20 at 15:54\usepackage{hyperref}must be placed in the preamble and not in the body of the document. Your code should actually result in an error message about this. – leandriis Feb 19 '20 at 15:56\hreftakes two mandatory arguments (URL and text). I would probably just use\url{URL}– daleif Feb 19 '20 at 16:00\hreftakes two arguments (the url and the link text) and not one. Please test out example code before you post it. In any case, the link works fine if I correct that (i.e., the text file is opened in the browser, Firefox in my case). Maybe your browser has some security setting that prevents you from opening text files? – Marijn Feb 19 '20 at 16:01Can you post the code. It will be very helpful. I am a beginner in latex, started just few days ago
– Turing101 Feb 19 '20 at 16:02\href{http://pages.cs.wisc.edu/~cao/cs537/lecture17.txt}{link}(the second argument islink, which is the text that is shown in the pdf). – Marijn Feb 19 '20 at 16:08