Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
In addition to the fix in my answer, I suggest you contact the author of cleveref. He is very responsive to user requests, and will likely add support for algorithm2e if you explain to him what is needed. –  Lev Bishop Jan 28 '11 at 16:07
add comment

1 Answer 1

up vote 7 down vote accepted

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

\crefname{algocf}{alg.}{algs.}
\Crefname{algocf}{Algorithm}{Algorithms}
share|improve this answer
    
This solved my problem. But I have another question. How did you know to choose for the type algocf? Where is it documented? Thanks a lot in any case! –  Dror Jan 28 '11 at 7:48
1  
From the log-file, without the above commands: LaTeX Warning: cref reference format for label type algocf' undefined on input line 27.` –  Lev Bishop Jan 28 '11 at 14:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.