I am having issues figuring out how to reference an algorithm created with algorithm2e. For my figures, I use:
\begin{figure}
\includegraphics{...}
\caption{Test Caption.}
\label{fig:test_label}
\end{figure}
and the reference with \Cref{fig:test_label} (using package cleveref). All works fine.
However, this does not seem to work with algortihm2e:
\begin{algorithm}
\For{$b\gets 0$ \KwTo $B- 1$}{
...
}
\caption{Test Caption}
\label{alg:test_label}
\end{algorithm}
and then doing \Cref{alg:test_label} results in ??. I would like to have something similar to Figure 1, i.e. Algorithm 1 or Alg. 1.
How do I properly reference an algorithm created with algorithm2e?
Thanks!
EDIT:
Upon further inspection, I noticed that the numbers are actually showing, but the word Algorithm is missing: ?? 1, ?? 2,...


\documentclass{...}and ending with\end{document}.