0

I want to make a reference in my thesis work and I want to make a link to a source using \textit

\begin{thebibliography}{9}
\bibitem{hinton} 
Jeffrey Hinton(2012)  
\textit{Neural Networks for Machine Learning}
[\textit{Lecture 3.4 — The backpropagation algorithm}] 
\\\textit{https://github.com/mebusy/notes/blob/master/dev_notes/NeuralNetworks.md} 
\end{thebibliography}

But it transformes https://github.com/mebusy/notes/blob/master/dev_notes/NeuralNetworks.md link(which is correct) to this one https://github.com/mebusy/notes/blob/master/devnotes=NeuralNetworks:md (which is incorrect. How can I fix it?

EDIT: I added \url, but then he link doesn't work:

\bibitem{hinton} 
Jeffrey Hinton(2012)  
\textit{Neural Networks for Machine Learning}
[\textit{Lecture 3.4 — The backpropagation algorithm}] 
\\\textit{\url https://github.com/mebusy/notes/blob/master/dev_notes/NeuralNetworks.md} 
moewe
  • 175,683
  • 5
    Links should be typeset with url's/hyperref's \url command. If you insist on writing URLs in italic, set \urlstyle{same} and put an \textit around it (see https://tex.stackexchange.com/q/53962/35864) – moewe Jun 13 '18 at 20:24
  • @moewe I updated the post. Please have a look – Daniil Yefimov Jun 13 '18 at 20:27
  • 4
    \url is not a switch. It takes the URL as an argument (between curly braces): \textit{\url{https://github.com/mebusy/notes/blob/master/dev_notes/NeuralNetworks.md}} – moewe Jun 13 '18 at 20:28

1 Answers1

5

Here's how I would rework your setup. It's basically identical to what @moewe suggests in earlier comments. Note that it's important to load both the url and the hyperref package.

enter image description here

\documentclass{article}
\usepackage{geometry}
\usepackage[hyphens,spaces]{url}
\urlstyle{same}
\usepackage[colorlinks,urlcolor=blue]{hyperref} % choose a suitable color for URLs
\begin{document}

\begin{thebibliography}{9}

\bibitem{hinton} 
Jeffrey Hinton (2012)  
\textit{Neural Networks for Machine Learning. 
Lecture 3.4---The backpropagation algorithm} \\ 
\textit{\url{https://github.com/mebusy/notes/blob/master/dev_notes/NeuralNetworks.md}}

\end{thebibliography}
\end{document}

Incidentally, the reason

\textit{\url https:... }

doesn't work is that \url expects to get a braces-delimited argument. Because you fail to provide these braces, the argument of \url ends up being the single letter h, not the entire URL string.

Mico
  • 506,678
  • 1
    That space in Jeffrey Hinton (2012) was much needed. And the Unicode em-dash in Lecture 3.4 — The also made me cringe... (although that might just be old habits) – moewe Jun 13 '18 at 20:47