1
vote
1answer
71 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. ...
1
vote
1answer
32 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 ...
3
votes
1answer
68 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 ...
1
vote
0answers
22 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
137 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
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
140 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 ...
7
votes
2answers
175 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 ...
3
votes
1answer
196 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 ...
5
votes
3answers
980 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 ...
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
874 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
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
1answer
555 views

How to fully left justify text in algorithmicx when not using line numbers

I'm using the algorithmicx package and would like to fully left justify the text when not using line numbers. Here's an example: Notice how only the Require and Ensure clauses are fully pushed to ...
4
votes
2answers
877 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 ...