2

As per Mico's suggestion (and my indomitable curiosity), here is the question:

What are the differences among \href, \hyperlink and \hyperref?

\documentclass{article}
\usepackage[hyphens,spaces,obeyspaces]{url}
\usepackage[colorlinks,allcolors=blue]{hyperref}

\begin{document} \url{https://en.m.wikipedia.org/wiki/Spirit_way}

\href{https://en.m.wikipedia.org/wiki/Spirit_way}{Wikipedia page: Spirit Way}

\hyperlink{https://en.m.wikipedia.org/wiki/Spirit_way}{Wikipedia page: Spirit Way}

\end{document}

And, what is the deal with \hypertarget anyway?

hola
  • 4,026
  • 3
  • 35
  • 72
  • see https://tex.stackexchange.com/a/553769/2388 – Ulrike Fischer Nov 30 '20 at 07:31
  • 2
    I guess \url is clear: It typesets the URL and links it. It sort of works like \href{<url>}{\nolinkurl{<url>}}, where \nolinkurl{<url>} just typesets the URL. \href{<url>}{<text>} typesets <text> and links it to <url>. \hyperlink{<target name>}{<text>} typesets <text> and links it to <target name>. A link target can be created with \hypertarget{<target name>}{<text>} inside your document. So \hyperlink can be used to refer back to a different, arbitrary part of your document that has been marked up with \hypertraget. – moewe Nov 30 '20 at 07:32
  • Then there is \hyperref[<label>]{<text>} which typesets <text> and links it to the target of the label <label> that you'll have generated with \label{<label>} somewhere in your document. (I'm not sure if that is technically accurate, but you can sort of imagine this as similar to \hyperlink, with \label automatically generating the corresponding \hypertarget for you.) – moewe Nov 30 '20 at 07:33
  • you have a question about three commands and an example code demonstrating three different commands? – David Carlisle Nov 30 '20 at 07:50
  • @DavidCarlisle Should I delete it? – hola Nov 30 '20 at 08:00
  • @hola I was just suggesting you clarify it: are you asking about \href,\hyperref,\hyperlink or about \url, \href,\hyperlink, or about all four. But perhaps you could consider the question a duplicate of the one Ulrike links to in the first comment and close it for that reason? – David Carlisle Nov 30 '20 at 08:08

0 Answers0