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

learn more… | top users | synonyms

2
votes
0answers
26 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 ...
1
vote
1answer
655 views

algorithm2e indentation / line break [duplicate]

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 ...
2
votes
2answers
28 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
67 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
56 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
39 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
50 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
20 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
38 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
98 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 ...
4
votes
2answers
189 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
2answers
168 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 ...
1
vote
1answer
277 views

Big algorithm causing big mess

I am writing a document in which I needed to include the description of the Number Field Sieve (NFS) algorithm as mentioned in the book by Crandall and Pomerance. The algorithm's pseudo code is ...
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
96 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 ...
3
votes
2answers
110 views

Make listofalgorithms (algorithm2e) inside a section instead of chapter

I'm writing my thesis and I have a few algorithms (using algorithm2e) that I want to list in my appendix, but I don't want to start a new page. Also my listoffigures currently creates a section, not a ...
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
286 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 ...
9
votes
2answers
1k views

Amsart with algorithm2e introduces extraneous text into pdf file with Texlive 2011

I just removed the default Ubuntu TexLive 2009 installation and installed TexLive 2011 using install-tl. However, now I am facing problems with the amsart and algorithm2e packages. Specifically, when ...
5
votes
2answers
631 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} ...
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. ...
1
vote
0answers
190 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 ...
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
141 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
89 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
84 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
118 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 ...
30
votes
2answers
799 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
269 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
154 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
120 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
78 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? ...
10
votes
2answers
7k 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 ...
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} ...
5
votes
1answer
2k views

Frame for pieces of algorithms

I would like to put frames around pieces of algorithms like in the following picture. If the background of the rectangle can be changed, it would be nice. Here is the LaTeX code used for the ...
7
votes
1answer
3k 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 ...
7
votes
2answers
7k 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$ ...
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 ...