For a book I am writing I defined a new environment, called "example." It
is not a theorem-like environment, but an ordinary environment. Anyway,
I'm having trouble referencing it. I defined a counter to go with it, so
I assumed that if I gave a label to the environment, as in
\begin{example}\label{ex:1}
...
\end{example}
and then later used \ref{ex:1}, that this would work. It doesn't. It
compiles fine, but the example numbers on the the references are all
wrong.