
algorithm2e を使ってアルゴリズムを書いています。
\lIf
と同じ行にコメントを付けて、インライン if を実行したいと思います\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}
どうやって削除するのですか?