Skip to main content

Questions tagged [algorithm2e]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
56 views

I want to recreate the match-with construct typical in functional programming languages using the algorithm2e package. I've found that \SetKwSwitch gets me most of the way there, but it forces the 'do'...
ixb's user avatar
  • 55
2 votes
2 answers
74 views

In alogorithm2e, output have a boxed frame, but I need a left vertical line alone. How can we achieve this. I have attached a screenshot as expected. MWE: \documentclass{article} \usepackage{...
Devi Gangadharan TNQ Software's user avatar
2 votes
1 answer
41 views

I'm trying to create a new LaTeX environment, let's call it algprocedure, for typesetting procedures. I want it to look and feel exactly like the algorithm environment from the algorithm2e package, ...
pchappy's user avatar
  • 135
0 votes
1 answer
53 views

I am preparing a submission using the JMLR LaTeX template (link to template), and I am running into some formatting issues with algorithm2e. When I compile the following code: \begin{algorithm} \...
user1234567890's user avatar
0 votes
0 answers
60 views

I have the following problem. I have a relatively long pseudocode, and when I have text before it, either 1) there is a lot of white space, or 2) the text on the previous page is stretched out, or the ...
Iris Der's user avatar
2 votes
1 answer
109 views

Suppose I have this textual code: foo(a, b, c) I want to typeset it such that in the result .pdf file it appears this way: foo(a, b, c) In addition, ChatGPT provides a "solution" ...
coderodde's user avatar
  • 645
3 votes
1 answer
73 views

I am writing an article in which I use the algorithm environment. When I put a numbered equation in the algorithm (sorry computer science people), the equation number is not aligned properly. Very ...
seaver's user avatar
  • 595
3 votes
0 answers
34 views

I am trying to write the following pseudocode: In text form: citește n,x,y (numere naturale nenule, x≤n, y≤n) nr←0 ┌pentru i←n,1,-1 execută │┌dacă i%x=0 și i%y≠0 atunci ││ nr←nr+1 ││altfel ││┌dacă i%...
stalecu64's user avatar
5 votes
1 answer
114 views

Documentation: As the title, if we texdoc algorithm2e, in the documentation of Page 5, the example of "Algorithm 2: disjoint decomposition", we zoom in and the last line's number is not ...
Explorer's user avatar
  • 8,735
0 votes
0 answers
69 views

I am trying to create a template for algorithms in Persian. I have the following piece of code, where I am using algpseudocode along with algorithm package. This setup works nicely; however, I would ...
Hosein Rahnama's user avatar
2 votes
1 answer
35 views

When I add a caption to my algorithms, it appears on the top, just as I want, however, it is always preceded by a text like "Algorithm 1:". For example, this code \documentclass{beamer} \...
Hilder Vitor Lima Pereira's user avatar
3 votes
1 answer
205 views

I'm new to LaTeX and I'm facing a problem while writing my proposal through Overleaf. As this pic, the line numbers of my alg are outside the box. Is there anyway to solve this problem? Here is my ...
evelyn's user avatar
  • 71
2 votes
1 answer
64 views

I am looking for a method to change the color of the vertical line between while statements, for loops, and so on in the algorithm2e package, similar to the answers proposed in this question, but ...
Bart Wolleswinkel's user avatar
0 votes
1 answer
35 views

Is it possible to draw a vertical line as a separator between the line numbers and algorithm? The line height and position should be automatic and not hard coded and adjust to algorithm height. There ...
Simon's user avatar
  • 191
1 vote
1 answer
148 views

Some of the algorithm passes the compilation process. Rest throws an error !Package tagpdf Error: The number of automatic begin (21) and end (18) (tagpdf) text-unit para hooks differ! Is there a ...
Senthil's user avatar
  • 117
3 votes
1 answer
85 views

I am trying to put a line in algorithm2e: \documentclass{IEEEtran} \usepackage[ruled,linesnumbered]{algorithm2e} \begin{document} \IncMargin{1.5em} \begin{algorithm} algorithm here\; \hrule ...
Simon's user avatar
  • 191
1 vote
0 answers
58 views

I am using a fill-width algorithm in two columns mode; however, it always floats to the next page even though the current page is empty: \documentclass{IEEEtran} \usepackage[ruled]{algorithm2e} \begin{...
Simon's user avatar
  • 191
3 votes
2 answers
140 views

I am using this code: \documentclass{IEEEtran} \usepackage{amsmath,amssymb,amsfonts} \usepackage{xcolor} \usepackage[ruled,lined,linesnumbered]{algorithm2e} \SetKwInput{input}{\textcolor{black}{Input}}...
Simon's user avatar
  • 191
0 votes
1 answer
75 views

We need the box with dotted rules around the algorithm. I tried using \usepackage[boxruled]{algorithm2e}. The rule comes as solid rule instead of dotted what I required. Can you please check and ...
Rajasekar's user avatar
1 vote
1 answer
73 views

As the title specifies it: Is there a way to reset the line number of a single algorithm when using algorithm2e? My use case is to start line numbering of an algorithm from 26. Non working minimal ...
coderodde's user avatar
  • 645
6 votes
1 answer
343 views

Apparently there is something wrong in the combined use of algorithm2e, hyperref, and cleveref. (I am on the last version of MiKTeX for Windows, with all the packages updated. It used to work properly)...
not A or B's user avatar
1 vote
1 answer
73 views

I wrote this algorithm in algorithm2e and it only gets visible in the PDF when I delete the last for loop, does anyone know why? \begin{algorithm} \caption{variable normalization} \KwData{CNF formula $...
Timon Paßlick's user avatar
3 votes
2 answers
148 views

How can I change the line color (and for that matter style, such as line width, dashed, double lines) of the vertical lines between block start-end keywords in the algorithm2e package? Thanks in ...
Bart Wolleswinkel's user avatar
0 votes
1 answer
43 views

good day. I want to add listing (bulleted and enumeration), algorithms, pseudo code and flowchart in a tabular environment. For example \documentclass[a4paper]{article} % Package used for input and ...
user3056542's user avatar
0 votes
0 answers
40 views

My code is: \State \textbf{Initialize: }$n_{ch,IA} \gets false$, $n_{ch,DA} \gets false$, $reached_{IA} \gets false$, $w_{n_{ch,IA}} \gets false$, $w_{r_{low,IA}} \gets false$, $v_{red,computed} \gets ...
pal_jsr's user avatar
3 votes
1 answer
131 views

When I use algorithm2e package to write a paper in vertex 4-1 with WinEdt7, the output pdf file has a wrong indent format in the algorithm part. Everything is messed up! It looks like this: What ...
mingo's user avatar
  • 33
0 votes
0 answers
54 views

I have following code for an algorithm block: \usepackage{algorithm} \usepackage{algorithmicx} \usepackage{algpseudocode} \usepackage{enumitem} \usepackage{minibox} \usepackage{multirow} \usepackage{...
ranaya's user avatar
  • 1
2 votes
1 answer
108 views

I have been writing my research and had to use a lot of algorithm inserts, and I haven't worked with it enough to solve this issue. My For and EndFor part don't seem to align no matter what. I tried ...
Charlotte's user avatar
1 vote
1 answer
50 views

The following MWE: % Created 2016-07-04 Mon 15:02 \documentclass[a4paper, 12pt]{article} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathtools, nccmath} \usepackage[...
JKHA's user avatar
  • 537
4 votes
2 answers
92 views

Consider the following example, placing equation*s inside of an algorithm environment: \documentclass{standalone} \usepackage{amsmath} \usepackage{algorithm2e} \LinesNumbered \begin{document} \...
hfhc2's user avatar
  • 904
1 vote
1 answer
139 views

I have some pseudocode for an algorithm, which appears okay (with some minor errors in compilation). But the biggest problem is that the numbering of the steps does not match the number of steps in ...
underdog987's user avatar
0 votes
1 answer
178 views

I want to be able to reproduce this environment within the context of exam correction. One clue I found is the usage of the bclogo package. https://ctan.org/pkg/bclogo Howerver, I would like to ...
Mouadh Ben Salah's user avatar
0 votes
0 answers
91 views

I installed texlive 2024 using this link on Ubuntu 2022.04 and added the latex folder to system paths I can compile the document when I do not use algorithm2e package. but unfortunately, when I want ...
Ali Ghazi's user avatar
1 vote
1 answer
91 views

I have algorithms that I wrote in algorithm2e. But I want the name of the function written in typewriter. As you see in the picture, this does not work, I get this strange font: Here is my MWE: \...
Lereu's user avatar
  • 471
3 votes
1 answer
151 views

I want to implement a if else block like that if A if B if C else if D end if E end end end Where if C and if E has same indentation. if B under if A. if C and if E both are ...
Encipher's user avatar
  • 548
1 vote
0 answers
25 views

As you can see on the picture, the algorithm environment (from package algorithm2e) does not respect the text width when it is used inside exam questions. Actually, it exceeds the right margin: \...
Lava's user avatar
  • 11
1 vote
0 answers
91 views

I'm writing an algorithm with algorithm2e. I want to do an inline if with \lIf with a comment on the same line with \Comment*. \documentclass{article} \usepackage[vlined,boxed,linesnumbered]{...
JacopoStanchi's user avatar
5 votes
1 answer
208 views

I'm having back reference issues when using an algorithm. Consider the following example \documentclass{article} \usepackage[algo2e,linesnumbered,algonl]{algorithm2e} \usepackage[backref=section]{...
walleye's user avatar
  • 123
2 votes
1 answer
70 views

\documentclass{article} \usepackage{algorithm2e} \SetAlgoCaptionSeparator{.} \begin{document} \begin{algorithm} code\; \caption{I want to align this caption left} \end{...
Junee's user avatar
  • 31
1 vote
1 answer
111 views

I want the floating block used in algorithm2e at the page's top instead of the middle. Here is my sample code with this Tex SX link's help: \documentclass{article} \usepackage{lipsum,mathtools} \...
An5Drama's user avatar
  • 165
2 votes
1 answer
138 views

I followed this QA link to left-align the equation and this to prefer using \hspace instead of \hskip: \documentclass[12pt,a4paper]{article} \usepackage{amsmath,mathtools} \usepackage[algosection, ...
An5Drama's user avatar
  • 165
2 votes
1 answer
158 views

I followed some QA links like this in tex stackexchange and use this example tex code: \documentclass[12pt,a4paper]{article} \usepackage{amsmath} \usepackage[algosection, boxruled, linesnumbered]{...
An5Drama's user avatar
  • 165
1 vote
1 answer
190 views

After spending 2 hrs on this and trying all sorts of things, I give up. I am using algorithm2e and when I have long description lines, the new line gets shifted a little to the right. Also, even ...
Nasser's user avatar
  • 21.9k
2 votes
2 answers
324 views

I'd like to restrict my algorithm in a box that it adapts at the width of the algorithm, as in this image: Here the code \documentclass{article} \usepackage[italian]{babel} \usepackage[utf8]{inputenc}...
Puck's user avatar
  • 1,500
1 vote
2 answers
97 views

In my code below, the option [italianokw] of algorithm2e--package does not function. Why? (I am new in use of this package.) \documentclass{article} \usepackage[italian]{babel} \usepackage[utf8]{...
Puck's user avatar
  • 1,500
2 votes
1 answer
626 views

Consider the following minimal example: \documentclass[usenames,dvipsnames]{beamer} \usepackage[linesnumbered,boxed,ruled,vlined,resetcount]{algorithm2e} \begin{document} \begin{frame}[fragile] ...
Hilder Vitor Lima Pereira's user avatar
2 votes
1 answer
113 views

I am using the algorithms environment from algorithm2e in a modified way with reduced width (following the solution here), see the MWE below. This generates an overfull box that I'd like to get rid of....
user279611's user avatar
1 vote
0 answers
70 views

Is it possible to put the two following algorithms in the same file. I tried several times but I did not succeed. Thanks for your help. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{...
Nehme's user avatar
  • 63
0 votes
1 answer
246 views

I am trying to compile a .tex file in Overleaf, I am using the IEEEAccess template to write the manuscript. When I compile the LaTeX file, it throws the error on the given algorithm script. I am ...
Aavash Bhandari's user avatar
0 votes
1 answer
138 views

I am very new to Latex. I have problem with \SetAlgoLined in algorithm2e. As seen from the picture, inside the while loop the line seem to be normal. I don't know why outside the while loop, the line ...
Chanun Asavasirikulkij's user avatar

1
2 3 4 5
15