{algorithm2e} is a package providing a floating algorithm environment with algorithmic keywords.
1
vote
1answer
24 views
How to define new loops in algorithmicx?
How can I define a new loop in algorithmicx? For example, code like this:
ex1)
PreLoop s do
--statement1
--statement2
ex2)
PostLoop s do
--statement1
--statement2
Is it possible to define it ...
0
votes
0answers
9 views
algorithm2e with boxruled gives overfull hbox
I am using the algorithm2e package with the boxruled option to format my pseudo-code. However, I am getting an overfull hbox, which I suspect is due to margin/box conflicts.
Does anyone have a fix ...
3
votes
2answers
50 views
How to avoid printing the algorithm number in algorithm captions?
I am using the algorithm2e package to write algorithms. However, when i write three algorithms one after another, the algorithms are automatically numbered 1,2 and 3 in the caption. I am using ...
1
vote
0answers
43 views
Text Wrap with algorithm2e
I'm using algorithm2e for algorithms and for some of the longer algorithms, (eyeballed at > 50% of a page) there is no other text on the page with just an embarrassing amount of white space above and ...
0
votes
0answers
33 views
Left margin for boxed option in algorithm2e
When I am using the boxed option in algorithm2e package, the left margin between the box border and the algorithm is 0. Is there any way to adjust this?
The package has been included as following
...
4
votes
2answers
61 views
How to use Nameref with Algorithm2e
As the title suggests, I'm trying to reference to an algorithm created by algorithm2e package. Here is a MWE:
\documentclass[12pt,a4paper]{report}
\usepackage[linesnumbered]{algorithm2e}
...
3
votes
1answer
50 views
using standalone with algorithmicx or algorithm2e
I am trying to compile a standalone file containing pseudocode created with the algorithmicx package.
According to algorithmicx crashes standalone it should work with the preview option set for ...
6
votes
2answers
85 views
Problem with algorithm2e and portuguese option
I have this little algorithm with two For statements and one if-else. I'm using the option portuguese on the preamble and here's the problem: instead of displaying the words "faça" and "fim" (do and ...
0
votes
0answers
58 views
Colors in Pseudocode matlab style
How do I get colours and more control over spacing in the algorithmic package like this:
I tried this which looks good, but has numbers:
\begin{enumerate}
\item Create the cumulative sum of ...
2
votes
1answer
42 views
Restyling the caption in an algorithm created with algorithm2e
In the caption of an algorithm created with algorithm2e,
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\begin{document}
\begin{algorithm}[H]
\caption{Caption.}
pseudocode
...
7
votes
1answer
244 views
What is the best looking pseudo code package?
I have stumbled across various pseudo code packages but can't seem to find that's simple and eye-candy and practical.
What I'm looking for:
Visually attractive structure (eye-candy) ( easy to look ...
4
votes
1answer
44 views
Algorithm2e - Permanent fix for no italics if-clause
I am using algorithm2e to create pseudocode for my document. However, it has it so that the conditions in if clauses are italicised.
This solution suggests putting an \upshape in each if condition. ...
3
votes
1answer
46 views
Implementing indent in algorithm environment
I am using the algorithm environment in the algorithm2e package. What I want is to able to indent various portions. I tried \indent but that is doing me no good. Here is the MWE:
...
0
votes
0answers
53 views
The vertical line in algorithmicx [closed]
I'm trying to place a vertical line in the pseudo code in algorithmicx via algorithm2e. I found the solution Is it possible to have connecting loop lines (like algorithm2e) in algorithmic? :
...
4
votes
1answer
113 views
algorithm2e: Exclude functions from \listofalgorithms
I'm using the package algorithm2e and create a list of algorithms with \listofalgorithms. My problem is that not only the algorithms (algorithm), but also the functions (function) are displayed in the ...
2
votes
1answer
101 views
Disable line numbering of specific lines
Is there way how to turn off numbering of lines for specific line in algorithm2e? I need bold : after keyword. So I tried redefine these macros:
\renewcommand{\KwIn}[1]{\textbf{Input:} #1}
...
2
votes
1answer
111 views
Changing label name for algorithm
I have this algorithm:
\begin{algorithm}
\captionsetup[algorithm]{name=MegaAlgorithm}
\DontPrintSemicolon
\KwData{$G=(X,U)$ such that $G^{tc}$ is an order.}
\KwResult{$G’=(X,V)$ with $V\subseteq U$ ...
5
votes
1answer
102 views
algorithm2e and \algomargin with negative value
How can I use a negative length in \algomargin using algorithm2e? I get the unpleasant effect that the vertical lines and the caption are not moved accordingly, see for example:
Note that this ...
8
votes
3answers
140 views
algorithm2e + cleveref: problem with wrong reference to line numbers
For some reason I do not understand, cleverefproduces wrong references to line numbers of listings produces with the algorithm2e package. I hope that I did not miss a simple solution ...
My example ...
2
votes
1answer
91 views
No italics in algorithm2e if-clause
Why does algorithm2e typeset the variables anychange and done in italics, and how can I turn this off? How can I remove the semicolon after done in the until-clause?
$\textsf{anychange} \gets ...
2
votes
1answer
262 views
Subroutine in algorithm2e
I am looking for a tiny example of writing in algorithm2e an algorithm using a subroutine.
The algorithm is called algo, and it recursively calls a subroutine called proc.
It should be something like ...
2
votes
1answer
55 views
verbatim environment inside algorithm2e
I need to output prolog style inside algorithm2e and It seems that I cannot use \verb inside algo2e.
How can I use \verb or verbatim for only one line inside algorithm2e in Latex?
3
votes
1answer
263 views
algorithm2e and Beamer - How to make algorithms wider with smaller font?
I would like to make the algorithm2e environments wider in a beamer document. Indeed I must you a \scalebox to see all of my algorithm. Is there a way to have wider algorithms with smaller size font ...
2
votes
1answer
100 views
How to break lines in conditions using algorithm2e?
I am trying to (partially) reproduce the algorithm displayed in Figure 4 from NetFlow: Information Loss or Win?
My problem is with the multi-line conditions present in the "IFs". I want them to be ...
2
votes
1answer
263 views
Algorithm2e modify line numbers
I'm using the LaTeX algorithm2e package by defining
\usepackage[ruled, linesnumbered, vlined]{algorithm2e}
The linesnumbered argument adds lines numbers from [1,...,n] if we have an algorithm with ...
8
votes
2answers
171 views
algorithm2e noend option produces wrong label
I have a problem with the algorithm2e package. I want to reference the end of a block, e.g., a for-loop, in my text. Therefore, I place a label behind the closing bracket of the for statement. When I ...
0
votes
0answers
35 views
Non-breaking after semicolon in algorithm2e [closed]
given
$C_1[0] = P_1[0]$\;
$C_2[0] = P_2[0]$\;
it will be in two different lines.
i.e.
C_1[0] = P_1[0];
C_2[0] = P_2[0];
Is there a way to make it appears in one line
i.e.
C_1[0] = ...
3
votes
1answer
102 views
How to remove newline character after case statement in algorithm2e?
I don't want any newline character after case statement. How can I do that?
This is my code:
\begin{algorithm}[t]
\SetInd{0.5em}{0.5em}
\KwIn{Data $\mathsf{D}$}
\KwOut{List of Simple Hints}
...
0
votes
0answers
38 views
writing part of a pseudocode [duplicate]
I have a few pseudocode lines like
for each item in list L
if (item > 50)| (item > 50)|(item > 50)
value=item
break;
Obviously, this is not the exact code :). If I use a package ...
1
vote
1answer
66 views
How to change the order of algorithm number and name in algorithm2e?
I have to write an algorithm in Hungarian, where the caption must look like:
1.3. Algoritmus: caption of alg
instead of the usual style
Algorithm 1.3: caption of alg.
Until now I had no ...
1
vote
1answer
137 views
List of Algorithms header format [closed]
Does anyone know why the header of List of Algorithms is not equal to the format of List of Tables when both using with
\listoftables
or
\listofalgorithms
Here is a screenshot:
5
votes
1answer
974 views
How to adjust line numbers of algorithm2e package?
When using line numbers in the algorithm2e package, the line numbers are placed left of the text block, not directly below the text.
See page 5 of the algorithm2e manual.
Is it possible to place them ...
2
votes
1answer
88 views
Reduce the size of horizontal line
I want to reduce the size of horizontal line.
\begin{frame}
\restylealgo{boxed}
\begin{algorithm}[H]
\Setline
\nl i\;
\end{algorithm}
\end{frame}
4
votes
1answer
117 views
'List of Algorithms' title is not all in caps
In my dissertation, I have added a page for list of algorithms, using \listofalgorithms
command. However, the title of the page is not in all caps ('List Of Algorithms'), while it's supposed to be in ...
2
votes
1answer
138 views
Float positioning [ht] not working for algorithm
I am using the package algorithm2e.
I have a document with several algorithms. I use the float position option [ht], but all my algorithms are positioned at the end of the chapter; none at the ...
1
vote
1answer
115 views
Can not use float placement options with algorithm2e
I am using algorihtm2e and I am formatting a new command to align comments in the algorithms like in the answer of Align comments in algorithm with package algorithm2e.
Now when I try to use ...
3
votes
0answers
149 views
algorithm2e-like vertical lines for loops in listings package [closed]
Is there any way to set vertical lines for loops in pseudo-algorithms written with listings package, in an algorithm2e style?
As an example, see here: http://csweb.ucc.ie/~dongen/LAF/Algorithms.pdf
...
5
votes
0answers
48 views
Review of algorithm-related packages? [duplicate]
Possible Duplicate:
Print programs with its proper syntax
Where can I find (if it exists) an updated review of the most relevant packages for handling with algorithms (pseudocode or code ...
3
votes
1answer
518 views
Align comments in algorithm with package algorithm2e
I am using the package algorithm2e.
When using comments like this
\documentclass[11pt,a4paper,twoside,openright]{book}
\usepackage[algochapter,linesnumbered,ruled,lined,boxed]{algorithm2e}
...
1
vote
1answer
202 views
Remove chapter number on algorithm numbers (scrbook)
I write my bachelor thesis using a document class provided by our institute based on scrbook. I write pseudo-codes using algorithm2e which I put in the appendix since otherwise they would "interrupt" ...
3
votes
2answers
92 views
Referencing a line starting with a keyword in algorithm2e
I want to describe parts of an algorithm, by linking to specific lines. I found that the package algorithm2e is great for typesetting algorithms, and it seems it is also able to handle labels.
...
5
votes
1answer
859 views
multiple algorithm2e algorithms in two column documents
I tried this example Place four algorithms (algorithm2e) in a subfigure and arrange them in two rows and two columns on two column documents. It doesn't work. The error message is
! LaTeX Error: [H] ...
2
votes
1answer
204 views
algorithm2e - Unwanted vertical space
Last days I met a strange behavior with algorithm2e which produces an unwanted space after an IF-block.
I put here one MWE which shows that the problem really comes from my customization and not from ...
1
vote
0answers
276 views
Putting multiple algorithm2e procedures in figure
I want to put some algorithm2e procedures into a figure like:
\begin{figure}
\begin{procedure}
some code \;
\caption{abc (n).}
\end{procedure}
\begin{procedure}
some code \;
\caption{abc (n).}
...
1
vote
1answer
74 views
algorithm2e - Unwanted warnings when apply commands to content block
In this page, Andrew Swann points me a way to make verbose formatting of algorithms (I need this only for pedagogical reasons).
The problem with this solution is that it produces unwanted warnings ...
3
votes
1answer
848 views
algorithm2e - Apply commands to content block of IF … THEN … ELSE
In the following picture, I use a verbose but very pedagogical style for algorithms.
I would like to automatically use macros that act on the content of block like in the first example but with ...
4
votes
1answer
141 views
algorithm2e - Different ending words for switch and case blocks
In the following MWE, I would like the end of switch to be different from the ends of case and other. Is it possible ?
\documentclass{article}
\usepackage{algorithm2e}
\begin{document}
...
4
votes
1answer
407 views
Frame for pieces of algorithms
I would like to put frames around pieces of algorithms like in the following picture. If the background of the rectangle can be changed, it would be nice.
Here is the LaTeX code used for the ...
4
votes
2answers
163 views
Algorithm2e - Unwanted semi-colon
With the following code, I have an unwanted semi-colon at the end of the loop condition.
Here is MWE.
\documentclass{article}
\usepackage[lined]{algorithm2e}
\begin{document}
...
2
votes
1answer
247 views
algorithm2e and enumerate
I would like to put one algorithm inside one enumerated list like in the following code.
\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
...

