What is the autoref command to reference a line number of an algorithm? I tried to define stepautorefname, linenoautorefname and alglinenoautorefname commands as shown below but they don't work like the algorithmautorefname command.


            colorlinks  = true,
            linkcolor   = blue,
            urlcolor    = blue,
            citecolor   = blue,
            anchorcolor = blue]{hyperref}



\caption{Algorithm} \label{alg:A}
\REQUIRE $Input$
\STATE D \label{step:A4}

In \autoref{step:A4} of \autoref{alg:A}

The compilation log already gives a useful hint:

Package hyperref Warning: No autoref name for `ALC@unique' on input line 32.

So the command name prefix should be ALC@unique. We then only need to make sure the @ character is allowed in command names and can define


which yields the desired result.

enter image description here

Your Answer

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

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