11

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 ?

10

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} 
  • Thanks. It is strange that there is semi-colons for REPEAT loop but not for WHILE loop. – projetmbc Oct 20 '12 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 '12 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.