Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Comment after \if in algorithm2e ?

4,023 views
Skip to first unread message

snnopy67

unread,
Sep 30, 2008, 4:47:58 AM9/30/08
to
Does anyone know how I can print a side comment in the same line as an
\if statement within an algorithm2e environment?

More specifically, I would like to write

\begin{algorithm}
\dontprintsemicolon
\If{x \tcp*{ bla } }
{
}
\end{algorithm}

but that prints:

if x; // bla
then

which looks very ugly.

I have also tried

\If{x} \tcp*{ bla }

but that gives me an error (Argument of \algocf@tcp has an extra }).


Any ideas or suggestions will be highly appreciated.

Best regards,
Gabriel.

adrianho...@yahoo.com

unread,
Oct 13, 2013, 1:18:22 PM10/13/13
to
\If(\tcp*[f]{bla}){x}{...}

helloa...@gmail.com

unread,
Oct 29, 2015, 12:42:56 PM10/29/15
to
Thanks that helps.

ale.c...@gmail.com

unread,
Nov 20, 2017, 2:28:29 AM11/20/17
to
WHERE HAVE YOU BEEN ALL MY LIFE.


thank you

A grateful user

unread,
Jun 5, 2018, 3:34:31 PM6/5/18
to
You will probably never see this, but thanks man, you made my day!
0 new messages