{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

0
votes
0answers
11 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
18 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
45 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
16 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
12 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
153 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
55 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
47 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
37 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
78 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
41 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
51 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
41 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
68 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
49 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
65 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
162 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
59 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
184 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
112 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
68 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
327 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
125 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
153 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
43 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
98 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
117 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
125 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
142 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
73 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
52 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
84 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: ...
0
votes
1answer
53 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
196 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
212 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
133 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
160 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
238 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
112 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 ...
4
votes
1answer
394 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: ...
3
votes
1answer
233 views

Properly indent comments with no line-numbering in algorithmicx

Writing comments in pseudocode, I wanted to insert comments to the right side of the line which is commented. This thread help me a lot. The algorithm is line-numbered, however I need the comments ...
6
votes
1answer
191 views

Place pseudocode inside tikz node

How can I place pseudocode, that is written by the algpseudocode package, inside a tikz node? (I don't want to just decorate the code, but use them inside a graph) MWE \documentclass{article} ...
3
votes
4answers
162 views

Incorrect reference to a line in algorithmic using hyperref

I am using algpseudocode and algorithm packages to typeset pseudocode. I also use float, hyperref and caption packages. The problem is that when I reference a line in the pseudocode, the number is ...
3
votes
1answer
639 views

Reduce the line number font size of pseudocode?

I have learned from here on how to reduce the font size in the pseudocode. The last thing left for me is to reduce the line number font size as well. The following is my MWE, and it seems that ...
3
votes
1answer
790 views

How may I remove \EndIf and \EndFor in algorithmicx?

For space consideration, I wish to condense my pseudocode. I find it a bit annoying to me to always have a \EndIf or \EndFor at the end of every block, especially when inside the block only lies one ...
3
votes
2answers
2k views

Pseudocode: \Function vs. \Procedure?

The title says it all. What is the difference between a Function and a Procedure? When should I use which?
1
vote
0answers
23 views

How to use dotted line to make indentation clearer in algorithmicx? [duplicate]

I wish to indicate clearly when a block starts and ends with "enclosing lines" in addition to the indentation. I understand that I can do it with algorithm2e like so \begin{algorithm}[H] \SetLine % ...
6
votes
1answer
980 views

Vertical loop/block lines in algorithmicx with 'noend' option

I am using the algorithmicx package to write an algorithm. However I am using the noend option: \usepackage[noend]{algpseudocode} Is there anyway to get vertical lines for each block of code? This ...