Algorithm2e style package
Algorithm2e Overview PDF Imprimer

new a new release candidate is in beta test. You can try it, if you want. For the documentation, see comments inside package.

 

Algorithm is an environment for writing algorithms. An algorithm is defined as a floating object like figures. It provides macros that allow you to create different sorts of key words, thus a set of predefined key word is given. You can also change the type style of the keywords.

  • Here is an exemple:

  • exemple of an algo


Mailing List: You can subscribe to algorithm2e-announce mailing list to receive announcements about revisions of the package and to algorithm2e-discussion to discuss, send comments, ask questions about the package.
In order to subscribe to the mailing lists you have to send an email to the list manager (see in the documentation the email adresses and how to subscribe).

Mise à jour le Dimanche, 14 Novembre 2010 10:56
 
Release 4.01 PDF Imprimer Envoyer

Release 4.01 (12/14/2009) is a major release which adds a new features, improve compatibility with other classes and packages, and corrects all bugs (I hope). See  documentation for more information.

Beware! Names of commands have changed to have consistent naming ! If you have old tex files, please use oldcommands option to get back working old named macros.

Please read release notes to learn whats new in this release, and read the documentation to learn how to use all these features.

Summary of changes (see more complete documentation in release notes in algorithm2e.sty)

  • Some commands have been renamed to have consistent naming: option oldcommands enables old naming
  • Compatibily with other packages improven by changing name of internal macros
  • Option endfloat: This option enables a new environment algoendfloat to be used instead of algorithm; algoendfloat environment put algorithm at the end.
  • Option rightnl: put lines numbers to the right of the algorithm instead of left.
  • Add: new kind of keywords : KwArray used to define arrays.
  • Add: new macro : \SetKwHangingKw used to define keyword that hangs the text if set on multiple line (so acting as \KwInput)
  • Fix: rules of ruled, algoruled, tworuled styles used rules of different sizes! This is now fixed.
  • Add: size of the rules is now controlled by a length and so can be customized by the user (see lengths algoheightrule and algoheightruledefault and algotitleheightrule and algotitleheightruledefault)
  • Add: \SetAlgoCaptionSeparator which sets the separator between Algorithm 1 and the title.
  • Add: \SetAlgoLongEnd and \SetAlgoShortEnd and \SetAlgoNoEnd commands which act as corresponding package options
  • Option italiano and slovak as new languages
  • Change: Fnt and Sty macro to have consistent use and naming (see below)
  • Add: \AlCapSty, \AlCapNameSty, \AlCapFnt, \AlCapNameFnt, \ProcSty, \ProcFnt, \ProcNameSty, \ProcNameFnt, \ProcArgSty, ProcArgFnt and corresponding "set macro" \SetAlCapSty, \SetAlCapNameSty, \SetAlCapFnt, \SetAlCapNameFnt, \SetProcSty, \SetProcFnt, \SetProcNameSty, \SetProcNameFnt, \SetProcArgSty, \SetProcArgFnt which control the way caption is printed. Sty macro use command taking one parameter as argument, Fnt macros use directly command. All can be redefine (see release for explanation on their difference, how to use them and how to redefine them)
  • Change: \AlTitleFnt to match definition of all other Fnt macros and add a \AlTitleSty macro (see below)
  • Add: \AlTitleSty and \SetAlTitleSty commands to set a style for title.
  • Add: new command \SetAlgorithmName{algorithmname}{list of algorithms name} which redefines name of the algorithms and the sentence list of algorithms.
  • Add: new \SetAlgoRefName{QXY} which change the default ref (number of the algorithm) by the name given in parameter (QXY in the example).
  • Add: new command \SetAlgoRefRelativeSize{-2} which sets the output size of refs, defined by \SetAlgoRefName, used in list of algorithms.
  • Add: two dimensions to control the layout of caption in ruled, algoruled and boxruled algorithms: interspacetitleruled and interspaceboxruled
  • Add:  new feature has been added: the name of the procedure or function set in caption is automatically defined as a KwFunction and so can be used as a macro (beware that macro is only define after the caption)
  • Option nokwfunc to disable the new feature described above in function and procedure environment.
  • Add: \SetAlgoNlRelativeSize{number} command which sets the relative size of line numbers.
  • Add: \SetAlgoProcName{aname}{aref} command which sets the name of Procedure printed by procedure environment (the environment prints Procedure by default). Second argument is the name that \autoref, from hyperref package, will use.
  • Add: \SetAlgoFuncName{aname}{aref} command which sets the name of Function printed by procedure environment (the environment prints Function by default). Second argument is the name that \autoref, from hyperref package, will use.
  • Add: \SetAlgoCaptionLayout{style} command which sets style of the caption; style must be the name of a macro taking one argument (the text of the caption).
  • Option procnumbered: which makes the procedure and function to be numbered as algorithm
  • Option tworuled and boxruled these are two new layouts: tworuled acts like ruled but doesn't put a line after caption ; boxruled surround algorithm by a box, puts caption above and add a line after caption.
  • Remove  SetKwInParam has been deleted since not useful itself because of different macros which can do the same in a better and a more consistent way as SetKwFunction or SetKw.
  • Fix:  line number is now correctly vertically aligned with math display.
  • Fix:  references with hyperref. No more same identifier or missing name error. BUT now packages if you do PdfLaTeX    you must NOT use naturalnames option of hyperref package.
  • Fix:  autoref with hyperref package.
  • Fix:  titlenumbered was not working! fixed.
  • Fix:  Else(){} acted like uElse. Corrected.
  • Fix:  noend management: when a block was inside another and end of block was following each other, a blank line was added: it's now corrected.
  • Fix:  Function and Procedure environment was no more working as defined originally: the label was no more name of the procedure, it acts always as if procumbered option has been used.
  • Fix:  line numbers had a fixed size which can be bigger than algorithm text accordingly to \AlFnt set (see also new command \SetAlgoNlRelativeSize above)
  • Fix:  semicolon in comments when dontprintsemicolon is used.
  • Fix:  listofalgorithms adds a vertical space before first algo of a chapter as for listoffigures or listoftables
  • Fix:  listofalgorithms with twocolumns mode and some classes which don't allow onecolumn and so don't define \if@restonecol as prescribed in LaTeX (sig-alternate for example)
  • Fix:  algorithm2e now works with elsart cls and some more classes.
  • Fix:  blocks defined by SetKwBlock act now as other blocks (if for instance) and don't write end in vlined mode, instead they print a small horizontal line as required by the option.
  • Fix:  underfull hbox warning at each end of algorithm environment removed.

 

Mise à jour le Mardi, 15 Décembre 2009 10:20
 
Release 3.9 PDF Imprimer Envoyer

Release 3.9 (10/04/2005) corrects references bug with hyperref packages, fix compatibility with caption package, improve compatibility with beamer and add:

  • side comments which allows to put comments to the right of the text and on the same line.
  • possibility to add side comment on the same line of a block command like if-then-else by using () before the {} block.
  • add SetAlgoInsideSkip to put extra vertical space inside the environment around the core of the algorithm.
  • dotocloa option which adds an entry in the toc for the list of algorithms.
 
Documentation PDF Imprimer
 
Release 3.6 PDF Imprimer Envoyer

Release 3.6 corrects bugs of vertical spacing with some macros, improve compatibility with some classes (IEEEtran, Beamer and Hermes) and add 3 new features:

  • hidden numbering: lines can be auto-numbering but showing numbers only on lines you specify.
  • managing of caption font: now caption can have a different font from the algorithm
  • managing distance between caption and algorithm in boxed and plain mode.
 
Old releases PDF Imprimer