Questions tagged [algorithm2e]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
18 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{...
1
vote
1answer
32 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
26 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
44 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,...
0
votes
0answers
16 views

Cref an algorithm with its caption

When I \cref an algorithm, it shows "algorithm 1". Is it possible to ref an algorithm with its numbering and caption? Like "algorithm 1 foo", where "foo" is the caption of algorithm 1. Thanks a lot
0
votes
1answer
12 views

Why are my “ends” not aligning while using algorithm2e?

I am using algorithm2e but my "end" are not aligning. Here is the output \begin{algorithm} \caption{UpdateRobotLocation} \label{alg:r2p} $robotLocation{\longleftarrow} robotLocation + ...
3
votes
2answers
69 views

Modifying the algorithm name in algorithm2e

I am using the algorithm2e package to generate pseudocode for a paper. The journal requires the format of "S1 Pseudocode", "S2 Pseudocode", etc. However, I am only able to generate the format as "...
0
votes
1answer
24 views

Change caption title “Algorithmus 1” in algorithm2e

Using \begin{algorithm} environment with only \usepackage{algorithm2e} in the preamble (and of course the usual packages for an article document), the environment by default titles the algorithm "...
-1
votes
1answer
38 views

what is wrong with my code

what is wrong with my code please do not closed my topic \documentclass[12pt,a4paper]{report} \usepackage[ruled,vlined]{algorithm2e} \usepackage{algorithmic} \begin{document} \begin{...
2
votes
2answers
30 views

How to write if and then in algorithm? [closed]

I want to write in this algorithm if after for. How can I do that? \begin{algorithm}[H] \caption{Algorithm Gaussian elimination with patrial pivoting} \SetAlgoLined \For{$i=1:1:n$}{ $p_{i} = ...
0
votes
1answer
38 views

Why is LaTeX failing to generate list of algorithms with algorithm2e? [closed]

I have 3 algorithms in my thesis (2 in appendix and 1 in a chapter). I have the package algorithm2e loaded in the preamble. I successfully generate a list of figures and list of tables, however, list ...
0
votes
1answer
23 views

Two captions for algorithm in algorithm2e package

In my thesis, I need to describe both algorithms and cryptographic games. Currently I am using the algorithm2e and the algorithm environment for both. Is there an option to specify dual captions so ...
0
votes
1answer
26 views

How to decrease right margin with algoritm2e?

I'm using algorithm2e and my lines are breaking too early. I would like to reduce the size of the margin on the right side, without affecting the left margin. I'm interested in doing it, because right ...
1
vote
0answers
15 views

Getting a long algorithm2e smaller by putting parts of it side by side

I'm currently trying to replicate this algorithm in algorithm2e: (Taken from https://sike.org/files/SIDH-spec.pdf) And I'm unable to find out how I can do something similar, as it would save me some ...
0
votes
1answer
16 views

How to change algorithm title format from point(.) to dash(-)

I am using package {algorithm2e} to write algorithm. Now I want to alter the algorithm title format with dash(-), for example, I am writing the first algorithm in chapter 3, so the title of this ...
2
votes
1answer
26 views

How to align algorithm2e with text outside?

I am having trouble aligning my algorithm with the text outside of it. Here is an example: \documentclass[11pt]{article} \pagestyle{empty} \oddsidemargin -0.25in \textwidth 7.0in \topmargin ...
3
votes
2answers
43 views

Indentation of line numbers while using equations within algorithm2e

I have written some algorithms using the package algorithm2e. Some of my algorithms also include aligned formulas. My problem is that line numbers below lines ending with equations have a larger ...
2
votes
0answers
16 views

Position of line numbers using algorithm2e and fontenc [duplicate]

I want to present an algorithm with the package algorithm2e. It mostly works fine, only the position of the line numbers are wrong. The numbers are printed within the margin of the page. I figured ...
0
votes
1answer
34 views

algorithm2e options algonl and boxed seem to clash

I'm using a solution suggested by C. Fiorio in Want Knuth style line numbering in algorithm2e algorithms. The suggestion was to use the algonl option for algorithm2e to achieve Knuth style algorithm ...
0
votes
2answers
43 views

Adjust caption of algorithm2e using own macro

I have a document with a few tables that have their captions formatted like this which I achieved using \usepackage[format=plain, justification=raggedright,singlelinecheck=true]{caption} \...
0
votes
1answer
21 views

Algorithm listing in wrong language and not numbered (a,b,c…)

I added \usepackage[ruled]{algorithm2e} to show pseudocode algorithms in my document. I also got an appendix, some figures and tables. In the end these should be listed. This works fine and its is ...
2
votes
1answer
56 views

Missing $ inserted, Missing \endgroup inserted

I am writing an algorithm in latex. I am getting some error. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \title{Demo} \author{Subhadip Patra } \date{March 2020} \...
1
vote
1answer
73 views

Changing the class to beamer does not specify the color dash line! How to fix the problem?

In this answer Changing the class to beamer does not specify the color dash line! How to fix the problem? \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage[ruled,...
1
vote
2answers
83 views

What's wrong with `\string`?

I am using the algorithm2e package to typeset my algorithms. I want to be able to control the caption numbering style. More specifically, I want the caption number to be enclosed in curly braces and ...
1
vote
1answer
27 views

Flush right page numbers for list of listings and algorithms using tocbasic

Based on a previous question Extending table of contents dots up to large page numbers I have been using tocbasic and have some Roman pages. In all the list of somethings the Roman numbers are right ...
0
votes
1answer
28 views

Spacing between list of listings and algorithms and their reference numbers with tocbasic

Because of this answer to Extending table of contents dots up to large page numbers I am using tocbasic and would like to add more spacing between the reference numbers in the List of listings ...
0
votes
1answer
81 views

How to write an algorithm in algorithm environment in Latex?

How do I write the following algorithm/pseudocode in algorithm environment in Latex? train_ANN(fi,wi,oj) For epochs from 1 to N While (j<=m) Randomly initialize wi={w1,w2…..wn} ...
3
votes
2answers
68 views

How to note that a algorithm is done in \mathcal O (n)

I have an algorithm and I'd like to mark the time it takes to go through. The minimal working example is \documentclass[a4paper]{scrartcl} \usepackage[ruled,vlined]{algorithm2e} \begin{document} \...
1
vote
1answer
19 views

Indentation not aligning while using algorithm2e package

Below is my latex: \usepackage[ruled,longend]{algorithm2e} \begin{algorithm} $I \gets \text{Images of objects' plane}$\newline $Detector \gets \text{Define detector}$\newline $Descriptor \...
0
votes
2answers
42 views

How to place two algorithms side by side

I am using a document class called informs which can be accessed here at INFORMS Journal on Computing Style Files. I'd like to place two pseudocodes side by side. It looks like this question has ...
2
votes
1answer
46 views

Problem with scrartcl, fontenc and algorithm2e

I have a problem with scrarticle (and its option parskip=half), fontenc and algorithm2e: \documentclass[parskip=half]{scrartcl} \usepackage{fontenc} \usepackage[boxed]{algorithm2e} \begin{document} \...
1
vote
1answer
37 views

How to have sub-numbering in an algorithm

Below is a Dummy Algorithm code. I am not getting the desired output with this code. The code is as follows: \documentclass{article} \usepackage[ruled, lined, linesnumbered, commentsnumbered, ...
-1
votes
1answer
51 views

How to write this algorithm in latex?

I use the following code for my project I can't write it for j = l :n if j > 1 A(j:n,j) = A(j:n, j) - A(j:n, l :j - l )·A(j, l:j - l )T end A(j:n, j) = A(j:n, j) / J A(j,...
0
votes
0answers
20 views

How to type custom labels in algorithm2e [duplicate]

I would like to know how do I type a custom bold word in Latex algorithm2e. I want to type the word "Hyperparameters" but after reading through the manual, I still do not know a way to do it. This is ...
2
votes
1answer
56 views

Change “line” autoref tag in algorithm2e using spanish language option

I'm using Latex and the package algorithm2e to write algorithms down. I reference a line with \autoref and the package hyperref generates "línea 3". I'd like to change the word "línea" to other word ...
2
votes
1answer
67 views

how to change the type of vertical line in algorithm environment while minimizing the vertical spacing

I am trying to have a straight vertical line after if and for statements to remove the redundant space in algorithm environment. I use informs3 class that can be found in this website where you ...
1
vote
1answer
82 views

How to remove line number from \tcc comments in algorithm2e

I am trying to write an algorithm using algorithm2e. I have to use \tcc comments at different phases of the algorithm. When I am adding \tcc comment in the code, in the output, each \tcc comments are ...
1
vote
1answer
55 views

Writing an algorithm using algorithm2e in LaTeX

I am a beginner in writing algorithm in LaTeX using algorithm2e. I am trying to write a simple algorithm (code is attached herewith). However, I am not getting correct output. I want to see line ...
1
vote
1answer
27 views

algorithm2e package lines are not ending in forall loop

My code is below I checked similar questions but can't find the answer. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[]{algorithm2e} \begin{document} \begin{algorithm} \...
0
votes
1answer
79 views

Algorithm in IET template not working

I want to include an algorithm in an IET electronics letter (the template and class files are available here), but I cannot find a way to do it. My algorithm format is similar to this, which uses ...
1
vote
1answer
31 views

Caption outside of float with algorithm

I have a template which I should use and want to add an algorithm in it. A short version of the template and a algorithm would be \RequirePackage{fix-cm,cmap} \documentclass[11pt, a4paper,...
1
vote
0answers
22 views

Long Algorithm in a Double-Column Paper

I wrote a long algorithm in a double-column paper. The issue that we have here is the length of the algorithm that exceeds the paper. Is there any solution to help me for that? Appreciate it \...
2
votes
1answer
104 views

Remove horizontal spacing on the right with algorithm2e

Is there a way to remove the space on the right side of an algorithm with algorithm2e? I found \algomargin in the documentation but it does not help. Example: \documentclass[]{article} \usepackage[...
0
votes
0answers
23 views

Use of algorithm within minipage gives error [duplicate]

I would like to adjust column width in algorithm below: \usepackage{amsmath,amssymb} \usepackage[norelsize, linesnumbered, ruled, lined, commentsnumbered]{algorithm2e} \begin{document} %\begin{...
0
votes
0answers
54 views

Using algorithm, algpseudocode, and algorithm2e packages altogether

I have to use algorithm, algpseudocode, and algorithm2e packages altogether. I got the following error: Missing number, treated as zero. <to be read again> \ALG@b@2@EndIf@0 ...
0
votes
0answers
39 views

Text width inside algorithm2e environment

I have included the contents of a simple .tex file using the algorithm2e feature. When compiled using an old (2015) version of LaTeX, I get the output as desired. But when compiled with the latest ...
2
votes
1answer
72 views

Problems in algorithm2e when superscript is in text mode

How can I fix the issue with the words Nuevo and Mejor? They are appearing in math mode but they should appear in textmode: Also, why does \argmax_{\mathbf{x} \in \mathcal{X}} appear next to arg max ...
1
vote
1answer
77 views

How to correct the indentation of line numbers of algorithm2e package when used with beamer class?

When using the algorithm2e package with the beamer class I get a different indentation for the line numberings than when using it with other classes. With beamer class they look like this: \...
2
votes
1answer
37 views

I am getting error in the following latex code. The error is of extra or missing $ or }

\documentclass{article} \usepackage{algorithm2e,algorithmicx,mathtools} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \begin{document} \begin{algorithm} \begin{algorithmic} \State 1. Find all ...
2
votes
1answer
46 views

Reducing space between 2 algorithms using algorithm2e

Is there any way to reduce the space between two algorithms? Here is a screenshot: \documentclass{article} \usepackage[linesnumbered,ruled,vlined]{algorithm2e} \usepackage{tikz} \usetikzlibrary{...

1
2 3 4 5
11