Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
    
Or \hyperref[<label>]{text} and \phantomsection\label{<label>}. –  Werner Sep 1 '12 at 17:01
    
Nice! It's times like these that remind you why you use (La)TeX. –  User 17670 Sep 1 '12 at 17:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.