1
vote
1answer
99 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. ...
5
votes
1answer
110 views

How to reduce indentation size within loop of an algorithm

For the following algorithm, I get four spaces for each text line inside the loop. How can I get only two or three spaces? Some of my text lines go to next line. I want to save some horizontal spaces. ...
0
votes
0answers
23 views

Create an indent in an algorithm (without using the algorithm environment) [duplicate]

So I'm trying to create an indent in an algorithm, but I'm not familiar with the \begin{algorithm} environment, so I would just like to do it in a math environment. I'm trying to create an indent, but ...
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 % ...
3
votes
1answer
190 views

Indenting pseudocode

I am very new to TeA, and am having trouble indenting a block of pseudocode within an enumeration. Or perhaps more specifically, the algorithm's pseudocode seems to ignore the enumerations ...
8
votes
2answers
296 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 ...
3
votes
1answer
92 views

Indentation missing for algorithm package in documentclass{minimal}

I am trying to get write an algorithm in LaTeX for minimal document class. Unfortunately, the indentation is completely missing. Following is my sample code: \documentclass{minimal} ...
4
votes
1answer
355 views

How to sanely format conditionals in clrscode package?

clrscode can produce some really nice-looking algorithm texts, but if you have nested conditionals, things start to look ugly. clrscode has the peculiar preference that the \Then keyword at the end ...
3
votes
1answer
266 views

Implementing indent in algorithm environment

I am using the algorithm environment in the algorithm2e package. What I want is to able to indent various portions. I tried \indent but that is doing me no good. Here is the MWE: ...
6
votes
1answer
209 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
3k 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:} ...
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} ...
0
votes
0answers
78 views

Alignment of multiline STATE in algorithm [duplicate]

Possible Duplicate: Include a line break in algorithmic while maintaining indentation I am using the algorithmic package to insert an algorithm in my paper. I have a long sentence after the ...
4
votes
2answers
1k views

algpseudocode without visible EndIf

I have the following chunk of code \begin{algorithmic} \State $\mathit{FlatMask}(c)=0$ \If{$\mathit{Inc1}(c)>0$} \State $\mathit{FlatMask}(c)\;+\!\!=2(\mathit{Inc1}(c)-1)$ \EndIf ...
11
votes
1answer
2k views

Change Indentation Size in algorithmicx package

I'm using and enjoying the algorithmicx package, but would like to adjust the size of its indentations. In the algorithms package, I could do this with \algsetup{indent=1em}, but that doesn't seem to ...
1
vote
1answer
507 views

Defining procedures in algorithmic

Is there any support for procedures/methods in the algorithmic package? Of course one could use several algorithms to define each method/procedure however because LaTeX usually doesn't put more than ...
4
votes
1answer
2k views

How to decrease algorithm indent for package algpseudocode?

I would like to save some horizontal space by changing indent space for package algpseudocode. How can I do that? I think the variable I have to change is \algorithmicindent but I can't manage to do ...
2
votes
1answer
2k views

Loop conditions in multiple lines using algorithmic package

I am working on a paper in double-column format, and I am using the algorithmic package to typeset my algorithms. One of my while loops' condition is a bit long hence doesn't fit into the column. ...
15
votes
3answers
7k views

Include a line break in algorithmic while maintaining indentation

I have this code: \DeclareCaptionFormat{algor}{% \hrulefill\par\offinterlineskip\vskip1pt% \textbf{#1#2}#3\offinterlineskip\hrulefill} ...
3
votes
2answers
551 views

Indentation in AUCTEX and algorithmic package

When working with EMACS+AUCTEX I encountered the problem of proper indentation when using the algorithmic package. In this MWE: \documentclass[12pt]{article} \usepackage{algorithmic} ...