# [OS X TeX] reference to a numbered newenvironment,

Alain Schremmer schremmer.alain at gmail.com
Sun Dec 13 15:16:36 CET 2015

On , at 2015 Dec 12,11:34 PM, Victor Ivrii wrote:

>
>
> On Sat, Dec 12, 2015 at 10:58 PM, Alain Schremmer <schremmer.alain at gmail.com> wrote:
> When referring to a numbered newenvironment, I have the fancyref "notorious FAQ problem" namely "I get a section number".
>
> Right now, for \label{Agreement:sign}, \ref{Agreement:sign} returns the chapter.section number instead of, say, Agreement 4.
>
> What is it that I am missing?
>
> Hopeful regards
> --schremmer
>
>
> How do you introduce your \newenvironment? Is there \refstepcounter in its definition?

\newcounter{agr}
\newenvironment{AGREE}{
\textsf{\bfseries{AGREEMENT}
\refstepcounter{agr}
\thechapter .\theagr
.
\hspace{2.5mm}
}
\sffamily
}

I would like fancyref to pick up \theagr the way it does with figures and tables. (As usual, not understanding fancyref.pdf, I have much tried and erred but to no avail. )

@Gerhardt
Thanks, but at this point, I would rather not use newtheorem because that would force me to change too many already existing environments.

--schremmer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20151213/fc665ddc/attachment.html>