{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

13
votes
1answer
2k views

Mark a pseudocode block and insert comments near it

I am currently working on a LaTeX beamer presentation where I have to explain an algorithm. So I wrote this algorithm with \usepackage{algorithm,algpseudocode} This is the current algorithm: ...
4
votes
2answers
462 views

algorithmicx + babel + Hebrew incompatibility

When trying to create any document with babel and algorithmicx, e.g.: \documentclass{article} \usepackage[hebrew,english]{babel} \usepackage{algorithmicx} \begin{document} Hello, world. ...
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 ...
6
votes
1answer
9k views

Algorithm and IEEEtran

I'm trying to write an algorithm in a IEEEtran LaTeX template and it doesn't work in any way. \usepackage{algorithm} \usepackage{algorithmc} %\begin{algorithm}[H] \begin{algorithm*} \caption{ASGP ...
6
votes
1answer
1k views

Algpseudocode (algorithmicx) package comments

How to align comments in algorithmic environment to the right? For \Comment, if the comment is too long it gets wrapped and starts at the beginning of next line. It would look better if it was aligned ...
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} ...
7
votes
1answer
243 views

algorithmicx crashes standalone

I am creating SVG files from different stuff from my LaTeX document. For this, I am using the standalone package followed by pdf2svg. This compiles: \documentclass{article} \usepackage{algorithmicx} ...
11
votes
3answers
6k views

algpseudocode without end block text

algpseudocode lets me write code such as: \documentclass{article} \usepackage{algpseudocode} \begin{document} \begin{algorithmic} \While{$n>3$} \If{$m>n$} \State ... \State ... ...
8
votes
1answer
1k 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} ...
5
votes
3answers
958 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 ...
4
votes
1answer
687 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 ...
3
votes
1answer
623 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 ...
6
votes
2answers
6k views

Algorithm with Latex ( Package algorithmicx)

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

How do I define a new command in algorithmicx

The algorithmicx package defines two commands \Require and \Ensure for providing initial conditions. However, I'd like some custom commands such as \Assume, \Define, \Input, etc. At present, I merely ...
8
votes
1answer
217 views

How to automatically keep the indentation level when a line has to be broken

I'm using the algpseudocode package with two custom commands, \Let and \LongState to handle automatic indentation of (broken) long lines in the spirit of Werner's answer, which uses \parbox to wrap ...
4
votes
1answer
88 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: ...
4
votes
1answer
263 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
499 views

Algorithmicx — How to use latex maths delimiters

Today, I decided to migrate from using TeX [$..$] to LaTeX [\(..\)] delimiters for inline maths, and, as usual, fell off the cliff of my somewhat precarious understanding of TeXian gastroenterology, ...
3
votes
1answer
65 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 ...
3
votes
1answer
144 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 ...
2
votes
1answer
325 views

Self-defined Width of the Pseudocode Box with algorithmicx?

This post has beautifully shown how to make the algorithm pseudocode box as wide as one column or two columns. I am now writing a pseudocode with many if layers. So a one-column box cannot suffice. ...
1
vote
1answer
30 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 ...
1
vote
1answer
62 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 ...
0
votes
1answer
113 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 ...