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

learn more… | top users | synonyms

2
votes
0answers
24 views

Using special characters with lstlisting

I am using the Algorithm2e package to use code in my LaTeX document. However, the code contains special characters such as à, é, è etc. Those characters causes errors such as Unicode character x not ...
2
votes
2answers
26 views

\Titleofalg with algorithm2e package

The following code gives me an error and I am not sure why: \documentclass{beamer} \usepackage{default} % typesetting of algorithms \usepackage[vlined,linesnumbered]{algorithm2e} ...
0
votes
1answer
47 views

Writting Recursive algorithm (LCS) using algorithm2e package similar to the one shown in attached image [duplicate]

I want to write this algorithm (recursive) in latex but I don't know how to do it. I have attached image of the algorithm. Please help me with the code. I am using algorithm2e package. Thanks!!
0
votes
1answer
64 views

How to remove vertical lines representing a block in algorithm2e

\begin{algorithm} \SetNoLine \DontPrintSemicolon % Some LaTeX compilers require you to use\dontprintsemicolon instead \KwIn{A finite set $A=\{a_1, a_2, \ldots, a_n\}$ of integers} \KwOut{The largest ...
2
votes
1answer
55 views

\Fn ! Undefined control sequence

Under Ubuntu 15.04, I want to use algorithm2e to write pseudo code, when I copied an example from the documentation, TeXStudio displays error indicating that the command \Fn is undefined. I thought ...
2
votes
2answers
38 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
47 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
17 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
48 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
21 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
19 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
37 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
24 views

Latin characters in algorithm2e package [closed]

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
95 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
163 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
42 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
25 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
94 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
95 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
71 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
282 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 ...
15
votes
1answer
1k 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
149 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
139 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
87 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
32 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
81 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
116 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
85 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
264 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
79 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
152 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
119 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
77 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
88 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
115 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
156 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
1k 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
217 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
257 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
3k 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
178 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
189 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
80 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
197 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
372 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
318 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
156 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
146 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, ...