2
votes
2answers
496 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
1answer
89 views

How to define new loops in algorithmicx?

How can I define a new loop in algorithmicx? For example, code like this: ex1) PreLoop s do --statement1 --statement2 ex2) PostLoop s do --statement1 --statement2 Is it possible to define it ...
2
votes
1answer
340 views

Colors in Pseudocode matlab style

How do I get colours and more control over spacing in the algorithmic package like this: I tried this which looks good, but has numbers: \begin{enumerate} \item Create the cumulative sum of ...
1
vote
1answer
5k views

ELSE IF in algoritmic package

Is there a command in algorithmic package which is similar to \ElsIf in algorithmicx? ( I do not want each nested if to be indented).
1
vote
0answers
127 views

Algorithmic: file ended while scanning definition of \ALG\typeout [closed]

I m trying to the given code given in here: Algorithm and IEEEtran, or some other examples. by \usepackage{algpseudocode}. But I am getting this error: ./algpseudocode.sty:12: file ended while ...
5
votes
2answers
4k views

“For” loop without “do”; “if” statement without “then”

How can I get rid of the do in a for loop and the then in an if statement when typesetting algorithms using the algorithm and algorithmicx packages?