Next: sectiontype-and-ref
Prev: section
Up: Sectioning
Top: Top
0.2.2.2. How to use `\section<n>'
The presumption is that every file in a literate document will begin its
sectioning with a `\section' (equivalently, `\section1') and
further sectioning will reflect a reasonable hierarchical structure
within the file. You usually know this when you are typing in a
particular file.
What you often do not know is how the file fits into the larger
document, and it is most annoying (as happens sometimes with LaTeX)
to have to rename all `\chapter's to `\section's, or some such.
The information on how things go together is usually in a "root
file," which sticks things together with `\input',
`\downsection' and `\upsection'; this example is typical:
The `\upsection's and `\downsection's determine what actual
LaTeX/Texinfo sectioning command is generated for a particular
`\section<n>' command. Unfortunately, the desired LaTeX/Texinfo
sectioning command for the top section in your hierarchy depends
on the kind of document you are producing. For example, should it be
a `\part' or a `\chapter'? The solution here is to let you
choose, with the
`\rootsectiontype{\foo}'
command. It says that `\section1's at the "top level" should be
typeset as LaTeX/Texinfo `\foo''s. The defaults based on the
`\documentstyle' should usually be adequate:
\documentstyle \rootsectiontype
article \section
report \chapter
book \chapter
For a report, a useful variant might be `\rootsectiontype{\part}'.