Impoved PDF generation. Now it makes the cover and adds chapters correctly