I'm trying to write an algorithm using the package algorithm2e
.
This is my code:
\usepackage[linesnumbered,ruled]{algorithm2e}
...
{\footnotesize
\IncMargin{1em}
\begin{algorithm}[H]
\SetAlgoVlined
\SetAlgoNlRelativeSize{-1}
\SetNlSkip{1em}
$ALIGNMENTS \gets NEXT$\;
\BlankLine
\While{$(C_{cov} > 0) \wedge (|ALIGNMENTS| > 0)$}{
$NEXT \gets 0$\;
\ForEach{$A \in ALIGNMENTS$}{
$U \gets checkAlignments(\mu,A,C_{cov})$\;
\uIf{$|U| = 1$}{
$\mu \gets updateProfile(\mu,U)$\;
}
\Else{
$NEXT = NEXT \cup \{A\}$\;
}
}
\If{$|ALIGNMENTS| = |NEXT|$}{
$C_{cov} \gets C_{cov} - 1$\;
}
$ALIGNMENTS \gets NEXT$\;
}
\BlankLine
\KwRet{$\mu$}\;
\end{algorithm}
}
The problem is that the line numbers are not properly aligned: for example the 9 is a lot more on the right than the 1.
So, how can I properly align them horizontally?