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

learn more… | top users | synonyms

2
votes
2answers
23 views

new caption type in captionof

\captionof command from caption package allows caption for various floats. However we cannot use it to typeset an algorithm caption like: \captionof{Algorithm}{<Caption text>}. I tried the ...
2
votes
1answer
18 views

Why does't the \SetAlFnt work in the algorithm2e?

I want to use the \SetAlFn to change the font size of the algorithm, but it doesn't seem work at all. Here is my code. \documentclass{article} \usepackage{amssymb} \usepackage{graphicx} ...
1
vote
1answer
14 views

How to put two algorithm2e (one is large and one is small) side by side by using minipage or subfigure?

I have two algorithms wrote by the algorithm2e package. One of them is large and the other is small. My try is here: %\documentclass[runningheads,a4paper]{llncs} \documentclass{article} ...
6
votes
1answer
26 views

Algorithm2e: What is the recommended method to change the caption of ONE algorithm?

I want to read the caption of one of my algorithms typeset by algorithm2e to read Listing instead of the default algorithm. What is the recommended/best way to achieve this? I actually have a ...
1
vote
0answers
17 views

Underline entire line in algorithm2e

is there a way to underline entire line of code in algorithm2e? Including keywords like for each etc.
2
votes
0answers
17 views

Underline line numbers in algorithm2e

is there a way to underline specific line number? For example I have lines 1,2,3 and 4, and I want number 2 to be underlined. Thanks alot
2
votes
1answer
22 views

What are these algorithm2e empty warnings?

I am using the algorithm2e package in my paper and for some reason TexStudio is reporting these 2 warnings from algorithm2e.sty which don't have any message or line number. When I enable the Issues ...
1
vote
0answers
20 views

Latin characters in algorithm2e package

I am trying to write algorithms using the algorithm2e package and I am experiencing some problems with latin characters like ěéáž and so on. Is there a way to write these? Typesetting always ends with ...
2
votes
1answer
48 views

Table of contents of algorithm and algorithm2e together

The contents of the algorithms thinks that an algorithm that uses algorithm is one algorithm and an algorithm that uses algorithm2e is another algorithm, not the second of what was imported with the ...
2
votes
2answers
59 views

Multiline statements and conditions in algorithm environment

I have an algorithm that I want to write in mathematical pseudo-code. However, some conditions and statements are very long, e.g. "if (a series of relations and constraints hold) do" or "X gets (a ...
2
votes
1answer
29 views

Remove vertical space after new chapters in listofalgorithms

When generating list of algorithms, the command \listofalgorithms automatically inserts a 10pt vspace after the last algorithm caption in a chapter. I need to remove this vertical space in such a way ...
0
votes
1answer
19 views

Error in Until section

I'm newbie for tex. I am writing an algorithm in tex, I need some help in troubleshooting the error. \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{algpseudocode} ...
4
votes
1answer
70 views

End word is hidden in algorithm block

Suppose that i have this code: \usepackage[ruled,vlined]{algorithm2e} \begin{dcocument} \begin{algorithm}[H] \KwData{this text} \KwResult{how to write algorithm with \LaTeX2e } initialization\; ...
2
votes
1answer
72 views

How to change the caption of Algorithm

{\tiny \restylealgo{boxed} \begin{algorithm} %\centering{ \SetLine \KwIn{$A$. } \caption{} %} \label{algo2} \end{algorithm} } In the caption it is coming as "Algorithm 2:" Is it possible just ...
0
votes
0answers
48 views

Reference title does not show properly

My latex file works fine until I inserted an algorithm to the document. Then the tile of the bibliography did not show up properly. \documentclass[ijoc,nonblindrev]{informs3} ...
6
votes
1answer
213 views

{Begin End} does not show when writing algorithm in LaTeX

I am writing an algorithm in LaTeX using \usepackage[ruled,vlined]{algorithm2e} When running the code, the produced file does not show the word "end" that should appear automatically when using ...
13
votes
1answer
514 views

algorithm, algorithmic, algorithmicx, algorithm2e, algpseudocode = confused

I am getting confused about the package structure for writing simple "algorithms". There are too many options, and also got totally clueless about when to use what. Is there any definitive guidelines ...
5
votes
1answer
101 views

Making algorithm2e environments “overlay aware” in beamer

What is the right away to make algorithms overlay aware in beamer? When using algorithm2e in a beamer presentation, an algorithm on a frame with overlays can get more than one number. For example, ...
4
votes
1answer
95 views

How to typeset data structures with algorithm2e?

The question How to typeset data structures? gives create answers for how to type set simple data structures with the lstlistings package. In particular, I like the following look (taken from Mico's ...
0
votes
0answers
59 views

How to fix undefined control sequence in algorithm2e?

% !TEX program = xelatex \documentclass{article} \usepackage[ruled,vlined,algosection]{algorithm2e} \begin{document} \begin{algorithm}[htbp!] \SetKwProg{add}{add}{(a,b)}{} ...
1
vote
1answer
27 views

How to customize the caption as a figure number in the algorithm2e package

I want to show the algorithm as a figure and cite that figure using the figure number anywhere in the page. Below is the code: \documentclass[a4paper,11pt]{report} ...
2
votes
1answer
63 views

Display the algorithm number based on the chapters

I have to number the algorithms based on the chapters that they appear. I have used the command \listofalgorithmes. But still I have the issues. Please refer to the attached codes and figures ...
2
votes
1answer
85 views

Algorithm2e package edit the line numbers

I need to remove the line numbers only below Step 1 and continue it after Step 2 and skip numbering infront of cc in Step 2. Please refer to the attached figure and the latex code. How I can do ...
2
votes
2answers
67 views

Insert a lstlisting inside an algorithm2e

I would like to be able to present a C++ code snippet. I would like for this snippet to be captioned, referenced, and included in the Table of Algorithms generated by the algorithm2e package. This is ...
2
votes
1answer
133 views

How to scale algorithm to fit in one frame and centered in the frame at same time?

Originally, the algorithm is too long to fit in the frame. If I use the \scalebox{0.8}{}, it can fit in the frame but doesn't look like to be centered in the frame. Here is the code and output. First ...
1
vote
1answer
66 views

How to align the image and algorithm in the frame?

The following is the code and its output. The output doesn't look well. If they are both aligned horizontally by their left and then centered in the frame, it will looks better. But how? (The image is ...
0
votes
1answer
92 views

How to display the algorithm2e at the center of the frame in the beamer?

I want to display my algorithm in the center of the frame like the sentence hello world in the code. Here is my code and the output: \documentclass{beamer} \usepackage{algorithm2e} \begin{document} ...
3
votes
1answer
91 views

Why does the \LinesNumbered command not work of the algorithm2e package in beamer frame?

I want to add line number from the fourth line, but the \LinesNumbered command doesn't work at all. \documentclass{beamer} \usepackage{algorithm2e} \begin{document} \begin{frame} ...
2
votes
1answer
50 views

Problems with algorithm2e and \If

I have tried to solve this problem following this tutorial, but with no success. I was using \If and \EndIf and now I have switched to \eIf but with no success. I'm using \; at the end of each line to ...
4
votes
1answer
73 views

Missing end statement in algorithm2e environment

I used \SetKwProg{myproc}{Procedure}{}{} for starting my pseudo-code with Procedure keyword. But its end statement (the last end in pseudo-code) is not appear in the result pdf. So how can i bring it? ...
3
votes
1answer
80 views

Procedure name with small caps in algorithm2e

I know that procedure in algorithm2e only allows captions like \caption{ProcedureName()}. However, I'd like my procedure to appear in small caps: \documentclass[12pt,a4paper]{article} ...
0
votes
0answers
17 views

Replacing 'Algorithm' keyword in caption of algorithm2e environment [duplicate]

I want the following to appear: ------------------------------------ Policy 1: APolicy ------------------------------------ while not-an-end-of-doc do read-line; print-line to stdout; end ...
4
votes
1answer
115 views

How to change algorithm caption to figure caption ouside of the box?

I'm using IEEEtran with \usepackage[boxed,linesnumbered]{algorithm2e}. I have one pseudocode/algorithm. My caption inside the algorithm environment appears as "Algorithm 1". Since I only have one ...
0
votes
1answer
731 views

error: breqn.sty and algorithm2e.sty not found

I've installed MikTex 2.9 for Windows 7, 64 bit. While trying to compile my Tex, I receive the following errors: LaTeX Error: File breqn.sty' not found. LaTeX Error: Filealgorithm2e.sty' not found. ...
3
votes
1answer
130 views

Defining a new keyword in algorithm2e

I'm trying to define a new keyword for my algorithm: \documentclass{article} \usepackage[]{algorithm2e} \begin{document} \SetKw{kwInit}{Init:} \begin{algorithm} \kwInit{$\alpha_n=1$ for all $n$} ...
1
vote
1answer
166 views

Pseudo code algorithm not showing in a frame

I am using this code to show a pseudocode: \usepackage{algorithm2e} ... \begin{algorithm}[H] \SetAlgoLined \KwResult{Write here the result } initialization\; \While{While condition}{ ...
4
votes
1answer
2k views

do-while loop in algorithm2e

I am using \usepackage[norelsize, linesnumbered, ruled, lined, boxed, commentsnumbered]{algorithm2e} \RestyleAlgo{boxruled} It seems that algorithm2e has the default repeat-until construct. But I ...
5
votes
2answers
165 views

How to switch off “figure” in algorithm2e only in certain cases?

Suppose the following situation. Algorithm2e should have the global option "figure", i.e. an algorithm is included in Figures. However we need to switch off this property only in certain cases (to ...
1
vote
0answers
150 views

Publication style for Algorithms

I want to make own paragraphs for algorithms by numbering them appropriately. I do not need any fancy things - white background, no borders and black font are ok. I am trying to write in Springer ...
2
votes
1answer
55 views

Change style of specific algorithm with algorithm2e

I have the following LaTeX code \documentclass{article} \usepackage[ruled]{algorithm2e} \begin{document} \begin{algorithm} do something\; \caption{Algorithm #1} ...
4
votes
1answer
122 views

Numbering Procedure and Algorithm Independently in algorithm2e

I want to use algorithm2e to generate two procedure and two algorithm. The procedure and algorithm may be interleaved with one another, and both procedure and algorithm have their independent counter ...
5
votes
1answer
277 views

How to add Function body to Latex algorithm pseudocode

Does anyone know How to add Function body to Latex algorithm pseudocode? Thanks in andvance! Here is my code: \usepackage[vlined, ruled, boxed]{algorithm2e} \begin{algorithm} \KwData{model ...
2
votes
1answer
230 views

Procedure numbering in algorithm2e

When I use the package algorithm2e, I find the algorithms can be easily numbered, but the procedure cannot. How can I number the Procedures in algorithm2e, like Procedure 1, Procedure 2, ... %% ...
2
votes
1answer
114 views

algorithm2e labelformat and size of list of algorithms

I use algorithm2e to put algorithms in my documents, and I use \listofalgorithms to have a list of my algorithms in the table of contents but I noticed that their title size are a bit different: "List ...
4
votes
1answer
124 views

Multicols not breaking procedures in algorithm2e

I'm having a problem with the package multicol. I'm trying to split an algorithm into two columns. In particular, this algorithm is made up by two procedures. Unfortunately, in this particular case, ...
4
votes
2answers
146 views

Conditions in algorithms are underlined

I'm using algorithm2e for typesetting pseudocode. Generally I find it easy to use, however, I cannot seem to find the setting that underlines the conditions in my while and for loops and ...
2
votes
1answer
346 views

Side-by-side algorithms in two columns paper

I am trying to put two algorithms side-by-side on a page so it is easy to compare their differences. I am using the acm template, algorithm2e package and minipage environment. but I get this error: ...
2
votes
0answers
114 views

subcaption package changing algorithm2e caption position

I have a project which makes use of the subcaption and algorithm2e packages. For whatever reason, the subcaption package is causing the captions in the algorithms to be misplaced. Here we have a MWE ...
3
votes
1answer
291 views

How to have the algorithmicx comment symbol in algorithm2e?

I want to know how can I have the nice ▷ $\triangleright$ comment symbol of algorithmicx in algorithm2e?
2
votes
1answer
60 views

How to resolve the error: “Missing { inserted.” inside an algorithm2e

When I use ShareLatex or MikTex to compile the following LaTeX code: \begin{algorithm} \uIf{$|F_d(D'(C_{\hat{i}})) - F_d(D(C_{\hat{i}}))| > \sigma$ OR numSeqNoise > $\mu$}{ ...