Fix page and chapter numbering.

This is the quick fix of the numbering issue of pages and chapters. Refs avdi/quarto#32 and avdi/quarto#12.