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

learn more… | top users | synonyms

2
votes
2answers
32 views

Help with algorithm2e formatting

recentely I've got into a bit more advanced LaTeX formatting, i.e algorithms. My package of choice is the algorithm2e package, but I'm having some difficulities operating it. So I've wanted to create ...
2
votes
1answer
30 views

Colored horizontal lines in algorithm2e

I'm trying to colorize the 3 horizontal lines appearing at the top and bottom of the algorithm below. I haven't been able to find similar issues in the internet. Could you please advise? ...
2
votes
1answer
199 views

Sigplanconf algorithm2e missing algorithm when figure

I am rewriting a paper, and stumble over this problem where algorithms are missing in my appendix. I was able to reproduce the problem. The following code only display 2 out of the 4 algorithms on ...
1
vote
1answer
13 views

How to get a “tight” boxed algorithm with the algorithm2e package

I am using the algorithm2e package for my pseudo code since I like the like the options this package offers. However, the boxed option gives a text-width sized box and it doesn't look appealing to me ...
0
votes
1answer
65 views

How can I format this formula?

I am new to LaTeX. How to write this formula in a proper format as an algorithm? I cannot write this formula in proper format: if (some condition) P=P+(W$i$*((W-P)/W$i$)) end
0
votes
1answer
23 views

How to write in proper format of this code

I want to get the right hand side portion in a format. Here the format. Table[i, j] <-maximum { Table[i-1, j] AND Values[i] + Table[i-1, j – ...
0
votes
1answer
30 views

Compilation Error after running algorithm2e in document

This post is building of the solution posted here. When I try to put this code into my main code (or even \input the file, I get the error ! Argument of \reserved@a has an extra }. If I run the ...
0
votes
1answer
19 views

How can I add a comments with the `algorithm2e` package?

I am using algorithm2e package to write an algorithm and I am trying to add line 3 and 4 in the code in the screen shot as comment with \tcc{} but without seccuss. How can I add a comments with the ...
2
votes
0answers
34 views

How to combine algorithm and algorithm2e in one document?

I got myself in big trouble and I can't get out of it. I use standalone package to combine different latex files into one. Each Latex file compiles OK on its own. When I combined them, I found a ...
2
votes
0answers
240 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
0answers
42 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
0answers
230 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 ...
2
votes
0answers
103 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
13 views

Supress line number for specific lines in algorithm2e

I was following the \nonl approach devised by Werner found here, but after I put the \nonl command in, the following line is also not numbered. Can you help me suppress the numbering just for ...
1
vote
0answers
43 views

Problem with algorithm2e: \SetAlgoLined and \Indp not working properly together

Problem: I need to get something like this: But I'm getting this (note the vertical line): What I have: Here my code: \documentclass{report} ...
1
vote
0answers
36 views

Copied algorithm2e code renderes different

I'm writing a summary of my algorithms course and in order to insert new algorithms I use algorithm2e package. I am still learning the package features, so I tried to copy the code from latex ...
1
vote
0answers
35 views

Caption and pseudo code in algorithm2e appears as boxes (not rendered)

I want to create a multi-language document using polyglossia in which Khmer is set to be a main language and English as another language. I also have khmer-gloss.ldf available so that Khmer font is a ...
1
vote
0answers
53 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$ ...
1
vote
0answers
33 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
0answers
129 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
0answers
46 views

Underline entire line in algorithm2e

is there a way to underline entire line of code in algorithm2e? Including keywords like for each etc.
1
vote
0answers
353 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 ...
1
vote
0answers
93 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 ...
1
vote
0answers
198 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 ...
1
vote
0answers
114 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} ...
1
vote
0answers
163 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 ...
0
votes
0answers
31 views

Formatting an algorithm with a nice presentation

I was reading this paper and I think is really nice the format how they present the algorithms, how can I do this? what packages are needed and the styles. Thanks in advance.
0
votes
0answers
18 views

How to write the algorithm with bold keywords and line numbers

I wish to write an algorithm like the following, with keywords bold and line numbers in each line. Could someone help on how to use latex to write this kind of algorithms?
0
votes
0answers
23 views

Change the format of an algorithm from a table to any algorithm typesetting

I have been struggling to format the pseudocode of my algorithm from the current state (in a table) to the one provided by the algorithm package. After several tries with answers like: one, another, ...
0
votes
0answers
48 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 ...
0
votes
0answers
29 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
18 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, ...
0
votes
0answers
25 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 ...
0
votes
0answers
29 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
0answers
81 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 ...
0
votes
0answers
39 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, ...