{algorithm2e} is a package providing a floating algorithm environment with algorithmic keywords.

learn more… | top users | synonyms

15
votes
1answer
2k views

Background coloring with overlay specification in algorithm2e + beamer package

I want to highlight some portion of my pseudo codes in my slides during the course of presentation. It's easy in powerpoint and I've made a sample slide: However, I couldn't manage to get a similar ...
13
votes
1answer
2k views

Is it possible to have connecting loop lines (like algorithm2e) in algorithmic?

I am using the algorithmic package to typeset an algorithm. I would like to have connecting lines between the beginning and end of a loop or conditional like in the algorithm2e package. Is there an ...
5
votes
2answers
2k views

“\Ualgocf@original@chapter” undefined when using algorithm2e with natbib

Is it possible to just use plainnat without using the package natbib? When I do so, multiple author references don't work too well. I get [author et al (year)auhtor1, author2 and author3] when ...
7
votes
2answers
886 views

Amsart with algorithm2e introduces extraneous text into pdf file with Texlive 2011

I just removed the default Ubuntu TexLive 2009 installation and installed TexLive 2011 using install-tl. However, now I am facing problems with the amsart and algorithm2e packages. Specifically, when ...
8
votes
2answers
3k views

Linebreak in Package algorithm2e

I'm using the algorithm2e package for pseudocode. I got some very long lines that needed to be wrapped. Is there a way to indent the following (breaked) lines and/or put a mark at the first line to ...
11
votes
2answers
2k views

How can I put a curly brace inside an algorithm to group code lines?

I am using the algorithmic package (or even algorithm2e is fine). Is it possible to use curly braces to group some lines in the algorithm so as to be able to put an explanation to the right?
7
votes
2answers
3k views

Place four algorithms (algorithm2e) in a subfigure and arrange them in two rows and two columns

I want to arrange four algorithms set with the algorithm2e package in two rows and two columns, as shown in the figure below. I've tried the subfigure package and have also read several related ...
2
votes
2answers
995 views

Is it possible to change the way a list of algorithms is generated to include the word “Algorithm” before each element in the list?

I've tried using both algorithm2e and algorithmic to generate a list of algorithms, but they both do it this way: List of Algorithms 1 BFS ..... 1 2 DFS ..... 2 ... When I'd like to it to be: ...
6
votes
1answer
3k views

Renaming Algorithm to Heuristic in algorithm2e package

I am trying to write some heuristics for a problem using the algorithm2e package. However as you may know, when you write : \begin{algorithm} \caption{Heuristic 1: Name of Heuristic} ... ...
3
votes
1answer
3k views

algorithm2e - Apply commands to content block of IF … THEN … ELSE

In the following picture, I use a verbose but very pedagogical style for algorithms. I would like to automatically use macros that act on the content of block like in the first example but with ...
5
votes
2answers
3k views

How to typeset gotos and labels using LaTeX pseudocode environments?

Is there any way to typeset gotos and labels using LaTeX pseudocode environments (algorithmic, pseudocode, clrscode, algorithm2e, etc.)? Automatic and correct indentation of labels would also be ...
6
votes
2answers
3k views

multiple algorithm2e algorithms in two column documents

I tried this example Place four algorithms (algorithm2e) in a subfigure and arrange them in two rows and two columns on two column documents. It doesn't work. The error message is ! LaTeX Error: [H] ...
5
votes
1answer
635 views

Caption spacing using algorithm2e

I am trying to add some spacing above/below captions of algorithms using the algorithm2e package. Consider the following example: \documentclass[a4paper]{article} \usepackage{blindtext} ...
5
votes
1answer
1k views

How to customize the number in the caption of an algorithm in algorithm2e

In algorithm2e, if you use the "ruled" option, the caption of algorithms are automatically numbered. E.g. if you write 2 algorithms in one document, the first one will be titled Algorithm 1 and the ...
4
votes
2answers
288 views

How to use Nameref with Algorithm2e

As the title suggests, I'm trying to reference to an algorithm created by algorithm2e package. Here is a MWE: \documentclass[12pt,a4paper]{report} \usepackage[linesnumbered]{algorithm2e} ...
4
votes
1answer
2k views

labeling lines of algorithms inside figure environment

I am having trouble labeling lines of algorithms that are inside the figure environment. For example, in the following code the label "\lnl{loop}" gives compilation error. This works perfectly in ...
3
votes
1answer
296 views

Algorithm2e - Disabling line numbers for specific lines

The Algorithm2e package has specific options for disabling/hiding line numbering for the whole document or algorithm, and then enabling/showing them for specific lines. I want to do the inverse. I ...
3
votes
2answers
3k views

Squeezing space around algorithm construct

I am using algorithm2e for developing algorithm constructs in my LaTeX document. However, if I want to use [!t] or [!b] to place the algorithm construct in an appropriate place, sometimes the ...
2
votes
1answer
3k views

algorithm2e split over several pages

Is there an option in algorithm2e to split the algorithm over several pages? Please no answer with "use algorithmic or listings packages". algorithm2e is the best package for algorithms in latex, so I ...
2
votes
1answer
783 views

Export algorithm as pdf

I use algorithm2e package for my algorithms and want to export my algorithm as pdf and could not find a way to do it. Is there any way to do this? The reason is that I use a style file provided to me ...
4
votes
1answer
197 views

Splitting an algorithm across two columns

Consider the following short example, where a two column page is selected, and the algorithm is split across the two columns using a manual \pagebreak within the algorithm's code: ...
4
votes
1answer
159 views

Remove the rule below the algorithm title - using Algorithm2e

I'm using algorithm2e package. One of my algorithm does NOT need a title. If I simply do not type in \caption, there are still three rules.! I want to remove the second rule. Is there any way to do ...
4
votes
1answer
701 views

algorithm2e-Drawing vertical dashed rules

In the following code, I would like to produce dashes lines instead of normal ones. The three HERE indicate where the code draws the lines. \documentclass{article} \usepackage[utf8]{inputenc} ...
4
votes
2answers
1k views

ending statements in algorithm2e environment

I am using the package algorithm2e. Is there a way to end with period instead of semicolon, or end with simply newline? I don't like the semicolons on the sentences. If I just try putting a period it ...
3
votes
1answer
3k views

Align comments in algorithm with package algorithm2e

I am using the package algorithm2e. When using comments like this \documentclass[11pt,a4paper,twoside,openright]{book} \usepackage[algochapter,linesnumbered,ruled,lined,boxed]{algorithm2e} ...
3
votes
1answer
295 views

Strange interaction between natbib and algorithm2e

Here's a minimal example. \documentclass{article} \usepackage{titlesec} \usepackage{algorithm2e} \usepackage{natbib} \begin{document} \bibliographystyle{plainnat} \begin{thebibliography}{1} ...
2
votes
1answer
68 views

Equivalent to hypcap for [ruled]{algorithm2e}?

I just discovered the hypcap packages which improves the \ref link to point before the figures and tables instead of to captions. How can I do the same with my algorithms written with algorithm2e ...
2
votes
1answer
624 views

Disable line numbering of specific lines

Is there way how to turn off numbering of lines for specific line in algorithm2e? I need bold : after keyword. So I tried redefine these macros: \renewcommand{\KwIn}[1]{\textbf{Input:} #1} ...
2
votes
1answer
525 views

No italics in algorithm2e if-clause

Why does algorithm2e typeset the variables anychange and done in italics, and how can I turn this off? How can I remove the semicolon after done in the until-clause? $\textsf{anychange} \gets ...
2
votes
1answer
705 views

Can't use underscore in algorithm2e caption?

I have a LaTeX document using the algorithm2e package. It used to work before I upgraded to texlive (it's the Debian version 2012.20120516-1 -- some snapshot from 2012, if I understand correctly). ...
0
votes
0answers
152 views

Big algorithm causing big mess

I am writing a document in which I needed to include the description of the Number Field Sieve (NFS) algorithm as mentioned in the book by Crandall and Pomerance. The algorithm's pseudo code is ...