6

Is it possible to create hyperlinks in LaTeX that will show up as arbitrarily defined strings in the output (PDF/DVI)?

For example, something like to appear in the output file:

Text text text text text text text text text text.

Here, would direct the reader to a position in the document that would be chosen arbitrarily by the user, e.g. to the end of the 45th paragragh.

Werner
  • 603,163
User 17670
  • 4,722

1 Answers1

6

I think you're looking for the hypertarget and hyperlink commands from the hyperref pacakge.

\documentclass{article}
\usepackage{lipsum}
\usepackage{hyperref}

\begin{document}

In the beginning \hyperlink{linkanchorname}{Text text text text text text text text text text.}

\lipsum
\lipsum
\lipsum
\lipsum
\lipsum

\hypertarget{linkanchorname}{Here's our anchor!}
\end{document}

The example I've demonstrated above is very simplistic, but you can do a lot with this idea. For example, you can link questions and answers to and from each other which has been demonstrated in a lot of questions- Adding another answer hyperlinked to the question itself is one such example.

cmhughes
  • 100,947