The following sections discuss how Ledger is architected, from the
ground up, and will show how to use the various parts of the Ledger
library from your own scripts.  Ledger essentially follows five steps in
reporting data to the user:

@enumerate
@item Parse journal file into an internal representation
@item Perform any implied math within the journal file
@item ``Face'' this internal representation as a virtual document
@item Apply a series of transforms to the virtual document
@item Display the virtual document using a formatting command
@end enumerate

The calculations in step two are specified by the user, such as when a
posting's value might contain mathematical operators.  The
calculations in step four are implied in the transformations, for
example when the @option{--average} option is used.

At the core, however, Ledger is basically a sophisticated calculator
with special knowledge about commoditized values.  It knows what you
mean if you add ten dollars to twenty euros, and later ask for the
balance of that particular account.  So it follows that first we must
discuss how Ledger deals with math, and from there move on to describing
how the steps above are achieved.