i have problem with the latex command \numberwithin. i use it in combination with the algorithm package to set the numbering of all algorithms to the chapter level:
Code: Select all
usepackage{algorithmic}
\usepackage[boxed]{algorithm}
\numberwithin{algorithm}{chapter}
Code: Select all
\begin{algorithm} % enter the algorithm environment
\label{alg:algo} % and a label for \ref{} commands later in the document
\underline{Objective} \\[10pt] bla.\\[10pt]
\caption{some algorithm} % caption
\end{algorithm}
Code: Select all
\ref{alg:algo}
that means for example if the i add the algorithm inside section 2.5.1.2, which obviously is in chapter 2, the algorithm box correctly displays "Algorithm 2.1" but the reference (Algorithm \ref{alg:algo}) to the algorithm is displayed as "Algorithm 2.5.1.2".
Can anyone please give me a hand to solve this?