To install on Mac OS X:
- Install linebyline.sty in the latex folder
in path: Library => texmf => tex => latex
After declaring the package (\usepackage{linebyline}) in the header of your .tex file, you call linebyline inside of the equation environment and introduce each line with the \ab command. There are basically two types of information you provide for each line. The first cell, between \ab and &, is the mathematical content of the line, which is set in math mode. The second cell of the line, between & and \\, is a comment about the mathematical content of that line set in text mode.
linebyline.sty calls the package amsmath.sty on its own, but I include the following line in my header to left align all of the proofs so that they line up a bit better. (The default is right alignment of equation numbering, which has the effect of allowing the left margin to vary.)
\usepackage[fleqn]{amsmath}
See this short file for compiled examples and templates. Also included is an explanation for how to split long formulas within one line, how to indent for 'sub proofs', how to mark a line with a dark arrow, and how to add extra space between lines in a proof.