Tagged Questions

{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)

3
votes
0answers
125 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
138 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
291 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
607 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
157 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
970 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
1k 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
822 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
4k 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
222 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 ...
8
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
219 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: ...
7
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
209 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
963 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
136 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
1k 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
378 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
721 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
505 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
233 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
767 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
931 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
265 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
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 ...
4
votes
1answer
218 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
893 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: ...
2
votes
0answers
279 views

\caption* does not work properly [closed]

I have a problem with using the command \caption* (from the caption package) together with the algorithm environment. Instead of parsing the \caption* as a single command, it is parsed like \caption ...
2
votes
1answer
1k views

Writing Pseudocode in LaTeX

I cannot seem to get any of the LaTeX pseudocode packages to work correctly on my computer. For example, if I run this block of code: \documentclass{article} \usepackage{algorithm}% ...
3
votes
1answer
191 views

Add label/link to a line of an algorithm

I am using the algorithmic package to write algorithms. I want to have a link to the line of the algorithm like I can do to formulas using \label and \ref.
5
votes
1answer
4k views

Indenting lines of code in algorithm

I am writting algorithm which has two stages. How can I indent code for stage one and for stage two? \begin{algorithm}[H] \caption*{my algorithm} \begin{algorithmic} \STATE \textbf{Stage one:} ...
2
votes
0answers
123 views

Is there an algorithm to determine the best layout and font size for a specific screen? [closed]

If I have a 4:3 7" tablet with a 200PPI screen (as an example), could you algorithmically make a TeX template that would be readable on the screen fullsize without zooming? It would be great if there ...
4
votes
2answers
708 views

program package ! Extra }, or forgotten \endgroup

I took the STY files(elsarticle.zip) from the following link - http://www.elsevier.com/wps/find/authorsview.authors/elsarticle#models I am using program package and I want to include the keywords in ...
3
votes
1answer
150 views

Runaway argument in algorithm

\begin{algorithm} \caption{Partial Sum Update Algorithm}\label{alg:usline} \begin{algorithmic}[1] \State $\mathcal{N}^*\gets$ bitreverse$(\mathcal{N})$ \If{$i(s)=0$}\Comment{The $s^{th}$ LSB in the ...
8
votes
1answer
2k views

Adjust the indentation whithin the algorithmicx-package when a line is broken

I have this code \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Minimal Working Example for my Problem} ...
1
vote
1answer
110 views

Order of `float` and `caption` packages in preamble

I am using float and caption packages in my document, and also packages like tabularx, listings, algorithm... that (as far as I know) define floating elements or elements that have captions ...
2
votes
1answer
3k views

Functions with no parameters in algorithmicx

I am trying to write an algorithm using algorithmicxand I need to put a function with no parameters. I use \Function {foo}{} latex produces: function FOO However I need: function FOO() ...
4
votes
2answers
6k views

customizing the algorithmic package: break and loop labels

I would like to add two customizations to the algorithmic package: introduce a new break command and have the possibility to provide labels to the LOOP so that break {label} is clear to which loop is ...
6
votes
1answer
2k views

Creating sub-algorithms in latex using the algorithm package

I want to do something like this (see image below) where I can describe my algorithm in smaller steps or "phases" as this person calls them. I've used the algorithm and algorithmic package before but ...
6
votes
1answer
559 views

Reference algorithmic line numbers using cleveref

consider the following example: \documentclass[a4paper,final]{report} \usepackage{cleveref} \usepackage{algorithmic} \Crefname{ALC@unique}{Line}{Lines} \begin{document} Tests: ...
11
votes
1answer
5k views

algorithm numbering

I am having trouble numbering and referencing algorithms. I want to have the references labeled by the chapter, then within the chapter, such as: First algorithm in chapter 1 - Algorithm 1.1 ...
5
votes
1answer
4k views

How to change listing caption?

I have some listings that contain pseudo-code of algorithms. And I use this: \lstset{caption={Descriptive Caption Text},label=DescriptiveLabel} to add captions to them. My problem is that the ...
13
votes
2answers
1k views

Coloring lines in an algorithm

I am using Beamer for creating a presentation and I am trying to highlight some lines in an algorithm. I am actually using algcompatible. I found a solution here and created a couple of new commands ...