Made some progress on the latex and added the function spread_pattern()