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

learn more… | top users | synonyms

1
vote
0answers
31 views

make latex to automatically choose the placement of algorithms

I have several algorithms written down in a single file and would like latex to spread them across the document to save spaces. For example an algorithm can be just 3 or 4 lines and another can be 20 ...
4
votes
1answer
35 views

Adding a blank line in algorithm2e

Is there any way to add a blank line in algorithm2e? I have the following document: \documentclass{article} \usepackage[linesnumbered]{algorithm2e}% http://ctan.org/pkg/algorithm2e \begin{document} ...
5
votes
2answers
44 views

Use algorithm2e inside tcolorbox

I use the algorithm2e package to typeset algorithms. Now I would like to put a tcolorbox around an algorithm. My first approach looked like this: \begin{tcolorbox} \begin{algorithm} $a ...
2
votes
1answer
28 views

Algorithm2e caption separator with language package options

Please see the difference in the style of the caption separator. In the first example the : is typed directly after the word Algorithm 1. In the second MWE with language option german (also french or ...
3
votes
3answers
154 views

Help me compile this code

\documentclass{article} \usepackage{amsmath} \usepackage{algorithm2e} \begin{document} \begin{algorithm} \caption{CAS}\label{CAS} {$\sum^{N_{C}}_{i=1}$$L_C$} $\gets$ position of ...
1
vote
0answers
26 views

algorithm2e with RevTex

Note: I have seen the previous answer to this problem here and it doesn't work for my purposes. I suspect that others are in the same boat. I'm writing a paper for which the publisher requires the ...
4
votes
1answer
43 views

Adjusting the caption of an algorithm2e code

I'd like to typeset the caption of an algorithm environment such that it is bold, fills the available width of the paper, and neither the caption nor the line numbers encroach into the margins. In ...
2
votes
2answers
48 views

Align the word input of algorithm2e with a tabularx table

I'm referring to this post. I like the idea from 'a different ben' of the tabularx table inside the \Input command. But I would like to have the word Input: at the top, on the same line as the first ...
1
vote
1answer
48 views

Problem with caption, hyperref and algorithm2e

I'm trying to mix the caption, hyperref, and algorithm2e packages, but I am having some issues. Here is a MWE. \documentclass[12pt]{book} \usepackage{float} ...
1
vote
1answer
33 views

How to avoid the bold version of the caption of the algorithm

I am using algorithm2e package, but I want to remove Algorithm 1 in the figure and just say the name in my case as just appear only "The procedure". How we can do that? \begin{algorithm} ...
3
votes
1answer
31 views

Errors using Algorithm

When I run the following code, the pdf is getting generated but I get errors. \documentclass[12pt,a4paper,oneside,oldfontcommands]{memoir} \usepackage{algorithm2e} \usepackage{algorithmicx} ...
1
vote
1answer
24 views

Caption of algorithm2e to the upper left corner without ruled option

I don't want to use ruled option, but still, I want the caption of my algorithm to be at the upper left corner. I tried \renewcommand{\@algocf@capt@plain}{above} but it only moves the caption ...
3
votes
2answers
54 views

Line numbers are outside the box in algorithm2e

Here is my code: \documentclass[11pt]{llncs} \usepackage[utf8]{inputenc} \usepackage{parskip} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{dsfont} \usepackage{float} \usepackage{multicol} ...
2
votes
1answer
44 views

Remove “end” in algorithm2e

When I write \If{condition} { \textbf{return true}\; } The output is like below However, I don't want end line. If possible, I want like this: if condition then return true; Is ...
3
votes
1answer
26 views

Algorithms disappear when I use multicols

This is my code: \documentclass[11pt]{llncs} \usepackage[utf8]{inputenc} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{dsfont} \usepackage{multicol} \usepackage{fixltx2e} ...
2
votes
1answer
80 views

\begin{algorithm} unrecognized

I have used these two packages for creating algorithm \usepackage{algorithm2e} \usepackage{algorithmicx} But \begin{algorithm} shows as unrecognized command. Even \For, \While are shown as ...
1
vote
0answers
50 views

How to convert latex algorithm2e into msword format [closed]

I need to write below latex algorithm using windows words, How I can do that? \documentclass{article} \usepackage[linesnumbered,ruled,vlined]{algorithm2e}% http://ctan.org/pkg/algorithm2e ...
3
votes
0answers
78 views

Object-oriented class typesetting? [closed]

I am looking for a way to beautifully typeset an OO class like : classname { properties: prop1 : integer prop2 : Node methods: someMethod() } With the look ...
3
votes
1answer
47 views

Formatting keywords, data in algorithm2e

I am just wondering if there is a way to reference the keyword data outside the algorithm in algorithm2e package. For example, given the example in algorithm2e, if I want to reference \KwData{this ...
2
votes
1answer
65 views

Parameter section similar to Input and Output

I would like to create a "Parameter: ..." section, similar to the "Input: ..." and "Output: ..." sections in my algorithm description. The parameters are global, user-defined constants, known before ...
28
votes
2answers
707 views

What is Algorithm2e's problem with the letter Q?

No, seriously. The following LaTeX document is typeset with no issues: \documentclass{article} \usepackage{algorithm2e} \begin{document} \begin{minipage}{\textwidth} \begin{algorithm}[H] ...
2
votes
1answer
58 views

boxruled formatted algorithm text overflowing

I have a algorithm which is really a sequence of long statements and I'd like it to be inside a box but the following gets the word wrapping wrong. Anyone knows why? ...
9
votes
2answers
101 views

Incorrect reference to the equation number in algorithm2e

I want equation number in an algorithm with chapter number included. Here is my code. \documentclass{book} \usepackage{amsmath,amssymb,amsthm, latexsym,float,epsfig,subfig} ...
4
votes
1answer
58 views

algorithm2e and color

I am trying to color the background of the caption in algorithm (using algorithm2e). I have modified the original command as follow directly in the .sty file. However, as you can see on the image, ...
4
votes
1answer
43 views

Is algorithm2e available in Spanish?

I'm trying this code copied from another post in TEX.SX with the Spanish option, but some words appear in English, e.g. WHILE, FOR,... IF,... Is it possible to change these to Spanish? ...
3
votes
2answers
48 views

= in algorithm when using hebrew and algorithm2e

For some reason an = sign appears at the beginning of every line in an algorithm block when using hebrew and algorithm2e. Removing hebrew removes the line. For example: \documentclass{article} ...
1
vote
1answer
71 views

Using Algorithm2e package in Beamer

My MWE is \documentclass[pdf]{beamer} \usepackage[lined]{algorithm2e} \begin{document} \begin{frame} \begin{algorithm} \DontPrintSemicolon \KwIn{Labels: set of all labels} \KwIn{F: combinatorial ...
6
votes
1answer
106 views

Algorithm2e and hanging captions

I'm having issues trying to make the captions in Algorithn2e hang, as in the table caption pictured below. I plan on using them together with arsclassica/classicthesis, but it seems neither of these ...
0
votes
0answers
36 views

What´s the easy way to put algorithms? [duplicate]

I was trying with algorithm2e , and I had a little problems, LATEX is so complicated and so tedious. The results are excelent, but... the time and effort is BIG BIG! What´s the easy way to describe ...
2
votes
0answers
52 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} ...
1
vote
0answers
51 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} ...
0
votes
0answers
31 views

Removing the box around an algorithm

I am using the Algorithm2e package for some algorithm in my reports: link However, there is a "frame" around the algorithm that I would like to remove. I don't find in documentation a way to remove ...
1
vote
1answer
48 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 ...
5
votes
1answer
102 views

How to reduce indentation size within loop of an algorithm

For the following algorithm, I get four spaces for each text line inside the loop. How can I get only two or three spaces? Some of my text lines go to next line. I want to save some horizontal spaces. ...
1
vote
0answers
116 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 ...
3
votes
1answer
414 views

algorithm2e comment style

I wanted to know how to change the comment style in the algorithm2e package. I want to make my comments of a smaller font and a different color: \documentclass{article} \usepackage{color} ...
2
votes
1answer
49 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} ...
6
votes
2answers
163 views

Add text right below the algorithms

I try to add some texts used to illustrate the algorithms right below the bottom line of algorithms. \documentclass{article} \usepackage[ruled]{algorithm2e} \usepackage{amssymb} \usepackage{amsmath} ...
6
votes
1answer
566 views

Algorithm: write if-then-return or else-return in one line?

I can easily generate the following algorithm statements using algorithm2e package. As can be seen from the image, return statement (should hold for other statements too) will be placed in a new line ...
3
votes
1answer
169 views

How to control the caption of algorithm2e by captionsetup?

I want to change the appearance of the caption for algorithms written by algorithm2e package using the caption package. In captionsetup one can easily customize the caption depending on the float ...
4
votes
1answer
215 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: ...
3
votes
1answer
328 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 ...
1
vote
0answers
18 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?
4
votes
1answer
167 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 ...
1
vote
0answers
73 views

How to manually set a line number for end statement in algorithm2e?

I can manually set line numbers in an algorithm2e environment using the \nlset command (together with \LinesNotNumbered). However, I can't figure out how to make the same for lines with the end or ...
4
votes
1answer
57 views

How to make a hbox several lines under the specified place?

Recently I asked How to colourfuly highlight some lines of an algorithm using algorithm2e? I wanted to acheive this effect using the algorithm2e package: Thanks to JLDiaz's answer I know how to do ...
4
votes
1answer
67 views

Weird behaviour of \FuncSty in algorithm2e

I'm using the small capital font \textsc{MyAlgorithm} several times inside my algorithm2e environment as follows: \documentclass[a4paper, english]{article} \usepackage{amsmath} \usepackage{amssymb} ...
2
votes
1answer
225 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. ...
1
vote
0answers
17 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 ...