Discussion:
Comment after \if in algorithm2e ?
(too old to reply)
snnopy67
2008-09-30 08:47:58 UTC
Permalink
Raw Message
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 \***@tcp has an extra }).


Any ideas or suggestions will be highly appreciated.

Best regards,
Gabriel.
a***@yahoo.com
2013-10-13 17:18:22 UTC
Permalink
Raw Message
\If(\tcp*[f]{bla}){x}{...}
Post by snnopy67
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}
if x; // bla
then
which looks very ugly.
I have also tried
\If{x} \tcp*{ bla }
Any ideas or suggestions will be highly appreciated.
Best regards,
Gabriel.
h***@gmail.com
2015-10-29 16:42:51 UTC
Permalink
Raw Message
Thanks that helps.
a***@gmail.com
2017-11-20 07:28:22 UTC
Permalink
Raw Message
Post by a***@yahoo.com
\If(\tcp*[f]{bla}){x}{...}
Post by snnopy67
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}
if x; // bla
then
which looks very ugly.
I have also tried
\If{x} \tcp*{ bla }
Any ideas or suggestions will be highly appreciated.
Best regards,
WHERE HAVE YOU BEEN ALL MY LIFE.


thank you

Loading...