h2:before {
  content:counter(chapter) ". ";
}

h2 {
  counter-increment:chapter;
  counter-reset:section subsection;
}

h3:before {
  content:counter(chapter) "." counter(section) " ";
}

h3 {
  counter-increment:section;
  counter-reset:subsection;
}

h4:before {
  content:counter(chapter) "." counter(section) "." counter(subsection) " ";
}

h4 {
  counter-increment:subsection;
}
