Reimplimentation of the LaTeX for-loop macro
