Questions tagged [algorithm2e]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
27 views

flalign in algorithm

This question is a bit related to the answer provided here: How can I use an align environment flush left? I use algorithm2e and mathtools to write an algorithm with an equation inside. I want it to ...
2
votes
1answer
43 views

Algorithm2e with ieeeaccess

I am using overleaf. When using the algorithm2e package, it gives me bold line numbers prefixed with a "-" symbol for each line. I want to have a line number in small fonts without the "...
1
vote
1answer
18 views

Hide horizontal line at the end of an algorithm2e algorithm

I am using the algorithm2e package to include a few algorithms in my document. A few of the algorithms are presented side-by-side, and I am not satisfied with how this looks with the bottom horizontal ...
1
vote
0answers
9 views

Capitalise cleveref reference of algorithm2e [duplicate]

I'd like to reference an algorithm from algorithm2e using hyperref and cleveref. The goal is that "Algorithm" is capitalised in the reference. Neither using the capitalise option nor ...
2
votes
1answer
48 views

Adding algorithm in manuscript LaTeX file

I am trying to write the algorithm in LaTeX File but it not able to indent properly. In below url of an image Here the While Loop is not getting an indented, same way for if-else. Any help will be ...
2
votes
1answer
41 views

algorithm2e with booktabs style and listing the algorithms in toc

I'm using the solution that @egreg provided on this answer, but I'm using the algorithm2e package instead of algorithms. I'd like to retain the design from booktabs but the command \listofalgorithms ...
0
votes
1answer
11 views

How to use \lIf and \lFor in one line for algorithm2e?

I'm using algorithm2e and am familiar with \lIf and \lFor to have no extra lines. But when I use both of them together, an extra blank line gets inserted. Is there a way to avoid that line? MWE ...
0
votes
1answer
22 views

The \caption command in an algorithm block gives this error: Missing number, treated as zero

I'm trying to write a caption to my algorithm in LaTeX, but something seems to not work. When I compile my code, I get some weird symbols in my caption, and a Missing number, treated as zero error. (...
2
votes
1answer
24 views

Avoiding indent in the new line when writing a long sentence in an algorithm

When writing a long sentence inside my algorithm, I am getting an indent in the new line. Is there a way to aviod this indent without creating a new number in this line? I am using the package ...
1
vote
1answer
25 views

Coloring the lines of an algorithm

I'm writing a report for a class project and I need to highlight several lines within some of the algorithms in the report. I managed to do so, but I don't like the solution I got. Here is a picture (...
2
votes
0answers
39 views

Compile error IEEE access template using algorithm2e package [duplicate]

I have been trying for a while to load the algorithm2e package to the IEEE ACCESS template. Whenever I use the following code, I am getting the error \usepackage{amsmath,amssymb,amsfonts} % \...
3
votes
2answers
61 views

\setparsizes and List of Algorithms

For some reason, in my work I have to reset the spacing of paragraphs with \setparsizes. This works quite well in the main part of the skript. But unfortunatley, it also effects the list of algorithms....
0
votes
0answers
20 views

I get the error “ You can't use `\prevdepth` in horizontal mode” while using `algorithm2e` package

I use a separate .tex file for every section in my document. One of these documents require an algorithm to be written. I use algorithm2e package to do so. Here is my MWE (algorithm is taken from this ...
0
votes
1answer
23 views

Change function prefix name in caption with algorithm2e

\SetAlgorithmName changes the prefix that comes in caption with \begin{algorithm}...\caption{lol...}\end{algorithm} from \usepackage{algorithm2e}. But how to change that prefix/name for functions? ...
2
votes
1answer
18 views

Algorithms in Elsevier's ifacconf.cls environment

The ifaccong.cls is located here https://www.ifac-control.org/events/resolveuid/b0e4734736878819db179d76290a8f78. How do I do algorithms in the ifacconf document class? Using algorithm2e package ...
1
vote
1answer
19 views

Why is my algorithm environment (algorithm2e) centered?

I have some Latex (below) which renders the algorithm environment with centered text: This doesn't match the wikibooks Latex documentation, which shows a left-aligned block. I'd rather not post all ...
1
vote
0answers
21 views

Write long algorithms in IEEE with 2 columns and separate their content in both columns

I was wondering if anyone would know how to fix the problem that given a very long algorithm and a text that has to be defined in two columns, how could I make that when the end of the column is ...
2
votes
1answer
43 views

The format of if-else in the function is wrong

When using latex to write pseudo-code, using loops in the function, the vertical line position is wrong. \usepackage[ruled,lined]{algorithm2e} \usepackage{algorithmicx} \usepackage{algpseudocode} \...
1
vote
1answer
27 views

Align leftarrows in Algorithm2e Package

I am trying to get multiple lines aligned inside an algorithm. So far, my code and outcome looks like this: \usepackage[german,onelanguage,linesnumbered,ruled]{algorithm2e} \documentclass[pdftex,...
0
votes
1answer
28 views

tufte-latex: Full-width algorithm2e blocks without minipage

I'm using an algorithm2e block in the tufte-latex book and I would like to try to make it full width. I know that the question has been asked here: tufte-latex: Full-width algorithm2e blocks but using ...
0
votes
1answer
34 views

Algorithm pseudocode is not executable in IEEE Transection Template. Snapshot of error is attached

\documentclass[journal]{IEEEtran} \usepackage[lined,boxed,ruled,commentsnumbered]{algorithm2e} \usepackage{algpseudocode} \begin{document} \begin{algorithm}%[H] \caption{%\textcolor{blue} {Pseudocode ...
1
vote
0answers
39 views

How to make algorithm2e float?

I want to make an algorithm float and I use the algorithm2e package. However, I can only use H for the algorithm. If I use htbp, I will get a Missing number, treated as zero error at \begin{algorithm}....
0
votes
0answers
50 views

How to apply adjustbox on an algorithm(2e)

I have a double page document and I wish to add an algorithm at a certain point. But if I just include the algorithm (of the algorithm2e package) then the text gets really bad since many lines of the ...
0
votes
0answers
10 views

Spacing between lines of algorithm2e without affecting tables in double column document

I am having a two columns document with something like this: \documentclass[conference]{IEEEtran} \usepackage{algorithm2e} ... \begin{document} ... \IncMargin{1em} \begin{algorithm}[htbp] \...
1
vote
1answer
75 views

parallel block in algorithm overleaf

One part of my algorithm is done in parallel, for that, I have a block in my algorithm, but I can not show it properly. Can anybody help me to solve this problem? \usepackage[linesnumbered,lined,boxed,...
2
votes
1answer
32 views

avoid line numbering in a algorithm when closing tcolorbox and adjustbox

when closing the tcolorbox and adjustbox inside an algorithm, the lines of codes corresponding to their commands are displayed numbered. How can I prevent the 1 beside the caption (see the below ...
1
vote
1answer
26 views

Algorithm: make loop lines appear below the words

I am using the algorithm environment and I do not know how to make the lines for the loops under the corresponding word, not where I have them now. Here is my code: \documentclass{article} \usepackage[...
1
vote
1answer
30 views

Algorithm in `oframed` environment

\usepackage[ruled,vlined]{algorithm2e} \usepackage{framed} \setlength\FrameSep{5mm} \begin{document} \begin{oframed} Some text... \begin{center} \begin{algorithm} ...
2
votes
1answer
30 views

algorithm2e - Bug (?) with \SetKwSwitch

The following M(not)WE should work. Did I find a bug ? \documentclass{article} \usepackage{algorithm2e} \SetKwSwitch{Switch}{Case}{Other}{Switch}{:}{Case}{Other}{} \begin{document} \begin{...
0
votes
0answers
38 views

pseudocode Environment in Latex

I am trying to write the below algorithm in Latex but failed to get the symbols which are highlighted in red. Does latex support this symbol or I am making a mistake in the script? Example script: \...
0
votes
0answers
18 views

Align equation in algorithm

I am using algorithm2e to try and write an algorithm with an equation. So far we're looking at \title{AlgorithmTemplate} \documentclass[12pt]{article} \usepackage{fullpage} \usepackage{times} \...
0
votes
0answers
34 views

How to split algorithm2e?

Is there any way to split algorithm2e in two pages? I want it to be under the paragraph on page 1 and the rest of it on page 2. \documentclass{article} \usepackage{xcolor} \usepackage[linesnumbered,...
1
vote
1answer
47 views

algorithms in margin of tufte style book?

I would like to place an algorithm in the margin of a tufte style book. I am using algorithm2e. I have no idea how to do this, or if it is possible at all. Please help? Here is an example but it place ...
2
votes
1answer
32 views

algorithm2e get rid of newline after then

I'm having this code \documentclass[11pt,a4paper]{article} \usepackage[]{algorithm2e} \begin{document} \begin{algorithm}[H] \If{cond}{ stmt1\; }...
2
votes
1answer
46 views

algorithm2e fully justified input / output blocks

I would like to fully justify the input/output blocks in the algorithm2e environment. How can this be achieved? I cannot find anything regarding this matter in the documentation. To be precise, I ...
1
vote
1answer
96 views

Combining letters and numbers in numbering algorithms by using the algorithm2e package

For my Appendix section, I would like to reset the numbering of my equations and algorithms, and I would like to add the letter "A" just before the numbers. I do achieve this goal for my ...
1
vote
0answers
20 views

Is there a way to change the thickness of the lines from loop to loop in algorithm using algorithmic2e?

Let say I have the following algorithm \documentclass[12pt]{article} \usepackage{fullpage} \usepackage{times} %\usepackage{fancyhdr,graphicx,amsmath,amssymb} \usepackage[ruled,vlined,linesnumbered]{...
3
votes
2answers
76 views

tufte-latex: Full-width algorithm2e blocks

I'm using \documentclass{tufte-book} and trying to get a full-width algorithm environment (specifically, using algorithm2e). Minimum working example: \documentclass{tufte-book} \title{Full-width ...
2
votes
1answer
54 views

Central line number for large function with algorithm2e

I have an algorithm (using algorithm2e) where I need a big function, so I want to enter it as an equation. But the line numbering seems a bit weird, as it numbers an empty line. I want the number to ...
1
vote
0answers
17 views

Missing list of Algorithm in the content

The command in my tex \listofalgorithms is detected as unrecognized command. In the generated pdf file. The page of Algorithm is presented, while in the content, this page is skipped. So what can I do ...
3
votes
1answer
84 views

How to center the caption in a boxed algorithm?

I want to center the caption in the following algorithm by using the algorithm2e package. But I do not get it. The documentation tells me that \SetAlgoCaptionLayout{centerline} should work, but it ...
0
votes
1answer
39 views

why adding hyperref makes algorithm2e not span pages any more?

TL 2020. compiled using lualatex I have set up of the form \begin{algorithm}[H] .... \end{algorithm} \begin{algorithm}[H] .... \end{algorithm} \begin{algorithm}[H] .... \end{...
2
votes
1answer
112 views

Using algorithm2e, how to make IF condition 1 OR conditions 2 OR conditions 3 THEN

Using algorithm2e currently when I do this \If{ condition_1 OR condition_2 OR condition_3} But if the stuff between {} is too long, it wraps around and does not look good since there is no ...
1
vote
1answer
182 views

How to remove “then” after if statement in algorithm2e

I am trying to write a pseudocode and would like to remove the then statements showing up after if or else if statements. \documentclass[ijoc,nonblindrev]{informs3} \usepackage[linesnumbered,ruled,...
1
vote
2answers
130 views

How to remove the colon in the caption of `algorithm2e`

I am preparing a presentation, and I want the title of the algorithm without any numbering, and without any colons. I use the commands \renewcommand{\algorithmcfname}{} \renewcommand{\thealgocf}{} ...
0
votes
0answers
103 views

Algorithm2e with tufte layout: how to get full-width and margin floats?

I'm using the tufte-book layout, which provides marginfigure, figure and figure* environments to create floating figures which occupy either the margin only, the main text column only, or uses the ...
0
votes
1answer
35 views

Loops does not close at their right place

I am trying to write an algorithm on laTex, my problem is that for loops do not close at right place. I am printing output outside of loop but still it appears inside for loop \title{...
2
votes
1answer
44 views

Best way to write input section of algorithm

i have a problem to align the part regarding the parameter section. So far i have obtained such result: \documentclass[a4paper,parskip=half*,twoside,numbers=noenddot]{scrbook}\usepackage{textcomp} \...
1
vote
1answer
44 views

\listofalgorithms not working with algorithm2e in document class puthesis

I am using the algorithm2e package to add some algorithms to my thesis with the following line in my preamble: \usepackage[]{algorithm2e} However, I am unable to add the list of algorithms to my ...
3
votes
2answers
344 views

algorithm2e vertical line indentation

I really like the vertical line feature of algorithm2e, but I ran into trouble with it when I try to indent an if statement. I used the following code. \documentclass{article} \usepackage{amssymb,...

1
2 3 4 5
12