I would like to have an if-then-else
statement in the output block, with this MWE:
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\usepackage{amsmath}
\begin{document}
\begin{algorithm}[H]
\SetKwInput{Output}{Output}
\Output{
\eIf{QP is feasible}{
$x^*$: primal solution of problem (1)\newline
$\lambda^*$: dual solution solving (2).
}{
infeasibility status.
}
}
\caption{QP solver}
\end{algorithm}
\end{document}
Is there a way of getting the lines of the if-then-else
block aligned with the first if if
?
Like this:
Thanks!