{algorithmicx} provides an improved typesetting environment for algorithmic pseudocode. It is compatible with the algorithms bundle that provides the algorithm and algorithmic environment for typesetting floating {algorithms}.

learn more… | top users | synonyms

4
votes
1answer
88 views

algpseudocode side effect

All tables in my document seem to be affected after I've started using package algpseudocode. Pretty much every table now always starts with two additional lines. These lines are utilized properly ...
4
votes
1answer
167 views

acmsmall breaks line number alignments of algorithms

I am formatting an article with one of the ACM journal formats: acmsmall. However, when I look at algorithms, I noticed that the lines of my algorithm lost their indentation. This problem does not ...
1
vote
1answer
65 views

algorithmic, referring using the name and inputs

I'm using the algorithmicx package, but I would like my algorithm to look like: Algorithm My Algo $(\lambda,\beta)$ i.e., the algorithm should accept inputs as shown. I then want refer to this ...
3
votes
1answer
1k views

Problem with algorithmicx: perhaps a missing \item. What's wrong?

I'm trying to write simple pseudocodes using package algorithmicx in TexWorks 0.4.4 and MiKTex 2.9 on Windows 7 but I get this error: ! LaTeX Error: Something's wrong--perhaps a missing \item. See ...
4
votes
1answer
217 views

Indentation of continued lines in algorithmicx

Trying to get the indentation right within the algorithmic environment I run into trouble, and all the solutions posted so far have not been able to solve my problem as I'd like to see it solved. I ...
6
votes
1answer
9k views

do-while loop in pseudo code

The algorithmic package lets me make a while loop as \begin{algorithmic} \While{$u\neq v$} \State Something \EndWhile \end{algorithmic} which results in a while(u is not v) do ...
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 ...
1
vote
1answer
139 views

Algorithms in mdframed

Now that I converted all my theorems to mdframed, I'd like a consistent layout for my algorithms as well? What ways are there to typeset pseudocode algorithms in mdframed? So far I've been using ...
3
votes
1answer
1k views

cleveref fails to reference algorithms

In the following example document, both \autoref and plain ref will correctly link and number an algorithm reference, but cleveref fails that task. It will just insert question marks instead. In ...
5
votes
2answers
1k views

Caption numbering breaking up an algorithm with algorithmicx

According to its documentation, algorithmicx package allows break up an algorithm inside a document, as follows: Related tex code is: \documentclass{article} \usepackage{algorithm} ...
2
votes
1answer
208 views

Line break inside procedure's definition with algorithmicx

I don't know if this package is the best for my purpose, but I'm using algorithmicx (see here the documentation) to write algorithms (in pseudcode) inside my work. At now, I've just a problem: ...
4
votes
2answers
634 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 ...
7
votes
2answers
265 views

Indentation in the algorithm package after \Ensure, \Require

I have this piece of code: \documentclass[11pt]{article} \usepackage{algorithm} \usepackage{algpseudocode} \usepackage{varwidth} \begin{document} \begin{algorithmic} \Require ...
2
votes
1answer
457 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 ...
4
votes
1answer
1k views

Ploblems with vertical lines in algorithmicx

I use algorithmicx with verical lines. And code is working good: \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} % Vertical line \makeatletter ...
6
votes
1answer
1k views

Numbering in algorithmicx

I have simple code: \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Examples}\label{alg:Examples} \begin{algorithmic}[1] ...
2
votes
1answer
67 views

Problem with the block with the word wrap in algorithmicx

For a good word wrap, I use this code in algorithmicx: \parbox[t]{\dimexpr\linewidth-\algorithmicindent}{<text>\strut} But when the code contains several nested structure leaves a block of ...
2
votes
1answer
9k views

ELSE IF in algoritmic package

Is there a command in algorithmic package which is similar to \ElsIf in algorithmicx? ( I do not want each nested if to be indented).
5
votes
1answer
230 views

Renaming while loop in package algorithm

How do I rename the While loop using algorithm and algpseudocode? \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm*} \caption{bar baz} ...
1
vote
0answers
185 views

Algorithmic: file ended while scanning definition of \ALG\typeout [closed]

I m trying to the given code given in here: Algorithm and IEEEtran, or some other examples. by \usepackage{algpseudocode}. But I am getting this error: ./algpseudocode.sty:12: file ended while ...
3
votes
1answer
636 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 ...
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 ...
6
votes
2answers
10k views

Algorithm with Latex ( Package algorithmicx)

This is my algorithm: \usepackage{graphicx} \usepackage[linesnumbered,ruled,vlined]{algorithm2e} \usepackage{algorithmicx} \usepackage{algpseudocode} %\usepackage{algorithmic} ...
3
votes
1answer
259 views

Align pseudocode comments to the left

Writing comments in pseudocode, I wanted to insert comments which are not aligned to the right side of the line which is commented. This thread helped me a lot. However, I want comments to stand ...
3
votes
1answer
272 views

algorithmicx, broken left align with custom numbering

I am trying to use the algorithmic package with Step1. Step2. instead of 1, 2, ... line numbering and I have numberless lines. An example: \documentclass[11 pt]{report} \usepackage{algorithm} ...
2
votes
1answer
1k views

Error compiling algpseudocode example

Compiling this piece of code (which I took from the guide of the algorithmicx package) I get a lot of errors and do not understand why. I think it is probably some stupid typo I can't see but this is ...
3
votes
1answer
664 views

Change line numbering in algorithmics package

I would like to start the line numbering of the following code not from 1 but from 12 (as it is cut out of a larger code). So it should be 12,13,14,15 instead of 1,2,3,4. \documentclass{article} ...
2
votes
0answers
152 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
358 views

How to rename command to avoid double defined command names

Hy, I would like to use the packages vaucanson and algorithm. \documentclass[11pt,a4paper,twoside,openright]{book} \usepackage{algorithm} \usepackage[noend]{algpseudocode} \usepackage{vaucanson-g} ...
4
votes
1answer
911 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. ...
5
votes
1answer
139 views

Error using amsart with algorithmic[x]

I use the algorithm and algorithmicx packages to type algorithms in a paper and my main document class is amsart. All is well until I try to use \listofalgorithms. This returns a variety of error ...
2
votes
1answer
752 views

Algorithmcx and array representation

I'm using package algorithmcx and algpseudocode to describe an algorithm in a paper. Each function in the algorithm receive an array/list of numerical values, e.g. {x1, x2, ..., xn}. ...
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 ...
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 ...
2
votes
1answer
548 views

Remove line numbering from algorithmicx procedure/function

I would like the lines of "procedure" and "end procedure", "function", and "end function" etc to not be numbered. For example, the default behavior produces this: 1 procedure hasNext(v,V,s) 2 ...
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
3answers
2k views

Forced indentation in algorithmicx

I have an algorithm dealing with some very large parameter names, messing up the readability. What I've done so far is break the lines of the problematic statement (lines 4-5) manually into two ...
0
votes
1answer
189 views

How to get Roman line numbering in algorithmicx? What is the counter name?

I try to get Roman numbering but couldn't find how to change it in the package documentation. After some research, I figured out how to do it using the algorithm2e package. (Use algonl as optional ...
2
votes
2answers
2k views

MacPorts: install packages for use in Texmaker

I'm using Texmaker and want to install the package algorithmicx to write some pseudocode. I've tried using MacPorts to download and install the package but I can't seem to load it in Texmaker or in ...
6
votes
1answer
2k views

algorithmicx package comments on a single line

Is it possible in algorithmicx package to have comments not aligned to the right side? For example I have code like this - \begin{algorithm}[!ht] \caption{My Algo.} \label{myalgo} ...
6
votes
1answer
1k views

How to make lstlisting look exactly like the algorithm environment?

I'm typesetting pseudocode with algorithm and algorithmicx to get results like the following (taken from the package documentation): Now I would like to print real C++ code with the listings ...
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}% ...
6
votes
1answer
1k views

Avoid putting statements on the same line with algorithmicx

I'm writing a simple pseudocode, but I have a problem with a repeat..until block. Basically what happens is that the return statement that follows the end of this loop gets rendered on the same line ...
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} ...
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
5k 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
1k views

Function arguments in algorithmicx

I have a question about function arguments in the algorithmicx package. The following code works: \documentclass{article} \usepackage{algpseudocode} \usepackage{algorithm} \begin{document} ...
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
852 views

Colored line numbers with algorithmicx?

The fancyvrb allows me to customize line number style which I find very useful. I'm using it to give line numbers a different color and then use that same color in the text describing the code. I ...
12
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 ...