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

learn more… | top users | synonyms

2
votes
1answer
37 views

Increase Vertical Line Length in Algorithm Block

I would like to increase the line length of the vertical line between the start and the end of the block in the following example using the algorithm2e package: \documentclass{article} ...
2
votes
1answer
113 views

How can I colourfuly highlight some lines of an algorithm using algorithm2e?

I am trying to achieve something like this: This image is linked from this answer. This answer also provides a solution and seems simpler. Both answers deal with the algorithmicx package however. ...
2
votes
1answer
1k views

Float positioning [ht] not working for algorithm

I am using the package algorithm2e. I have a document with several algorithms. I use the float position option [ht], but all my algorithms are positioned at the end of the chapter; none at the ...
2
votes
1answer
863 views

Line of dots in the \listofalgorithms

I've been working with the ToC, LoF, LoT and more recently with the LoA (List of Algorithms) of my dissertation. I'm using the tocloft package so I can set their styles the way I want. My first ...
2
votes
1answer
757 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 ...
2
votes
2answers
966 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: ...
2
votes
1answer
54 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
260 views

Trouble submitting paper to arXiv - amsart issues?

I just attempted to submit a paper to the arXiv. Unfortunately, they would not accept a .pdf and insisted on the LaTeX source code. I uploaded the LaTeX source code along with three figures in .pdf ...
2
votes
1answer
100 views

Problem with references in classic thesis if algorithm2e package is used

If I use the algorithm2e package together with the linesnumbered option and the classicthesis package, references to a sub sub section are wrong. If I don't use the linesnumbered option, references ...
2
votes
1answer
253 views

Algorithm with chapter number

I want the algorithm to be prefix with chapter say in chapter 1, it should be 1.1, 1.2, for chapter 2, it should be 2.1, 2.2 But for my case, i only have 1,2,3,... across all chapters, how should I ...
2
votes
1answer
597 views

Undefined control sequence \SetKwProg [closed]

The minimal (not) working example is \documentclass{article} \usepackage[algo2e,ruled,vlined]{algorithm2e} \begin{document} \begin{algorithm2e}[h] \SetKwProg{myproc}{Procedure}{}{} ...
2
votes
1answer
344 views

Colors in Pseudocode matlab style

How do I get colours and more control over spacing in the algorithmic package like this: I tried this which looks good, but has numbers: \begin{enumerate} \item Create the cumulative sum of ...
2
votes
1answer
492 views

Restyling the caption in an algorithm created with algorithm2e

In the caption of an algorithm created with algorithm2e, \documentclass{article} \usepackage[ruled]{algorithm2e} \begin{document} \begin{algorithm}[H] \caption{Caption.} pseudocode ...
2
votes
1answer
525 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
193 views

verbatim environment inside algorithm2e

I need to output prolog style inside algorithm2e and It seems that I cannot use \verb inside algo2e. How can I use \verb or verbatim for only one line inside algorithm2e in Latex?
2
votes
1answer
764 views

How to break lines in conditions using algorithm2e?

I am trying to (partially) reproduce the algorithm displayed in Figure 4 from NetFlow: Information Loss or Win? My problem is with the multi-line conditions present in the "IFs". I want them to be ...
2
votes
1answer
119 views

How to change the order of algorithm number and name in algorithm2e?

I have to write an algorithm in Hungarian, where the caption must look like: 1.3. Algoritmus: caption of alg instead of the usual style Algorithm 1.3: caption of alg. Until now I had no ...
2
votes
1answer
623 views

Putting multiple algorithm2e procedures in figure

I want to put some algorithm2e procedures into a figure like: \begin{figure} \begin{procedure} some code \; \caption{abc (n).} \end{procedure} \begin{procedure} some code \; \caption{abc (n).} ...
2
votes
1answer
625 views

algorithm2e and enumerate

I would like to put one algorithm inside one enumerated list like in the following code. \documentclass[10pt,a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage{ucs} \usepackage{amsmath} ...
2
votes
1answer
143 views

How to put a reference into nlset command of algorithm2e package

I would like to provide an alternative version of only some part of already existing algorithm, using the algorithm2e package. My source looks like: \begin{algorithm}[t] \dots \; ...
2
votes
1answer
795 views

algorithm2e missing document mystery

I am trying to use the algorithm2e package. I downloaded the package from CTAN and verified that I can typeset its own documentation (algorithm2e.tex). I then try to write my own document that uses ...
2
votes
1answer
641 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). ...
2
votes
1answer
327 views

What environment to use in writing functions

I am beginner of LaTeX, and wondering how to write functions or procedures in pseudocode. Is there any existing environment for that?
2
votes
1answer
842 views

Turn off line numbering in algorithm2e

I have the following preamble for algorithm2e: \usepackage[ruled,vlined,linesnumbered,resetcount,algochapter]{algorithm2e} I have many algorithms, in on of the algorithm as follows: ...
2
votes
1answer
450 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
300 views

algorithm2e - Unwanted vertical space

Last days I met a strange behavior with algorithm2e which produces an unwanted space after an IF-block. I put here one MWE which shows that the problem really comes from my customization and not from ...
2
votes
1answer
1k views

Nested If and For in algorithm2e

I have the following code in algorithm2e with boxruled, vlined, and linesnumbered options. pdflatex gives me an empty line at the end of both the for loops inside the ifs. Can someone please suggest a ...
2
votes
2answers
1k views

Changing caption numbering for algorithm in algorithm2e

I am trying to define a new environment that uses the algorithm environment from algorithm2e. I want to use a separate caption counter for this new environment. As of now, this is what I have, but I ...
2
votes
0answers
32 views

How to complete the algorithm using algorithm2e

I wanted to write this flowchart using \usepackage[linesnumbered,ruled,vlined]{algorithm2e} However, I couldn't get what I want, please refer to my code in below \begin{algorithm} ...
2
votes
1answer
77 views

PDF reference links when using hyperref and (`ruled`) algorithm2e

I was testing some links within my produced PDF file and recognized that all of the links to an algorithm (from the algorithm2e package) will jump to the beginning of the algorithm with skipping half ...
2
votes
0answers
45 views

Nomencl and Algorithm2e Incompatibility [closed]

This code produces no errors and displays the nomenclature correctly. \documentclass{article} \usepackage{nomencl} \makenomenclature \begin{document} \nomenclature{$c$}{a constant} \printnomenclature ...
2
votes
0answers
77 views

Sigplanconf algorithm2e missing algorithm when figure

I am rewriting a paper, and stumble over this problem where algorithms are missing in my appendix. I was able to reproduce the problem. The following code only display 2 out of the 4 algorithms on ...
1
vote
1answer
8k views

Package algorithm2e on Ubuntu

I am having some trouble getting a LaTeX document to compile. I would like to use the package algorithm2e. I am working on a machine running Ubuntu. I tried using Texmaker and Gummi (LaTeX editors) ...
1
vote
1answer
26 views

break a line of function in algorithm2e

I tried various ways to break a line of function but did not succeed. As you can see from the image, I was trying to break the line at the position of a function parameter. Can anybody please take ...
1
vote
1answer
218 views

How to remove the extra blank line in algorithm2e

I want to add a right aligned comment in LaTeX after \For command, but it adds an undesired blank line. Please help me. CODE: \For(\tcp*[r]{Incremental calculation of edges}){$i \gets 1$ ...
1
vote
1answer
128 views

algorithm2e - Unwanted warnings when apply commands to content block

In this page, Andrew Swann points me a way to make verbose formatting of algorithms (I need this only for pedagogical reasons). The problem with this solution is that it produces unwanted warnings ...
1
vote
1answer
4k views

Change the algorithm enumeration in the algorithm2e package

I would like to translate the algorithm enumeration into another language, it is always printed in English: Algorithm 1 [Title] Algorithm 2 [Title] ... I am using the algorithm2e package.
1
vote
1answer
72 views

How to exclude some algorithms for \listofalgorithms

I tried with \captionsetup{list=no} but it doesn't work for the algorithm listing. Any ideas? I am splitting alg. over several pages using algorithm2e and don't want the captions of the split ...
1
vote
1answer
98 views

algorithm2e single-line control structures

I am using algorithm2e for formatting pseudo-code: is it possible to compress single-instructions control structure to one single line? For example I would like to modify this so that l.sort() ...
1
vote
1answer
89 views

How to define new loops in algorithmicx?

How can I define a new loop in algorithmicx? For example, code like this: ex1) PreLoop s do --statement1 --statement2 ex2) PostLoop s do --statement1 --statement2 Is it possible to define it ...
1
vote
1answer
273 views

Can not use float placement options with algorithm2e

I am using algorihtm2e and I am formatting a new command to align comments in the algorithms like in the answer of Align comments in algorithm with package algorithm2e. Now when I try to use ...
1
vote
1answer
386 views

Remove chapter number on algorithm numbers (scrbook)

I write my bachelor thesis using a document class provided by our institute based on scrbook. I write pseudo-codes using algorithm2e which I put in the appendix since otherwise they would "interrupt" ...
1
vote
1answer
758 views

BibTeX, Natbib, and Algorithm2e

I'm trying to prepare a journal submission, and I'm having trouble getting natbib to play nicely. When I include natbib in my document, it gives me the following error: ! Undefined control sequence ...
1
vote
0answers
25 views

Using algorithm2e with polyglossia produces undesired emphasized text

Here's a minimal working example: \documentclass[a4paper]{article} \usepackage{fontspec} \setmainfont{CMU Serif} \setsansfont{CMU Sans Serif} \setmonofont{CMU Typewriter Text} ...
1
vote
0answers
93 views

when is Implementation of example into LATEX2e?

When the write into texwork the following : \begin{algorithm}[H] \SetAlgoLined \KwData{this text} \KwResult{how to write algorithm with \LaTeX2e } initialization\; \While{not at end of this ...
1
vote
0answers
34 views

Huge algorithm taking up space [duplicate]

I have an algorithm description that takes up an entire image. However, when compiling my latex document, the algorithm and subsequent images following it are pushed to the end of the document. I ...
1
vote
0answers
17 views

Indentation lines in algorithm package [duplicate]

I am using the algpseudocode and the algorithm2e package, and want the lines down below the indents like below (the example on the algorithm here). Does anyone know how to achieve this easily?
1
vote
0answers
16 views

Reference links to algorithm but shows? [duplicate]

I am using algorithm2e when I reference an algorithm it shows ?? which links to the correct algorithm, but it should show something like 1.1. Any suggestions as to how I can fix this? Here is an ...
1
vote
0answers
22 views

How to use dotted line to make indentation clearer in algorithmicx? [duplicate]

I wish to indicate clearly when a block starts and ends with "enclosing lines" in addition to the indentation. I understand that I can do it with algorithm2e like so \begin{algorithm}[H] \SetLine % ...
1
vote
0answers
31 views

algorithm2e problem [duplicate]

Source code I'm working on a LaTeX project which brings 5 files: cassio.bib: bibliography comandos.tex: a rich set of commands for easiness of typing tg.tex: document's source code tg.pdf: ...