The latex and R code used the in stochastic simulation book chapter in "In silico Systems Biology:  A systems-based approach to understanding biological processes".