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

learn more… | top users | synonyms

4
votes
1answer
138 views

Algorithms in front of the text!

I am writing a document using the book class. At some point, I need to place an algorithm in the text. I am using the algorithm2e.sty package to write my algorithms. So, I write ...
2
votes
0answers
93 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
0answers
35 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: ...
4
votes
1answer
164 views

Alternative for SetKwInParam in algorithm2e

In recent versions of algorithm2e SetKwInParam no longer exists: REMOVE: - SetKwInParam has been deleted since not useful itself because of different macros which can do the same in a better and a ...
2
votes
1answer
912 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}{}{} ...
4
votes
2answers
1k views

How to avoid the number line for comments under algorithm2e

In the declaration of the input and output data, I would like to add a comment in order to explain the kind of data. I use: \usepackage[ruled,vlined]{algorithm2e} My code is: \begin{algorithm}[!ht] ...
0
votes
0answers
422 views

algorithm2e indentation / line break

I have the following problem: I am writing a couple of algorithms using algorithm2e. I have a bunch of longer if statements and longer if conditions. The lines are broken, but the new lines are not ...
1
vote
1answer
102 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 ...
3
votes
2answers
713 views

algorithm2e with boxruled gives overfull hbox

I am using the algorithm2e package with the boxruled option to format my pseudo-code. However, I am getting an overfull hbox, which I suspect is due to margin/box conflicts. Does anyone have a fix ...
4
votes
2answers
570 views

How to avoid printing the algorithm number in algorithm captions?

I am using the algorithm2e package to write algorithms. However, when i write three algorithms one after another, the algorithms are automatically numbered 1,2 and 3 in the caption. I am using ...
1
vote
0answers
148 views

Text Wrap with algorithm2e [closed]

I'm using algorithm2e for algorithms and for some of the longer algorithms, (eyeballed at > 50% of a page) there is no other text on the page with just an embarrassing amount of white space above and ...
4
votes
2answers
317 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
2answers
634 views

using standalone with algorithmicx or algorithm2e

I am trying to compile a standalone file containing pseudocode created with the algorithmicx package. According to algorithmicx crashes standalone it should work with the preview option set for ...
6
votes
2answers
815 views

Problem with algorithm2e and portuguese option

I have this little algorithm with two For statements and one if-else. I'm using the option portuguese on the preamble and here's the problem: instead of displaying the words "faça" and "fim" (do and ...
2
votes
1answer
460 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
828 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 ...
8
votes
1answer
4k views

What is the best looking pseudo code package?

I have stumbled across various pseudo code packages but can't seem to find that's simple and eye-candy and practical. What I'm looking for: Visually attractive structure (eye-candy) ( easy to look ...
5
votes
1answer
221 views

Algorithm2e - Permanent fix for no italics if-clause

I am using algorithm2e to create pseudocode for my document. However, it has it so that the conditions in if clauses are italicised. This solution suggests putting an \upshape in each if condition. ...
3
votes
1answer
311 views

Implementing indent in algorithm environment

I am using the algorithm environment in the algorithm2e package. What I want is to able to indent various portions. I tried \indent but that is doing me no good. Here is the MWE: ...
4
votes
1answer
341 views

algorithm2e: Exclude functions from \listofalgorithms

I'm using the package algorithm2e and create a list of algorithms with \listofalgorithms. My problem is that not only the algorithms (algorithm), but also the functions (function) are displayed in the ...
2
votes
1answer
728 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} ...
4
votes
2answers
3k views

Changing label name for algorithm

I have this algorithm: \begin{algorithm} \captionsetup[algorithm]{name=MegaAlgorithm} \DontPrintSemicolon \KwData{$G=(X,U)$ such that $G^{tc}$ is an order.} \KwResult{$G’=(X,V)$ with $V\subseteq U$ ...
5
votes
1answer
896 views

algorithm2e and \algomargin with negative value

How can I use a negative length in \algomargin using algorithm2e? I get the unpleasant effect that the vertical lines and the caption are not moved accordingly, see for example: Note that this ...
9
votes
3answers
515 views

algorithm2e + cleveref: problem with wrong reference to line numbers

For some reason I do not understand, cleverefproduces wrong references to line numbers of listings produces with the algorithm2e package. I hope that I did not miss a simple solution ... My example ...
2
votes
1answer
612 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 ...
3
votes
1answer
5k views

Subroutine in algorithm2e

I am looking for a tiny example of writing in algorithm2e an algorithm using a subroutine. The algorithm is called algo, and it recursively calls a subroutine called proc. It should be something like ...
3
votes
1answer
263 views

verbatim environment inside algorithm2e

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

algorithm2e and Beamer - How to make algorithms wider with smaller font?

I would like to make the algorithm2e environments wider in a beamer document. Indeed I must you a \scalebox to see all of my algorithm. Is there a way to have wider algorithms with smaller size font ...
2
votes
1answer
1k 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 ...
4
votes
1answer
1k views

Algorithm2e modify line numbers

I'm using the LaTeX algorithm2e package by defining \usepackage[ruled, linesnumbered, vlined]{algorithm2e} The linesnumbered argument adds lines numbers from [1,...,n] if we have an algorithm with ...
8
votes
2answers
646 views

algorithm2e noend option produces wrong label

I have a problem with the algorithm2e package. I want to reference the end of a block, e.g., a for-loop, in my text. Therefore, I place a label behind the closing bracket of the for statement. When I ...
3
votes
1answer
392 views

How to remove newline character after case statement in algorithm2e?

I don't want any newline character after case statement. How can I do that? This is my code: \begin{algorithm}[t] \SetInd{0.5em}{0.5em} \KwIn{Data $\mathsf{D}$} \KwOut{List of Simple Hints} ...
0
votes
0answers
42 views

writing part of a pseudocode [duplicate]

I have a few pseudocode lines like for each item in list L if (item > 50)| (item > 50)|(item > 50) value=item break; Obviously, this is not the exact code :). If I use a package ...
2
votes
1answer
146 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 ...
1
vote
1answer
284 views

List of Algorithms header format [closed]

Does anyone know why the header of List of Algorithms is not equal to the format of List of Tables when both using with \listoftables or \listofalgorithms Here is a screenshot:
6
votes
1answer
5k views

How to adjust line numbers of algorithm2e package?

When using line numbers in the algorithm2e package, the line numbers are placed left of the text block, not directly below the text. See page 5 of the algorithm2e manual. Is it possible to place them ...
2
votes
1answer
198 views

Reduce the size of horizontal line

I want to reduce the size of horizontal line. \begin{frame} \restylealgo{boxed} \begin{algorithm}[H] \Setline \nl i\; \end{algorithm} \end{frame}
4
votes
1answer
355 views

'List of Algorithms' title is not all in caps

In my dissertation, I have added a page for list of algorithms, using \listofalgorithms command. However, the title of the page is not in all caps ('List Of Algorithms'), while it's supposed to be in ...
3
votes
1answer
2k 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 ...
1
vote
1answer
347 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 ...
3
votes
0answers
439 views

algorithm2e-like vertical lines for loops in listings package [closed]

Is there any way to set vertical lines for loops in pseudo-algorithms written with listings package, in an algorithm2e style? As an example, see here: http://csweb.ucc.ie/~dongen/LAF/Algorithms.pdf ...
5
votes
0answers
55 views

Review of algorithm-related packages? [duplicate]

Possible Duplicate: Print programs with its proper syntax Where can I find (if it exists) an updated review of the most relevant packages for handling with algorithms (pseudocode or code ...
3
votes
1answer
4k 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} ...
1
vote
1answer
431 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" ...
3
votes
2answers
197 views

Referencing a line starting with a keyword in algorithm2e

I want to describe parts of an algorithm, by linking to specific lines. I found that the package algorithm2e is great for typesetting algorithms, and it seems it is also able to handle labels. ...
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] ...
2
votes
1answer
349 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
789 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).} ...
1
vote
1answer
162 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 ...
3
votes
1answer
4k 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 ...