I need to remove the line numbers only below Step 1 and continue it after Step 2 and skip numbering infront of cc in Step 2.
Please refer to the attached figure and the latex code.
How I can do this?
I even used the command \LinesNotNumbered infront of the lines that I don't want to be numbered but still I have the problem
\documentclass[a4paper,11pt]{report}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\begin{document}
\begin{algorithm}
\DontPrintSemicolon
\KwIn{A,B,C }
\KwOut{D,E,F}
\textbf{Step 1}\\ AAA.\;
BB, \\ee\;
Then go to the home\\
\textbf{Step 2}\\
BB,\\ cc\;
Then go to a hotel\\
\SetAlgoRefName{1}
\caption{Ala kanawa}
\label{algo:sj1}
\end{algorithm}
\end{document}
Best Answer
Use
\LinesNumberedHidden
(inside a group if the effect is to be kept local) to suppress numbers and then add the numbering to the desired lines (this can be done with a command using\nlset
with a user defined counter):