# Refer to arbitrary text (without numbering and not by section)

So we can refer to sections with counter via \label{…} and \ref{…}.

We can refer to sections with custom text via package hyperref like so:
https://tex.stackexchange.com/a/70153

We can refer to arbitrary text with counter like so:
https://tex.stackexchange.com/a/4024
https://tex.stackexchange.com/a/179008
https://stackoverflow.com/a/3914144
https://tex.stackexchange.com/a/150061

But how can we refer to arbitrary text with custom text ? I.e. refer to an arbitrary location in the document with our custom text.

For example, let's say I want to refer to the previous paragraph using the word "previous" (no counters).

Can this be done? (I'm new to LaTeX).
Thanks.

I've also read the Sharelatex's documentation on cross-referencing but did not find an answer.

• you can use hyperref's hypertarget and hyperlink markup (this is unrelated to sharelatex) Jun 28, 2018 at 18:24
• @DavidCarlisle ok I found it here. Shall I delete this question? Jun 28, 2018 at 19:16
• nah I've answered now:-) Jun 28, 2018 at 19:17

\documentclass{article}

\usepackage{hyperref}

\begin{document}

one two three

\phantomsection\label{zzz}four five six

\clearpage

see \hyperref[zzz]{previous} paragraph on a different page so the link jump is clearer.

\end{document}

• Thanks! It's the answer. Can you tell me what is \phantomsection additionally here? Jun 28, 2018 at 19:23
• it leaves the invisible anchor at that point, like a section heading would so the \label and \hyperref can make a link back (the older \hypertarget would also set a target but only at the pag elevel, see texdoc hyperref, section 4 @thanopi57 Jun 28, 2018 at 19:43