
Estoy escribiendo un algoritmo con algoritmo2e.
Quiero hacer un if en línea con \lIf
un comentario en la misma línea con \Comment*
.
\documentclass{article}
\usepackage[vlined,boxed,linesnumbered]{algorithm2e}
\DontPrintSemicolon
\SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{}
\SetKwComment{Comment}{}{}
\begin{document}
\begin{algorithm}[ht]
\lIf{true}{%
foo \Comment*{bar}
}
\caption{Test}
\end{algorithm}
\end{document}
Pero produce una línea adicional no deseada:
¿Cómo eliminarlo?