I'm making a Beamer presentation and I need space, so I want to hide the inputs and outputs and instead only show my algorithm. But when I simply don't write the input keyword, then the line numbers suddenly disappear:
\documentclass{article}
\usepackage{algorithm2e}
\begin{document}
\begin{algorithm}[H]
\DontPrintSemicolon
\LinesNumbered
\SetKwInOut{Input}{Input}
\Input{} % can't omit this, else line numbers don't work ...
line 1\;
line 2\;
line 3\;
line 4\;
line 5\;
\end{algorithm}
\end{document}
With \Input:
Without it:
Note: in beamer directly the bug is weirder, as line number show, but are shifted vertically:



