# Missing $inserted in algorithm2e [closed] I got an error "Missing$ inserted" for the following code：

\begin{algorithm}[ht!]
\If{cond2}{
second if\;
second if\;
}
\caption{Algorithm MyAlgo()}\label{algo:synConstraint}
\end{algorithm}


What is the problem?

-
Please edit your question to include a complete example that reproduces the error. I don't think anything is wrong with the snippet you have provided. –  Ian Thompson Jul 28 '12 at 12:04
Thanks, your comment does help, this is caused by other \usepackage, I just move the line \usepackage[ruled,vlined,linesnumbered]{algorithm2e} to the last one of all the \usepackage, it works! –  william007 Jul 28 '12 at 12:15
@william007: It is ok to answer your own question. Just explain what you have found out and put it in an answer. In this way the question can be marked as answered (after 48h) and others who happen to have the same problem can find it. –  canaaerus Jul 28 '12 at 13:21