[Tex/LaTex] How to make really pseudo pseudocode

algorithmslistspseudocode

Is there a way to do really casual peudocode in Latex? By casual I mean pseudocode that's more like a list of plain English steps, with occasional conditional/looping operators.

I've looked at the algorithm package and its variants (algoritmic, algoritmicx, etc) and they're all too restrictive for really casual pseudo-code. I basically want to just list some steps with a few conditions, but the packages all seem to require that every line be some algorithm operator (if, while, for) or mathematical operation.

I'd like a lot of my lines to just be plain English, like "Load input images", but occasionally I want to be able to add a loop or condition so I want something more advanced than a basic bullet list. I'd also like it to be in a nice looking environment like the algorithm environments so I can refer to it by a label.

As an example, I'd like to be able to write pseudocode something like the following, where operators like For would get highlighted nicely and the whole thing's in an algorithm environment, but otherwise it's just plain English:

Algorithm to make egg salad

  • Boil N Eggs

  • For (Each boiled egg) {

    • Crack and peel shell

    • Add to bowl

    }

  • Add mayonnaise and mix contents of bowl.

Best Answer

Coming back to this question after a few weeks, I was ultimately able to do what I wanted using the State and Statex commands of the algorithmicx package, both of which allow you to just write a line of whatever text you want.

Statex supresses line numbering if it's being used, so if you want lines in your algorithm that are sort of like headings and don't entail a step in the algorithm, then you can place bold text on a Statex line and it works nicely. I realize that's not typical of pseudo-code, but what I was trying to make was fairly plain-english pseudo-code to outline a high-level algorithm.

Related Question