5

I am trying to use the algorithm2e package in MikTeX, but when I put these commands:

\dontprintsemicolon
\SetLine

it doesn't recognize them. I do not understand why; I have used these commands before in another machine without a problem. The package algorithm2e is installed: I checked in the package manager and the directory and it appears to be installed.

1

2 Answers 2

9

Try to replace them with

\DontPrintSemicolon
\SetAlgoLined

I think that at some point of time (version 4.0 and newer) the old syntax was removed. You can also try to pass the oldcommands option to the package, which should enable the old form of the commands.

1
  • 1
    This works.. but I hate having to do that.
    – Flethuseo
    Commented Feb 3, 2011 at 16:54
3

Debian and Ubuntu did not update their texlive-science package for the latest version of algorithm2e. So if you are using algorithm2e and compiling your LaTeX documents on Windows and Linux environment you will bumb to this problem constantly. Simply changing the commands does not help much, since you need to change it everytime you change platform.

My usual solution is to include definitions for new versions of the algorithm2e commands:

\providecommand{\SetAlgoLined}{\SetLine}
\providecommand{\DontPrintSemicolon}{\dontprintsemicolon}

Thus, when using old version of the package (Linux) new versions of the commands are defined. If the new version of the package is used and these commands are already defined (Windows), \providecommand directives are simply ignored by MiKTeX.

You can write these commands into a seperate file and include it whenever your document will use algorithm2e and will constantly be compiled at multiple platforms.

Do not forget these commands should be inserted/included after the \usepackage[...]{algorithm2e} stuff.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .