# How to set a marker/counter/label to an arbitrary piece of text?

Is it possible to attach a marker to just a place in text, not to section, sub-section, etc.?

This is what I'm trying to achieve:

\begin{document}
Alex (see~\ref{alex}) is a boy,
Jessica (see~\ref{jessica}) is a girl.
[...]
\label{alex}\ref{alex}: Alex Johnson: 4 y.o.
\label{jessica}\ref{jessica}: Jessica D.: 5 y.o.
\end{document}


I want to get something like this:

Alex (see 1) is a boy,
Jessica (see 2) is a girl.
[...]
1: Alex Johnson: 4 y.o.
2: Jessica D.: 5 y.o.


Makes sense?

-
The specific example could be done with an enumerated list, is there a reason why you don't want to do that? –  Andrew Stacey Oct 12 '10 at 11:28
@Andrew This is just an example. Correct solution is proposed by Will Robertson below. –  yegor256 Oct 12 '10 at 11:30

You can only \ref-er to a \label that has been attached to a counter using \refstepcounter. For example:

\newcounter{foo}
...
Alex (see~\ref{alex}) is a boy,
Jessica (see~\ref{jessica}) is a girl.
[...]
\refstepcounter{foo}\thefoo\label{alex}: Alex Johnson: 4 y.o.
\refstepcounter{foo}\thefoo\label{jessica}: Jessica D.: 5 y.o.


Internally, this is the way that all labelling and referencing is done with sections, figures, and so on.

-
That's exactly what I'm looking for, thanks! –  yegor256 Oct 12 '10 at 11:29