Divide main.tex into separate files (one per chapter)