Quick reference for ppprog

Main environment

ppprog

The environment for typesetting pseudocode. Everything inside is treated as if it were in math.

Arguments:

  1. Name of the algorithm or program.
  2. Starting line number (optional). Default starting number is 1. Defined using one the following commands:
    • \NewProgram,
    • \ContinueProgram,
    • \ProgramStartsAtLine.

NewProgram

Use as argument to ppprog to start numbering lines from 1.

CoutinueProgram

Use as argument to ppprog to start numbering lines from where the previous ppprog environment left off. This is meant to facilitiate splitting a program.

ProgramStartsAtLine

Use as argument to ppprog to start numbering lines from an arbitrary number given by argument.

Arguments:

  1. Value from which to start numbering lines.

Cross-referencing

pplabel

Attaches a label to the current line. The label is as given in the argument, with no prefixes.

Arguments:

  1. Name of label.

pplab

Attaches a label to the current line. Label if of the form line:algname-labelname, where algname is the name of the algorithm as specified with ppprog and labelname is the argument given.

Arguments:

  1. Name of label—last segment.

pplineref

References a label created with pplab.

Arguments:

  1. Name of the algorithm the label is in.
  2. Name of label—last segment.

Lines and indentation

pp

Start a new numbered line.

ppempty

Start a new unnumbered line. Meant as a way to typeset completely empty lines.

ppmt

Alias to \ppempty.

pptab

Manual indentation.

ppbreak

Add extra space between lines.

Arguments:

  1. Amount of vertical space (optional). Default value is 0.1cm.