1

The minimal (not) working example is

\documentclass{article}
\usepackage[algo2e,ruled,vlined]{algorithm2e}
\begin{document}
 \begin{algorithm2e}[h]
  \SetKwProg{myproc}{Procedure}{}{}    
  \myproc{foo()}{
   $\ldots$
  }   
 \end{algorithm2e} 
\end{document}

This example works on Windows with latest version of portable Miktex. However, it doesn't work on Linux (I try Ubuntu and Debian) with texlive installed. Both Linux system is updated. The error I got on Linux is

! Undefined control sequence.
l.6   \SetKwProg
            {myproc}{Procedure}{}{}

Note, that with texlive I successfully Latex many algorithms, the only command which is not working is \SetKwProg. Any suggestion how to resolve this problem?

closed as too localized by lockstep, Claudio Fiandrino, Werner, mafp, T. Verron Jun 22 '13 at 14:52

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Include \listfiles as part of your document preamble and check your .log for the version number of algorithm2e. It should report the same as what's on CTAN: 5.0. If not, then you don't have the most up-to-date version, so read How do I update my TeX distribution? – Werner Jun 22 '13 at 14:11
  • Package `algorithm2e' Release 3.9 -- october 04 2005. It is probably old.I hope that system will offer updates when they exist. I am going to read manual for updating. – Dejan Jun 22 '13 at 14:27
  • 1
    You can download algorithm2e from CTAN and place it your local TEXMF folder or overwrite the existing version in your tree. Remember to refresh the filename database afterwards (mktexlsr). – Werner Jun 22 '13 at 14:29
  • For more on this, see Where do I place my own .sty files, to make them available to all my .tex files?, since you'll be using "your own" version of algorithm2e. – Werner Jun 22 '13 at 14:32
  • I am trying to put this package in my local TEXMF folder, but I cannot find it. /usr/local/texlive does not exist on my system as well as ~/texmf. Is there some command to find my local tex folder? – Dejan Jun 22 '13 at 14:44
3

Simply you have an older version of the algorithm2e package. The command \SetKwProg is supported only by the latest version 5.0.

TeX Live on Debian and Ubuntu is known to be not updated.

The thread How to install “vanilla” TeXLive on Debian or Ubuntu? might help you on what to do to get an updated version.

  • Thank you for the answer. But what should I do to resolve this? There is no update for texlive on my system and algorithm2e is part of texlive-science package, which is up to date. Is there some equivalent command which works on previous versions? – Dejan Jun 22 '13 at 14:15
  • @Petar: besides Werner's comment up, you have to consider that if you installed TeX Liva via apt-get, you probably do not have a recent distribution as karlkoeller pointed. The link he provided might help you in installing an updated TeX Live, which is TeX Live 2013 out from few days. – Claudio Fiandrino Jun 22 '13 at 14:31

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