TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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.

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?

share|improve this question
The specific example could be done with an enumerated list, is there a reason why you don't want to do that? – Loop Space 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
up vote 14 down vote accepted

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

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.

share|improve this answer

For who ever might be interested, adapted from Will Robertson's solution:

Problem: You wish to have an enumeration (e.g. an enumeration of 'hypotheses' in a research proposal) throughout the text, and reference that enumeration in the text.

Solution: Define


and use as:

This shall be hypothesis \hyplabel{HYP:CRAZY_HYPOTH}. I shall explain hypothesis \hypref{HYP:CRAZY_HYPOTH} below.
share|improve this answer

Your Answer


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.