Generate pdf doc adjust headings

Adjust heading depth so that heading is included in appropriate section in PDF