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

learn more… | top users | synonyms

1
vote
1answer
127 views

Is there a LaTeX to HTML tool that supports the algorithm2e package?

I'm a LaTeX beginner and I'm writing computer science documents. I carefully choose my algorithmic package considering the features I needed and that led me to pick algorithm2e (vlined and noend ...
1
vote
0answers
176 views

Genetic Algorithm pseudocode [closed]

Hi everyone, this is my first post, so apologise if not doing it properly. I need the following GA pseudocode (Photo) in LaTex, but couldn't do it very well. I really appreciate your help.
1
vote
2answers
23 views

Reference to a part of an algorithm

I would like to write about the analysis of an algorithm. Depending on some conditions multiple cases arise. I would like to reference the cases but not solely based on the line numbers. Essentially I ...
1
vote
1answer
62 views

How can I use an algorithm2e function macro inside an algorithm2e caption?

Algorithm2e lets you define functions using \SetKwFunction{Fn}{Function} which you can then reference anywhere in the document (not just in an algorithm environment) using e.g. \Fn (which will output ...
0
votes
0answers
64 views

Hanging caption with boxed algorithm2e

Along very similar lines to the question posed at Algorithm2e and hanging captions, I'm having problems producing captions for algorithm2e that have the same appearance as a figure caption (i.e. hangs ...
6
votes
1answer
126 views

shrink algorithm

I am writing a 2-column paper. I have 2 algorithms each within \begin{multicols} ... \end{multicols} environment. I want to scale each of them to half the size so that I can fit it side-by-side. How ...
0
votes
0answers
40 views

Is it possible to keep connecting loop lines in algorithm2e and to implement a page break?

I have to formulate many and long algorithms. My problem is that my algorithms are very long and need to break over pages. In order not to lose structure it would be very good to have those vertical ...
0
votes
0answers
25 views

How to change space below algorithm2e float

How can we change the spacing below the algorithm environment? Is there a possibility with the caption package? \documentclass[ 12pt, a4paper, twoside, titlepage, openright, ...
3
votes
1answer
97 views

Is it possible to change the box rule thickness of algorithm2e

Is it possible to customize the boxing rule width and color of an algorithm2e float? \documentclass{article} \usepackage{algorithm2e} \begin{document} % \RestyleAlgo{boxed} \RestyleAlgo{boxruled} \...
0
votes
1answer
98 views

indent somelines with the usepackage algorithm2e

I want to indent all lines after this line function(w,v with the usepackage algorithm2e. How can I get that to work? text \documentclass{article} \usepackage{german,t1enc} %pseudocode. \usepackage[...
3
votes
1answer
224 views

Write the else if block with algorithm2e

How can I write the else if block with condition with the usepackage algorithm2e? I want to write the following with the algorithm2e package: if(condition){ //code }else if(condition){ // code ...
1
vote
1answer
283 views

Algorithm2e writing simple pseudocode with multiple functions

I am new at algorithm2e and I'm really struggling with the most simple things. I would like to write an algorithm (pseudocode) with a few functions that call each other. For now, I have this minimal (...
2
votes
1answer
102 views

How to alter style of statement block line in algorithm environment of algorithm2e package?

I'd like to change the style of the line that runs along the side of a statement block in a pseudocode algorithm typeset using the algorithm environment of the algorithm2e package. Here's the initial ...
1
vote
1answer
132 views

! Undefined control sequence. <argument>

but it has a error. please help me. \documentclass{article} \usepackage[ruled,lined]{algorithm2e} \usepackage{xepersian} \settextfont[Scale=1]{XB Niloofar} \setdigitfont{XB Niloofar} \begin{...
1
vote
0answers
54 views

How to make the fully justified code at line-breaks?

I have a problem for using algorithm2e package. I am writing a algorithm just like \begin{algorithm} \caption{RM-MEDA} \label{alg1} Initial a population $Pop(0)$ and compute the $F$ ...
4
votes
1answer
161 views

algorithm2e - override defaults

I'm using using algorithm2e package with the following settings: \usepackage[ruled,vlined,linesnumbered,noresetcount]{algorithm2e} But for some subset of algorithms in the same document, I want to ...
2
votes
1answer
74 views

Changing algorithm2e keywords fonts

A journal has asked me to change the font of my algorithm to Courier New. I'm able to change all except the keywords (if, then, else, etc.). My best solution looks like this: \documentclass{article} \...
0
votes
0answers
45 views

How can I set the font for loops in algorithm2e?

Consider the following listing with algorithm2e. I want the font in the if-clause at the bottom to be in typewriter or the same font used in the loop bodies, and the list for the for-loops as well. I ...
1
vote
0answers
41 views

Indent the block with the algorithm2e usepackage

How can I indent the pseudocode block after this line function Karatsuba(p,q)? \documentclass{article} \usepackage{german,t1enc} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \...
1
vote
1answer
1k views

Can be used only in preamble occurs when using \usepackage command

Whenever I am trying to use the subfigure or the algorithm2e package using \usepackage command, it is showing LaTeX Error: Can be used only in preamble. What is the problem and how to get rid of ...
0
votes
0answers
35 views

Use chapter numbering style for algorithm2e in beamer

I have a document with several chapters and different algorithms, using algorithm2e and the option algochapter. Now I'm doing a presentation using beamer, however beamer doesn't support chapters. The ...
0
votes
1answer
103 views

How to write algorithm without numbering in latex

I am looking for the way to write a algorithm as: (without numbering). Please help me to write it in latex. Thanks in advance Algorithm: Input: A, B,C. Initialize \alpha, \beta,u Employ the A While |...
3
votes
1answer
88 views

How to mark line numbers of an algorithm with asterisk? [closed]

I'm working with IEEEtran and algorithm2e package. I have a pseudocode with numbered lines. I want to mark some of my line numbers (not the lines themselves) with an asterisk mark. How can I do that? ...
0
votes
0answers
114 views

How to present an algorithm in the middle of page

Is it possible to present the algorithm in the middle of page with smaller box? {\tiny \begin{center} { \RestyleAlgo{boxed} \SetAlgoCaptionSeparator{} \begin{algorithm} %\SetLine \KwIn{An empty array ...
2
votes
2answers
54 views

Which arguments does SetArgSty configure in algorithm2e

From the documentation of algorithm2e I was expecting \SetArgSty to change the style of arguments from functions in my pseudocode, not some arguments from the keywords algorithm2e uses. So if/for/etc ...
4
votes
1answer
103 views

Why SetKwData defined macro for algorithm2e doesn't work in caption?

I defined a macro with \SetKwData command from algorithm2e but it doesn't seem to be working in the caption. My code: \documentclass[10pt,a4paper,twoside]{report} \usepackage[linesnumbered,ruled,...
1
vote
1answer
153 views

Reset the default font and style for algoritm2e

I'm using a (required) template with a sans serif font, however I would like to maintain the default font for algorithms. I'm using pseudocode with variables with more than one letter, so I defined ...
2
votes
1answer
99 views

algorithm title, which is unnumbered, is not in place

The code \begin{algorithm} \SetAlgoLined \TitleOfAlgo{SA} \BlankLine \KwData{Movie} \KwResult{Classification} \BlankLine \Begin { \textbf{call Function 1: S}\\ \textbf{call Function 2: St}\\ \...
1
vote
0answers
166 views

Problem with list of algorithms using algorithm2e and classicthesis

I am using classicthesis to write my master thesis. I use the algorithm2e package to write down my algorithms. The problem I face is related to the table of content. For tables, contents, figures ...
1
vote
2answers
90 views

add line number to the algorithm2e [duplicate]

How can I add line number to my algorithm? I want to write line number in the front of the algorithm line. How can I get that with the \usepackage[ruled]{algorithm2e}? Code: \documentclass{article} \...
0
votes
0answers
52 views

How to align function arguments in algorithm2e environment

In the "algorithm2e" environment, when a function call spans multiple lines, I would like to have its arguments aligned, like so: MyFunction(long_arg_name0, long_arg_name1, ...
1
vote
1answer
239 views

Horizontal spacing in caption in algorithm2e

In algorithm2e, how can I shift the caption to the left? There is a small space that I need to remove. Here is my code: \documentclass[letterpaper]{article} \usepackage[linesnumbered,ruled]{...
3
votes
1answer
75 views

Preventing algorithm2e linebreaks

I want to include inline code examples such as if i < n then i++ and else i--. I'm using the following LaTeX: \documentclass{article} \usepackage{algorithmic} \usepackage{algorithm2e} \begin{...
3
votes
1answer
77 views

Repeat block without until (or blank line) using algorithm2e

I'm trying to format a "repeat forever" block using algorithm2e. I've found the \Repeat command but this prints an until at the end of my block. I can hide the word until using: \SetKwRepeat{Repeat}{...
1
vote
0answers
20 views

How to align algorithm with text [duplicate]

I am using the algorithm2e package for a paper, and I am using it as follows: \usepackage[ruled,linesnumbered]{algorithm2e} Everything works OK, however, when I added the linesnumbered directive (...
2
votes
0answers
295 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
135 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} \SetArgSty{...
0
votes
1answer
125 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
883 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 ...
3
votes
1answer
483 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
193 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
446 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} \usepackage[...
1
vote
1answer
97 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} \usepackage{...
6
votes
1answer
156 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
49 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
46 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
3
votes
1answer
104 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
36 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
333 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 ...
3
votes
2answers
1k 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 ...