3
votes
1answer
31 views

Make listofalgorithms (algorithm2e) inside a section instead of chapter

I'm writing my thesis and I have a few algorithms (using algorithm2e) that I want to list in my appendix, but I don't want to start a new page. Also my listoffigures currently creates a section, not a ...
2
votes
2answers
40 views

Missing $ inserted. <inserted text> on a math algorithm

I've made the following pseudocode: \documentclass[]{article} \usepackage[]{algorithm2e} \begin{document} \title{Title} \author{Author} \date{Today} \maketitle \begin{algorithm}[H] pseudoalgoritmo ...
3
votes
2answers
50 views

break an long line in an algorithm

I have a long line in an algorithm and want to break it into two lines. For similar case in equations, split can be used. How do I do this within an algorithm? \documentclass{article} ...
1
vote
0answers
36 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
51 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 ...
3
votes
1answer
33 views

Algorithms disappear when I use multicols

This is my code: \documentclass[11pt]{llncs} \usepackage[utf8]{inputenc} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{dsfont} \usepackage{multicol} \usepackage{fixltx2e} ...
1
vote
0answers
76 views

How to convert latex algorithm2e into msword format [closed]

I need to write below latex algorithm using windows words, How I can do that? \documentclass{article} \usepackage[linesnumbered,ruled,vlined]{algorithm2e}% http://ctan.org/pkg/algorithm2e ...
3
votes
0answers
90 views

Object-oriented class typesetting? [closed]

I am looking for a way to beautifully typeset an OO class like : classname { properties: prop1 : integer prop2 : Node methods: someMethod() } With the look ...
0
votes
0answers
36 views

What´s the easy way to put algorithms? [duplicate]

I was trying with algorithm2e , and I had a little problems, LATEX is so complicated and so tedious. The results are excelent, but... the time and effort is BIG BIG! What´s the easy way to describe ...
2
votes
0answers
58 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} ...
5
votes
1answer
128 views

How to reduce indentation size within loop of an algorithm

For the following algorithm, I get four spaces for each text line inside the loop. How can I get only two or three spaces? Some of my text lines go to next line. I want to save some horizontal spaces. ...
3
votes
1answer
912 views

algorithm2e comment style

I wanted to know how to change the comment style in the algorithm2e package. I want to make my comments of a smaller font and a different color: \documentclass{article} \usepackage{color} ...
6
votes
1answer
989 views

Algorithm: write if-then-return or else-return in one line?

I can easily generate the following algorithm statements using algorithm2e package. As can be seen from the image, return statement (should hold for other statements too) will be placed in a new line ...
4
votes
1answer
59 views

How to make a hbox several lines under the specified place?

Recently I asked How to colourfuly highlight some lines of an algorithm using algorithm2e? I wanted to acheive this effect using the algorithm2e package: Thanks to JLDiaz's answer I know how to do ...
2
votes
1answer
299 views

How can I colourfuly highlight some lines of an algorithm using algorithm2e?

I am trying to achieve something like this: This image is linked from this answer. This answer also provides a solution and seems simpler. Both answers deal with the algorithmicx package however. ...
2
votes
1answer
130 views

PDF reference links when using hyperref and (`ruled`) algorithm2e

I was testing some links within my produced PDF file and recognized that all of the links to an algorithm (from the algorithm2e package) will jump to the beginning of the algorithm with skipping half ...
3
votes
1answer
325 views

Algorithm2e does not allow nested if

I was trying to put a nested if in algorithm area like this: \If{$isContentMethod(\mathcal{M})$}{ $URI \leftarrow getURI(SubCG, \mathcal{M})$\; \If($URI \in ...
8
votes
1answer
988 views

How to use the algorithm2e package with IEEEtran class?

The IEEEtran documentation suggests that I should not use the floating algorithm environment of algorithm2e.sty. B. Algorithms IEEE publications use the figure environment to contain ...
1
vote
0answers
23 views

How to use dotted line to make indentation clearer in algorithmicx? [duplicate]

I wish to indicate clearly when a block starts and ends with "enclosing lines" in addition to the indentation. I understand that I can do it with algorithm2e like so \begin{algorithm}[H] \SetLine % ...
3
votes
2answers
435 views

How to align text within an algorithm environment?

I wish to duplicate an effect I've seen elsewhere (image below) in which text not necessarily at the beginning of a line is aligned with text elsewhere. I don't know which environment is suitable, ...
6
votes
2answers
996 views

How to see the Steps number in an algorithm

In below algorithm I have used the package \usepackage[linesnumbered,ruled,vlined]{algorithm2e} 1) How do I see steps number after step 2? 2) Is there any command apart from ...
7
votes
2answers
7k views

How do remove equation number in an algorithm

Here is the code. Even I have used the command \nonumber still I can see the equation number \begin{document} \begin{algorithm} \DontPrintSemicolon % Some LaTeX compilers require you to use ...
1
vote
1answer
86 views

How to exclude some algorithms for \listofalgorithms

I tried with \captionsetup{list=no} but it doesn't work for the algorithm listing. Any ideas? I am splitting alg. over several pages using algorithm2e and don't want the captions of the split ...
7
votes
2answers
2k views

algorithm2e Command \algorithm already defined

I want to draw vertical line by using \SetAlgoLined, but LaTeX told me Undefined control sequence. Then I add \usepackage{algorithm2e} to the end of my preamble. Then it said Command\algorithmalready ...
3
votes
1answer
93 views

Indentation missing for algorithm package in documentclass{minimal}

I am trying to get write an algorithm in LaTeX for minimal document class. Unfortunately, the indentation is completely missing. Following is my sample code: \documentclass{minimal} ...
1
vote
1answer
102 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 ...
4
votes
2answers
572 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 ...
8
votes
1answer
4k 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 ...
3
votes
1answer
312 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: ...
2
votes
1answer
730 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} ...
5
votes
1answer
899 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 ...
2
votes
1answer
615 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 ...
3
votes
1answer
5k 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 ...
3
votes
1answer
263 views

verbatim environment inside algorithm2e

I need to output Prolog style inside algorithm2e and It seems that I cannot use \verb inside algorithm2e. How can I use \verb or verbatim for only one line inside algorithm2e in Latex?
4
votes
1answer
4k 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 ...
3
votes
1answer
394 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
42 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
284 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
0answers
55 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 ...
1
vote
0answers
21 views

Translate the caption label “algorithm” in algorithm2e [duplicate]

Possible Duplicate: Renaming Algorithm to Heuristic in algorithm2e package i want to get the caption label "algorithm" translated into my language, so that the caption is like: Algorithmus ...
13
votes
1answer
2k views

Is it possible to have connecting loop lines (like algorithm2e) in algorithmic?

I am using the algorithmic package to typeset an algorithm. I would like to have connecting lines between the beginning and end of a loop or conditional like in the algorithm2e package. Is there an ...
11
votes
2answers
2k views

How can I put a curly brace inside an algorithm to group code lines?

I am using the algorithmic package (or even algorithm2e is fine). Is it possible to use curly braces to group some lines in the algorithm so as to be able to put an explanation to the right?
6
votes
2answers
3k views

How to typeset gotos and labels using LaTeX pseudocode environments?

Is there any way to typeset gotos and labels using LaTeX pseudocode environments (algorithmic, pseudocode, clrscode, algorithm2e, etc.)? Automatic and correct indentation of labels would also be ...
2
votes
1answer
332 views

What environment to use in writing functions

I am beginner of LaTeX, and wondering how to write functions or procedures in pseudocode. Is there any existing environment for that?
7
votes
1answer
3k views

Renaming Algorithm to Heuristic in algorithm2e package

I am trying to write some heuristics for a problem using the algorithm2e package. However as you may know, when you write : \begin{algorithm} \caption{Heuristic 1: Name of Heuristic} ... ...
11
votes
1answer
1k views

cleveref and algorithm2e

I'm currently working on a document where I was using algorithm+algorithmic along with cleveref. With this everything worked perfectly. Now I had to replace algorithm+algorithmic with algorithm2e. ...