[Tex/LaTex] cleveref and algorithm2e

algorithm2ealgorithmscleverefcross-referencing

I'm currently working on a document where I was using algorithm+algorithmic along with cleveref. With this everything worked perfectly.

Now I had to replace algorithm+algorithmic with algorithm2e. Ever since, I cannot \cref to the label in the algorithm environment. More explicitly, I can refer but \cref doesn't generate a text in front of the number (which is correct) of the algorithm.

I couldn't find any reference to algorithm's packages in the cleveref documentation. Any ideas?

Best Answer

You need to tell cleveref how you want to refer to the algorithms. Something like:

\crefname{algocf}{alg.}{algs.}
\Crefname{algocf}{Algorithm}{Algorithms}
Related Question