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

6
votes
1answer
88 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: ...
5
votes
1answer
266 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
93 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
215 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
63 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
295 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
167 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} ...
5
votes
1answer
173 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
175 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
35 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
368 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
0answers
105 views

Help in writing an algorithm in a customized way

I'm a newbie in LaTeX and while writing my thesis I come across a peculiar question. I want to write an algorithm which must look like the given below. Algorithm Do Step one(something ...
1
vote
1answer
100 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
88 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
211 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
188 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
19 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
117 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
360 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
122 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
567 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}% ...
2
votes
1answer
80 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
644 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:} ...
3
votes
0answers
86 views

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

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
228 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 ...
0
votes
0answers
115 views

Use both comment and algpseudocode packages simultaniously [closed]

I'd like to used both comment and algpseudocode packages in one document. But if I put them together I get: Command \Comment is already defined Is there some workaround? Is there alternative for ...
3
votes
1answer
83 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 ...
6
votes
1answer
373 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
80 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
507 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() ...
3
votes
2answers
1k 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 ...
5
votes
1answer
377 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 ...
5
votes
1answer
247 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: ...
8
votes
1answer
1k 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
297 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 ...
9
votes
2answers
596 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 ...
7
votes
2answers
759 views

Which package to use for writing algorithms?

I am looking for a package that will allow me to write pseudocode of algorithms. The pseudocode may include mathematical symbols, like \forall, \in and subscripts. But I would like also to "talk" ...
3
votes
1answer
237 views

How to get proof rules with pseudo-code in them?

I wish to typeset some deduction rules for Hoare logic as sequents with the pseudo-code using the algorithmic package. I have tried using \frac{}{}, but then e.g. if then else gets flattened. I have ...
1
vote
1answer
391 views

Using < > symbols inside algorithmic [duplicate]

Possible Duplicate: Why do the less than symbol (<) and the greater than symbol (>) appear wrong as upside down exclamation or question mark? I have the following code ...
5
votes
1answer
1k views

vertical space after algorithm

I am using the usual algorithm package for a paper. However, LaTeX puts too much vspace below algorithms. I have already reduced \floatsep, \textfloatsep and \intextsep but it does not seem to help. ...
3
votes
1answer
433 views

Pseudocode overflow out of column

I am writing pseudocode using the algorithmicx package in IEEEtran class (double column). My problem is, some of the statement in the code are quite long which I expected to wrap to next line. ...
2
votes
1answer
666 views

label in algorithmic

if I have this code \begin{algorithm} \label{alg:the_alg} \begin{algorithmic}[1] \STATE operation 0 \STATE operation 1 \end{algorithmic} \end{algorithm} I can make a reference to ...
1
vote
1answer
251 views

Algorithmic package for loop and comment at the same line

I want to have the following output using algorithmic package: for i = 1 : z do // number of rows x = 1 end for I use the following tex code: \begin{algorithmic} \FOR{$p=1:r$} // number of ...
4
votes
1answer
607 views

put two algorithm side by side

I want to put two algorithm side by side to gain place in the document, but when I use \documentclass{llncs} instead of \documentclass{article}, the following code does not work (errors): ...
3
votes
1answer
610 views

How to insert algorithm inside multicols environment [duplicate]

Possible Duplicate: Placing figures inside a two-column document Here is my MWE: \documentclass{article} \usepackage{multicol} \usepackage{algorithm} \usepackage{algpseudocode} ...
4
votes
1answer
293 views

Formatting algorithms to gain place in the document

I have two algorithms in a latex document using a class document of one column. The first algorithm take almost one page, and the second one is on the next page. Is there ant way to format this to ...
4
votes
1answer
508 views

Translate “Algorithm” in the caption

This is my code \begin{algorithm} \caption{Funkcija ACO} \label{alg:aco} \begin{algorithmic} \STATE{do something} \end{algorithmic} \end{algorithm} it produces a caption like this ...
0
votes
0answers
27 views

How can i put an algorithm and an image side by side? [duplicate]

Possible Duplicate: How to put algorithm and figure(s) side by side? I have an algorithm and an image. How can i put them side by side?
2
votes
0answers
225 views

Drawing to indicate algorithms [closed]

I'm looking for one good drawing so as to symbolise algorithms. The idea is to use this drawing like one symbolic icon. Have you some ideas ?
4
votes
1answer
1k views

Algorithm Caption

I want algorithm to NOT show the number in caption. How can i do that? Below is the code: \begin{algorithm} \begin{algorithmic} \caption{ My Algorithm} \IF \ELSE \end{algorithmic} \end{algorithm} ...