title: References to self-created environments in latex
body: <p>How is possible to define labels and corresponding references to a self-defined environment within latex?</p>
  
  <p>Example:</p>
  
  <pre><code>\newcounter{fpcounter}
  \newenvironment{fp}[2]
  {
  \stepcounter{fpcounter}
  \label{#1}
  \textbf{Problem~\arabic{fpcounter}}
  }
  {}
  </code></pre>
  
  <p>Any references to the included label though get redirected to the surrounding section/subsection/paragraph though.</p>
  
  <p>Any hints?
  Thanks a lot.</p>