1

At the moment I am using a reference to an enumeration within an algorithm box. However, the reference only shows the number of the enumeration but nothing of the algorithm. How can I put the number of the algorithm in front of the item number of the enumeration? Is it possible to override \ref with an if condition to check if it is inside of an algorithm box?

\begin{algorithm}[h!]
 \caption{Random Forest}\label{alg}
 \begin{enumerate}
  \item For $m = 1$ to $M$:\label{alg:loop}
  ...
 \end{enumerate}
\end{algorithm}

such that the "new" (\ref{alg:loop}) would be equal to current (\ref{alg}.\ref{alg:loop})

  • Is this question still 'alive'? I wonder that enumerate is possible in an algorithm environment at all, since those algorithm - related environments are quite special in their LaTeX coding. Please post a compilable document, not just fragments – user31729 Dec 30 '18 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.