12

With the following code, I have an unwanted semi-colon at the end of the loop condition.

enter image description here

Here is MWE.

\documentclass{article}
    \usepackage[lined]{algorithm2e}

\begin{document}

\begin{algorithm}
    \Begin{
        \uIf{Condition}{
                \Repeat{Stop}{Action}
        }
    }
\end{algorithm}

\end{document} 

How can I change this ?

1

2 Answers 2

12

You can also use \DontPrintSemicolon.

9

Use \SetEndCharOfAlgoLine{}:

enter image description here

Code:

\documentclass{article}
\usepackage[lined]{algorithm2e}

\begin{document}
\SetEndCharOfAlgoLine{}

\begin{algorithm}
    \Begin{
        \uIf{Condition}{
                \Repeat{Stop}{Action}
        }
    }
\end{algorithm}

\end{document} 
2
  • Thanks. It is strange that there is semi-colons for REPEAT loop but not for WHILE loop.
    – projetmbc
    Oct 20, 2012 at 8:25
  • The OP also has this mistake but there really should have been an end closing the if, just as there is an end closing the begin. It would be nice if you could fix this to show how to use the package properly.
    – user10274
    Oct 20, 2012 at 9:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .