{algorithms} is about the presentation, numbering, and layout of algorithms or pseudocode in documents. Popular packages are algorithms, {algorithmicx}, {algorithm2e} and {listings}. For questions about the specific package, use the appropriate tag instead.

learn more… | top users | synonyms (1)

2
votes
1answer
636 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
803 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
545 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
4k 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
234 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?
3
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 ...
7
votes
1answer
258 views

Typesetting listofalgorithms like listoffigures and listoftables using titletoc

I would like to typeset the \listofalgorithms generated by package algorithm in the same way than the \listoffigures and \listoftables, using package titletoc. However, I have not been able to find a ...
5
votes
1answer
178 views

How to make the line number in algorithm shown in bold

I have tried following which works (making the number in second line bold) \begin{algorithm}[h] \begin{algorithmic}[1] \State TSO.assignStartTs() {\bf\State} TSO.assignCommitTs() \end{algorithmic} ...
2
votes
2answers
467 views

How to reformat Algorithm in memoir document class?

I'm trying to typeset algorithms in the memoir class. I'm using the algorithmic package with a custom environment as this was the only way I could get the list of algorithm to display correctly in the ...
2
votes
1answer
1k views

Make List of Algorithms formatting match LOT/LOF

I'm working on my thesis, and I have a minor formatting problem with my list of algorithms. The entry is added properly in the TOC and the font, size dotting and numbering are perfect, but for some ...
3
votes
1answer
548 views

Line number error using “Require” and “Ensure” in package{algorithmicx}

I’m using the packages algorithmicx and algpseudocode to write algorithms in my paper. It’s more convenient and beautiful to specify comments than with the algorithmic. But I encounter an error while ...
3
votes
1answer
358 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} ...
4
votes
2answers
450 views

How to remove “Algorithm #” caption prefix but keep list of algorithms?

I am using the algorithm-package and would like to name my algorithms without any generated prefix. So I would like to remove "Algorithm #" as prefix from my caption, but still keep the list of ...
0
votes
0answers
41 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 ...
4
votes
1answer
416 views

Add the word “Algorithm” before each entry in the List of Algorithms

I'm trying to add the word "Algorithm" before each entry in the List of Algorithms (because of unavoidable thesis guidelines). I saw similar questions but the solutions listed there don't work for ...
3
votes
1answer
744 views

Problem with algorithm(ic) and hyperref

The following code works ... fine! \documentclass{book} % \usepackage{subfig} % \usepackage{subcaption} \usepackage[colorlinks]{hyperref} \usepackage{algorithm} \usepackage[noend]{algorithmic} ...
2
votes
0answers
112 views

Custom text instead of line numbers in algorithmic

In an algorithm using the algorithmic package, I would like to display for some lines a special symbol (e.g. a +), instead of their line number. Is this possible? Edit: Here's a minimal working ...
3
votes
2answers
133 views

How to define the following symbol to stock one element in one list?

I'm looking for one symbol to indicate that a value is stocked in one list. On way would be to use something like myList.append(myValue) but it os not very quick to see and to write. Indeed, I would ...
1
vote
1answer
269 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:
8
votes
1answer
541 views

The line spacing in the list of algorithms

This is my code: \documentclass[12pt,a4paper]{book} \usepackage[T1]{fontenc} \usepackage[chapter]{algorithm} \renewcommand{\baselinestretch}{1.5} \begin{document} \begin{spacing}{1.2} ...
2
votes
0answers
141 views

Divide algorithm inside If EndIf

This is a follow-up question to Option in the algorithm with Latex. This is the code: \begin{document} \begin{algorithm} \caption{My algorithme} \begin{algorithmic}[1] \Donnees: My data ...
4
votes
1answer
2k views

Modify Algorithm name in French

This is my code: \usepackage[section]{algorithm} \usepackage{algorithmic} \begin{document} \makeatletter\renewcommand{\ALG@name}{Algorithme} \renewcommand{\listalgorithmname}{Liste des \ALG@name ...
1
vote
1answer
650 views

Divide an algorithm on two pages

\usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm}[H] \caption{My algo} \begin{algorithmic}[1] \STATE instruction 1 \STATE instruction 2 ......................Many ...
2
votes
1answer
1k views

How to modify line spacing in algorithm / algpseudocode?

I want to increase line spacing between statements in algorithm environment. I used the setspace package as here, but it also affects the space between line breaks that is not wanted. The following is ...
4
votes
1answer
799 views

Slight change in algorithm

This is my MWE for an algorithm however its throwing an error and I don't know how to get inputs and initialize. I want it to look like the attached image. ...
1
vote
0answers
669 views

Algorithm spanning two columns error with \prevdepth [closed]

I am trying to use the algorithm command to display an algorithm that spans two columns in a two column document. However, I am getting an error message with \prevdepth that I do not understand. Below ...
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 ...
7
votes
2answers
3k views

Commands argmin and argmax in algorithm

I am trying to use the argmin and the argmax commands that I defined in an algorithm but I keep getting the argument not in the middle but on the right. Does anyone have an idea how to put the ...
0
votes
1answer
1k views

Algorithm in LaTeX

I wrote the following algorithm, however its not compiling and throws a few errors. I am not sure of what I did wrong. Any help would be appreciated. \begin{algorithm} \caption{Bridging ...
7
votes
1answer
1k views

algorithmic, arbitrary names for algorithms

The question is advanced version of my previous one. I need to name algorithms (package algorithmic) with arbitrary names so it appears like: Algorithm MyAlgo and \ref{...} will appear like MyAlgo. ...
2
votes
1answer
191 views

algorithmic package, get rid of algorithms numbers

My question is about algorithmic package. I have an algorithm which I called A1. \begin{algorithm} \caption{\bf A1:} \label{algorithm-A1} ... I have something like this: Algorithm 1 A1 How can ...
5
votes
1answer
2k views

Add algorithm label to list of algorithms

I'm using the classicthesis package along with the algorithmic package. I'm trying to get the list of algorithms to look the same as the list of figures/tables etc., but cant find a way to make it ...
6
votes
1answer
203 views

How to prevent indent on \listofalgorithms?

How can I prevent the \listofalgorithms from being indented? I tried everything I could find on the internet, but the index of my algorithms refused to be aligned along with the title. Here is a MWE: ...
6
votes
1answer
1k views

Line numbering in algorithmic

I want to change the first number of the line numbering in my algorithm, but how is it done? This is my example: \documentclass[12pt]{beamer} \usepackage{amsmath, amsfonts, amssymb, amsthm} ...
5
votes
2answers
180 views

3 Algorithms in the same column with algorithmic

I have 3 algorithms that I want to be displayed in the same column of a 2-column document. They are all slight variations of each other, so it is important that they be displayed right next to each ...
3
votes
1answer
825 views

Undefined control sequence when adding math comment to \WHILE

I'm pretty new to (La)TeX so please forgive me if this question is stupid :) I have an algorithm that is typeset with the algorithm and algorithmic packages. Then I have this in the algorithm: ...
1
vote
0answers
118 views

Package algorithmic [closed]

So my problem is whenever I try to use the algorthmic package, it gives me an error related to citations! And when I comment out the algorithmic block, everything works fine. I read somewhere that ...
5
votes
2answers
886 views

Can't manage to use algorithm packages

I'm trying to write some simple pseudocode but I just can't get it to work. It's pseudocode from another paper and I want to change it a little and put it in my paper. This is the pseudocode I want ...
1
vote
1answer
331 views

Add line before Begin algorithm 'Début' [closed]

This is a follow-up question to Option in the algorithm with Latex. This is my algorithm: \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm}[H] \caption{My algo} ...
7
votes
1answer
600 views

How to localize label using algorithm and algorithmic packages

I am writing a paper in Italian and I need to include pseudo code in my latex document so I am currently using the algorithm and algorithmic packages. At the top of every algorithm the label Algorithm ...
5
votes
2answers
440 views

Phantom malfunction in algorithm caption

I am trying to use \phantom in the context of an algorithm caption. I am using the algorithm and algorithmic packages. \phantom will work properly in normal text in my document, but not in a caption. ...
0
votes
0answers
38 views

Increase the indent in an algorithm [duplicate]

Possible Duplicate: Indenting lines of code in algorithm This is my algorithm: \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm}[H] \caption{My algo} ...
3
votes
1answer
2k views

Option in the algorithm with Latex

This is my algorithm: \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm}[H] \caption{My algo} \begin{algorithmic}[1] \STATE instruction 1 \STATE instruction 2 ...
1
vote
1answer
209 views

The option vlined with algorithm

Please i ask if it's possible to add the option: [vlined] withe the package \usepackage{algorithm} \usepackage{algorithmic} This is my example: \usepackage{algorithm} ...
1
vote
1answer
606 views

Increase Spacing in an algorithm

Please, how can i increase spacing in an algorithm, between instruction 1 et instruction 2 ? \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm}[H] \caption{My ...
5
votes
1answer
768 views

Package Algorithmic in French

I use \usepackage[section]{algorithm} \usepackage{algorithmic} to create an algorithm, I'd like to change "algorithm, begin, end while ..." to French. Is that possible? This is my example with ...
2
votes
1answer
255 views

Package algorithm to use

Please, what package can i use in latex to have the model of algorithm in the figure ?
1
vote
0answers
20 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 ...
4
votes
1answer
203 views

Floatrow package causing missing algorithm lines

Hi I started using floatrow and noticed that it is breaking functionality of my algorithm code, both the algorithm header and footer have disappeared. Here is a picture of before and after: Here ...
3
votes
1answer
779 views

Generating a box inside algorithm in beamer

I would like to create two boxes (or two frames) and one arrow which goes from the center of right side of one box and do half a circle and point on the other box. Below is an example of code: ...