
Estou escrevendo um algoritmo com algoritmo2e.
Quero fazer um if inline com \lIf
um comentário na mesma linha do \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}
Mas produz uma linha extra indesejada:
Como removê-lo?