Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 ?

share|improve this question
    
Related Question: ending statements in algorithm2e environment. –  Peter Grill Oct 20 '12 at 8:26
add comment

2 Answers

up vote 5 down vote accepted

You can also use \DontPrintSemicolon.

share|improve this answer
add comment

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} 
share|improve this answer
    
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. –  Marc van Dongen Oct 20 '12 at 9:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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