Let's not that this is maybe the easiest solution as you just need to find solution already existing for each output type.
I would say
- Latex => seems ok (sectioning - Roman numerals for sections and subsections - TeX - LaTeX Stack Exchange)
- EPUP or HTML => don't know if possible in CSS only.
I don't know of an easy solution right now. Maybe someone has already done it ?