Manuel Amago: Numbered headers and page table of content

Making life taste better…


Page actions: RecentChanges | PrintableView | PageHistory | EditPage



Use it with the usual headers !, !!, !!! -> !!!!!!

To have text indented following the header level, set the directive (:indent:) before the first header. The indentation is based upon the first header seen after the directive. Anything below that level will show strange results :


(:indent:)
!Header
!!Subheader
!!!`SubSubheader
!Another Header
!!Subheader
(:noindent:)
Text not indented

Header

Subheader

SubSubheader

Another Header

Subheader

Text not indented

To have numbered headers, set the directive (:num:) and the headers will be numbered after the directive setting. (:nonum:) stops the numbering, but do not reset it. The numbering starts from the first header level seen:


!!general header (not numbered)
(:num:)
!!Header numbered
!!!Subheader numbered
!!!Subheader...
!!Another Header
!!!Subheader
(:nonum:)
!!Header not numbered (Annex..)
!!Header not numbered (Annex..)

general header (not numbered)

1. Header numbered

1.1. Subheader numbered

1.2. Subheader…

2. Another Header

2.1. Subheader

Header not numbered (Annex..)

Header not numbered (Annex..)

And finally, to have a page table of content, set the directive (:toc:)


!general header - not in toc
(:num:)
(:toc:)
!!Header
!!!Subheader
!!!Subheader
!!Another Header
!!!Subheader
(:notoc:)
!!Another Header - not in toc
!!!Subheader - not in toc

general header - not in toc

3. Header

3.1. Subheader

3.2. Subheader

4. Another Header

4.1. Subheader

5. Another Header - not in toc

5.1. Subheader - not in toc

directive (:notoc:) stops the table of content recording, but only one table of content can exist in a page.

There is a maximum of 4 levels.

This page may have a more recent version on pmwiki.org: PmWiki:NumberedHeaders, and a talk page: PmWiki:NumberedHeaders-Talk.


Page actions: RecentChanges | PrintableView | PageHistory | EditPage