title: How to define in LaTeX a new counter that includes the chapter number too?
body: <p>Given I have defined a new environment for which a counter is maintained:</p>
  
  <pre><code>\newcounter{bioclipse}
  \newenvironment{bioclipse}[2][]{
     \begin{shaded}\refstepcounter{bioclipse}\par\medskip\noindent%
     \textbf{Bioclipse Excursion~\thechapter-\thebioclipse #1: #2
     \vspace{0.1cm} \hrule \vspace{0.1cm}}
     \rmfamily}{\medskip \end{shaded}
  }
  </code></pre>
  
  <p>Now, I can add a label to such an environment:</p>
  
  <pre><code>\begin{bioclipse}{Wizards: New Molecule from SMILES}
    \label{chapCompRepr:ex:fromSMILESWizard}
    Bioclipse has a \textit{New Wizard} to create a new chemical graph.
  \end{bioclipse}
  </code></pre>
  
  <p>This outputs a text with caption and a number. Because it uses \thechapter, this number will include the chapter number too; that is, the first environment in Chapter 3, will be numbered in 3-1. In the output, that is.</p>
  
  <p>However, when I refer to it with \ref{chapCompRepr:ex:fromSMILESWizard}, this number does not include the chapter number... How should I change my environment definition, or counter definition that it includes the chapter number, and resets the second number for each chapter?</p>