[Tex/LaTex] Undefined control sequence in algorithm package

algorithm2eUbuntu

I am using Ubuntu 11.04 with TeXmaker and TeX Live. There is a \newenvironment definition in my LaTeX file:

\newenvironment{algo}[1]{%
  \begin{algorithm}[#1]
    \SetTitleSty{textsc}{normalsize}
    \SetInd{0.25em}{0.25em}
    \SetAlgoVlined
    \SetNlSty{normal}{}{}
    \DontPrintSemicolon
    \SetKwComment{tcp}{}{}
    \small
  }{%
    \vspace{-0.5ex}
  \end{algorithm}
}

And the use is something like

\begin{algo}{t}
...
\end{algo}

which gives an error:

! Undefined control sequence.
\algo ... \SetInd {0.25em}{0.25em} \SetAlgoVlined 
                                                  \SetNlSty {normal}{}{} \Do...

The file compiles well on Windows 7 + MikTeX.

Anybody else facing similar problems on Ubuntu?

Best Answer

You might have an old version of the algorithm2e package -- I know mine's from the ubuntu repos texlive distro, and I have to use \dontprintsemicolon instead of the capitalized version.

You can either find out whether there are old analogues for the commands you're trying to use, update the algorithm2e package on your local tex distribution, or provide a copy of the latest algorithm2e.sty in the directory where it's being compiled.

Edit: in case you do have an old version (which you probably do, with the texlive from ubuntu repos), here's the corresponding commands:

  • \SetAlgoVlined is \SetVline
  • As mentioned, \DontPrintSemicolon is \dontprintsemicolon