{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
2answers
34 views

Algorithms in Two columns not allowing text to the side

I'm typesetting a two column document with an algorithm as a figure. The algorithm is in the left hand column, but nothing appears in the right hand column, which wastes space. My working example is ...
0
votes
0answers
13 views

how to align one sentence if it is too long when using algorithmic package [duplicate]

I am using the algorithmic package to program the pseudocode in latex. But there is a problem. If one \State is too long, the sentence will be aligned to the left. It looks ugly. See this figure. ...
4
votes
2answers
240 views

Algorithm not showing the end loop statement

I'm using algorithm package for writing algorithms. I'm using following code for generating a loop \begin{algorithm} \caption{My algorithm}\label{alg:myalgo} \begin{algorithmic}[1] ...
1
vote
1answer
21 views

Breaking up an algorithm into several parts

I would to divide an algorithm I wrote into parts as shown in the attached file This is what I did so far : \begin{algorithm} \caption{Selection algorithm} \label{mpral} \begin{algorithmic}[1] ...
7
votes
1answer
221 views

Writing an algorithm in LaTeX

I am trying to write an algorithm in LaTeX. I used a for loop inside the algorithm (see attached image), but the problem is that the statements that are below the for loop are not tapped. Why? I ...
2
votes
1answer
41 views

Different numbering for algorithms and procedures

I am using algorithmicx package in LaTeX to write an algorithm and a procedure in my LaTeX file. I want LaTeX to number the procedures differently, but the numbering is the same as algorithms. Is ...
4
votes
2answers
51 views

Algorithms LaTeX \EndForAll and “Some Blocks are not closed!!!”

I'm new to the algorithm package in LaTeX and need help figuring out how to debug my MWE below, which gives six errors. It look complicated, but half the errors are the same thing and in one case I'm ...
2
votes
1answer
23 views

Forcing a newline in the algpseudocode package

I have written the following pseudocode: \begin{algorithm} \caption{Check if any player has won.} \begin{algorithmic}[1] \Procedure{isWin}{$Game$} \ForAll{$seq \in \Call{getWinSeqs}{Game}$} ...
0
votes
0answers
26 views

How to solve the problem in the “algorithm” environment

\documentclass[conference]{IEEEtran} \usepackage{algpseudocode} \usepackage{algorithmicx} ............. \begin{algorithm}[h] \caption{Iterations for risk-sensitive cost} \begin{algorithmic} ...
0
votes
0answers
78 views

how to use \algsetup in latex environment

I am using the "algorithmic" environment and want to use \algsetup. But getting an error. \documentclass{article} \usepackage{algpseudocode} \usepackage{algorithmic} \usepackage{float} ...
2
votes
2answers
66 views

Complicated Pseudocode in Latex - Need assistance

I am trying to create a complicated pseudocode as shown below: My attempt: \documentclass{article} \usepackage{algorithm}% http://ctan.org/pkg/algorithm \usepackage{algpseudocode}% ...
0
votes
1answer
42 views

Package algorithmicx choking on line numbers

I'm trying to compile the code from this answer: http://tex.stackexchange.com/a/1376/35161 I keep getting the following error: ! Undefined control sequence. \ALG@cmd@2@alglinenumber ...size ...
0
votes
0answers
15 views

Change the size of algorithm enviroment

I used \algsetup{linenosize=\small} command to scale the size of algorithm environment, but it seems doesn't work! How can I do that?
5
votes
1answer
193 views

How can I typeset function names as they appear in algorithmic environments?

I'm using the algorithmicx package and I'd like to mention a function in common text. Is there a way to do that, or do I have to make a format that mimics the one used in the algorithm (all caps ...
3
votes
1answer
96 views

How to have the algorithmicx comment symbol in algorithm2e?

I want to know how can I have the nice ▷ $\triangleright$ comment symbol of algorithmicx in algorithm2e?
1
vote
0answers
60 views

Trouble creating custom algorithm environment with separate counter

I am trying to create a custom algorithm environment for CUDA kernel code that runs on the GPU, but have little experience with custom LaTeX. It should have a separate counter, be referenced as Kernel ...
4
votes
1answer
58 views

How to wrap lines correctly inside algorithmic

I am having problems displaying algorithms. The wrapping is really ugly and I can't, for the life of me, find a fix that doesn't involve manually tweaking the hell out of everything, to the point that ...
4
votes
1answer
152 views

How to define frequently used variables in pseudocode?

To generate the above pseudocode, I used the following code: \begin{algorithm} \caption{sample}\label{sample} \begin{algorithmic}[1] \Require $\mathbf{D} \in \mathbb{R}^{M \times N}$ \State ...
0
votes
1answer
53 views

How to write an algorithm in french? [Errors]

I am trying to write my algorithm in french language. I found this solution which works for me but with errors. The errors are: \algorithmicendelsif undefined \algorithmicendif undefined ...
0
votes
0answers
22 views

Latex - after pseudocode =0 is added [duplicate]

I have some problems with using pseudocode in LaTeX. After I build the file =0 is added at the end of the file. Any suggestion how can I fix that? \documentclass{article} ...
0
votes
0answers
12 views

Referring to a correctly-styled pseudocode procedure name from the main text [duplicate]

I'm using the recommended algpseudocode package, and have defined a procedure inside an algorithmic environment that I would like to refer to from the main text. Inside this environment, ...
2
votes
1answer
77 views

stop bold in algorithmx

I am using the algorithmx package: http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/algorithmicx/algorithmicx.pdf The keywords such as "if", "while", "then", "else" "end if" etc. etc. all ...
3
votes
1answer
50 views

Errors using Algorithm

When I run the following code, the pdf is getting generated but I get errors. \documentclass[12pt,a4paper,oneside,oldfontcommands]{memoir} \usepackage{algorithm2e} \usepackage{algorithmicx} ...
3
votes
2answers
110 views

for loop in algpseudocode

I want change my pseudocode \documentclass{article}\usepackage{amsmath} \usepackage[noend]{algpseudocode} \usepackage{algorithm} \makeatletter \begin{document} \begin{algorithm} ...
4
votes
2answers
63 views

how to left justify comments to indent same as other text in Algorithmic

How do I left justify my comments in the algorithm. I am using algorithmicx package. What I want is: to pull the comment to left as shown in the attached snapshot. The code for my algorithm is ...
3
votes
1answer
98 views

algorithmicx or algpseudocode custom command indentation within a while loop or if statement

I have been trying all day to set-up the commands necessary to represent the Haggis pseudocode format using the algorithmicx package in Latex. I have managed to create the commands I need for the ...
4
votes
1answer
180 views

Can the coding style of the algorithm environment be modified?

I'm using the packages \usepackage{algpseudocode} \usepackage{algorithm} to produce a pseudocode of the following algorithm: \begin{algorithm} \centering \caption{Octree based search ...
1
vote
1answer
69 views

Algorithm floating like figure with border

This is my document (LuaLaTeX): \documentclass[a4paper,twoside,12pt]{scrreprt} \usepackage{fontspec} \usepackage{a4wide} \usepackage[english]{babel} \usepackage{caption} \usepackage{blindtext} ...
3
votes
2answers
328 views

Algorithm is not dividing into multiple frames

\section[Algorithm]{Algorithm} \begin{frame}[allowframebreaks] \begin{algorithm}[H] \begin{algorithmic}[1] \STATE \emph {Taking a sequence of values $(f_{1} \dotsc f_{n/2})$, and calculating $pfbm = ...
7
votes
2answers
128 views

algorithm with partial borders/frames

I use the algorithm float environment for pseudocode and want some algorithms to span two pages. That works fine with \algstore and \algrestore. However, I would like to omit these borders at the end ...
3
votes
1answer
87 views

Hyperref, cleveref and algpseudocode same identifier warning

I get the warning pdfTeX warning (ext4): destination with the same identifier (name{ALG@line.2}) has been already used, duplicate ignored with the MWE down below. \documentclass{article} ...
6
votes
2answers
368 views

pseudo code with vertical line

I want to write some pseudo code. After few research I found algorithmicx with this post: Write pseudo code in latex But I want vertical line as this: function toto: | for i = 0 , i < 10, i++ | ...
1
vote
1answer
247 views

How change font family in algorithmic package

Is there any way to set a specific font family for algortihm environment, especially for the comment that placed inside it?
8
votes
1answer
167 views

How do I get rid of that extra line at the end of my custom algorithmicx block?

I'm using the algorithmicx package and have created a custom block called \On, but even with the noend option for algpseudocode I get an extra blank line at the end of the block. Here is a complete ...
1
vote
1answer
50 views

Possible to put an algorithm inside a \begin{itemize}?

Is it possible to put an algorithm inside a \begin{itemize} as one of the \items?
6
votes
2answers
118 views

Text below line at end of algorithm?

I am using the algorithm and algpseudocode packages. When I define an algorithm it ends with a horizontal line. I would like to have some text below this horizontal line explaining some special case ...
2
votes
1answer
151 views

How to have continuation indent in algorithmicx algorithm for long comments and States

Assuming that I can apply the same solution to my document, previously I asked how to have continuation indent in line comments on somebody else's MWE and got an answer. However, I could not apply ...
1
vote
1answer
160 views

Code is a mess because I cannot indent inside a for loop in my algorithm

I have a for loop in my algorithm and I can't get latex to properly indent the pseudocode inside it. It's just a mess at the moment, it won't even put the code in the for loop on separate lines. ...
2
votes
1answer
177 views

How to indent long comment continuation in the algorithmicx pseudocode

In the MWE, I try to add line continuation indent to the answer given in Properly indent comments with no line-numbering in algorithmicx E.g. I am trying to write the \LineCommentCont . I am using ...
0
votes
1answer
90 views

How do I change colouring of comments using algorithmicx?

I am using the algorithm and algpseudocode packages, whilst wrapping my algorithms around algorithm and algorithmic blocks. I would like to change the colour or formatting of my comments ...
5
votes
1answer
63 views

Referring to correctly-styled algpseudocode procedure name in document

Given an algorithm written in algpseudocode: \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Part 1} \begin{algorithmic}[1] ...
3
votes
2answers
111 views

Fixing the location of the appearance in algorithmicx environment

I'm trying to force an algorithm to stay between two paragraphs, but after compilation, it shows up in the next page. My algorithm takes more than half a page and is something like: ...
1
vote
1answer
72 views

algorithmicx: how to redefine end if in the right way

I'm from Russia and there we have different form of "end if" than just "\algorithmicend \algorithmicif" (кесли at least in my university) But when I'm trying to redefine that according to official ...
5
votes
1answer
302 views

undefined control sequence '\For' - algorithmicx package

I have to write some algorithm, thus I've decided to use algorithmicx package: \usepackage{algorithm} \usepackage{algorithmicx} \begin{algorithm} \begin{algorithmic}[1] \For{aa} ...
4
votes
1answer
252 views

Change algorithmicx caption name

I am trying to change the Caption name of Algorithmicx but it doesnt work. This what i include to use it. %pseudocode \usepackage{algorithm} \usepackage{algorithmicx} \usepackage{algpseudocode} ...
5
votes
1answer
145 views

Customizing some aspect of algorithmic environment

I'm using the algorithmic environment for typesetting algorithm in my document, but I'd like to customize some aspect and fix problems. I'm using the algpseudocode package with noend option, but it ...
1
vote
1answer
232 views

Two column Algorithmicx with variable-width columns

In another post, @Jubobs suggested to use the multicol package around an algorithmic environment, to typeset the algorithm in two columns. Recently, I faced a rather aesthetic issue: It might be the ...
4
votes
1answer
352 views

Algorithm input in a box

I am trying to write pseudo code \documentclass[a4paper]{article} \usepackage[english]{babel} \usepackage[utf8x]{inputenc} \usepackage{amsmath} \usepackage{graphicx} ...
4
votes
2answers
127 views

Algorithmicx multiple statements per line aligned over all lines

I would like to put a <- b and e <- f, in parallel on a single line in an algorithmicx environment. I want the same with c <- d and g <- h. Then I want to align both lines. The output ...
6
votes
1answer
568 views

Splitting an algorithm across two columns

Consider the following short example, where a two column page is selected, and the algorithm is split across the two columns using a manual \pagebreak within the algorithm's code: ...