B.4 | Sectioning

- Sectioning commands
- The Appendix
- Table of Contents
- Use HACHA

B.4.1 | Sectioning commands

Sectioning commands from `\part` down to `\subparagraph` are defined in base style files. They accept an optional argument and have starred versions.
The non-starred sectioning commands from `\part` down to `\subsubsection` show section numbers in sectional unit headings, provided their level is greater than or equal to the current value of the `secnumdepth` counter. Sectional unit levels and the default value of the `secnumdepth` counter are the same as in LATEX. Furthermore, given a sectional unit secname, the counter secname exists and the appearance of sectional units numbers can be changed by redefining `\the` secname. For instance, the following redefinition turn the numbering of chapters into alphabetic (uppercase) style:

    \renewcommand{\thechapter}{\Alph{chapter}}

When jumping to anchors, browsers put the targeted line on top of display. As a consequence, in the following code:

    \section{A section}
    \label{section:section}
     ...
    See Section~\ref{section:section}

Clicking on the link produced by `\ref{section:section}` will result in not displaying the targeted section title. A fix is writting:

    \section{\label{section:section}A section}
     ...
    See Section~\ref{section:section}

Note that `\label` should not be be placed last in section title (and I do not know the reason why). Have a try for this section B.4.1!

B.4.2 | The Appendix

The `\appendix` command exists and should work as in LATEX.

B.4.3 | Table of Contents

HEVEA now generates a table of contents, using a procedure similar to the one of LATEX(a ```.htoc`'' file is involved). One inserts this table of contents in the main document by issuing the command `\tableofcontents`. Table of contents is controled by the counter `tocdepth`. By default, the table of contents shows sectionning units down to the subsubsection level in article style and down to the subsection level in book (or report) style. To include more or less sectionning units in the table of contents, one sould increase or decrease the `tocdepth` counter.
One can also add extra entries in the table of contents by using the command `\addcontentslines`, in a way similar to LATEX homonymous command. However, hyperlinks need to be introduced explicitely, as in the following example, where an anchor is defined in the section title and refered to in the argument to `\addcontentsline` :

    \subsection*{\aname{no:number}{Use \hacha{}}}
    \addcontentsline{toc}{subsection}{\ahrefloc{no:number}{Use \hacha{}}}

(See Section 8.1.1 for details on commands related to hyperlinks.)
There is no list of figures nor list of tables.

Use HACHA

However, HEVEA has a more sophisticated way of producing a kind of map w.r.t. the sectioning of the document. A later run of HACHA on HEVEA output file splits it in smaller files organized in a tree whose nodes are tables of links. By contrast with LATEX, starred sectioning commands generate entries in these tables of contents. Table of contents entries hold the optional argument to sectioning commands or their argument when there is no optional argument. Section 7 explains how to control HACHA.