title: latex newenvironment label
body: <p>I have the following <code>newenvironment</code> command:</p>
  
  <pre><code>\newcounter{algoctr}[chapter] \setcounter{algoctr}{0}
  \newenvironment{algo}[1] {
  \refstepcounter{algoctr}\vspace{0.2cm}\noindent{\bf Algorithm
  \arabic{chapter}.\arabic{algoctr}: #1}}{\par}
  </code></pre>
  
  <p>and I use it thusly</p>
  
  <pre><code>\begin{algo}{blabbing a blah}
   blah
   blah
  \label{eq:blabbing}
  \end{algo}
  </code></pre>
  
  <p>However, every time I reference the label (\ref{eq:blabbing}), I get a "1", instead of a "1.1". </p>
  
  <p>Could someone kindly let me know what I'm doing wrong?</p>
  
  <p>Thanks</p>