How is possible to define labels and corresponding references to a self-defined environment within latex?
Example:
\newcounter{fpcounter}
\newenvironment{fp}[2]
{
\stepcounter{fpcounter}
\label{#1}
\textbf{Problem~\arabic{fpcounter}}
}
{}
Any references to the included label though get redirected to the surrounding section/subsection/paragraph though.
Any hints?
Thanks a lot.
Use
\refstepcounterinstead of\stepcounter. This sets what the\labelcommand will use, and redefinethefpcounterwith\renewcommand{\thefpcounter}{\arabic{fpcounter}}. This yieldsAlso, have provided some other options depending on how you want to label the custom environment.