Tag Info

New answers tagged


TL;DR version: algorithm - float wrapper for algorithms. algorithmic - first algorithm typesetting environment. algorithmicx - second algorithm typesetting environment. [Use this one!] algpseudocode - layout for algorithmicx. algorithm2e - third algorithm typesetting environment. Detailed version algorithm Float wrapper for algorithms. It is similar to ...


Instead of the \DontPrintSemicolon trick you should use \BlankLine. \documentclass{article} \usepackage[linesnumbered]{algorithm2e}% http://ctan.org/pkg/algorithm2e \DontPrintSemicolon \begin{document} \begin{algorithm} $i = 1 + j$\; \BlankLine $j = 1 + i$ \end{algorithm} \end{document}


The right counter is algocf and not algorithm. Also you have to use \resetcounteronoverlays instead of \resetcountonoverlays since algocf is defined as \newcounter{algocf} In other words, adding the following line in your preamble \resetcounteronoverlays{algocf} solves the issue. MWE: \documentclass{beamer} ...


Define a \Struct that matches one of the existing structures within the algorithm2e framework. In this case, it resembles a repeat ... until, so I'd use \SetKwRepeat{Struct}{struct \{}{\}}: \documentclass{article} \usepackage[noline]{algorithm2e} \SetKwRepeat{Struct}{struct \{}{\}}% \newcommand{\Float}{\KwSty{float}} \begin{document} ...

Top 50 recent answers are included