Numbered Headings
September 17, 2001
In addition to the basic heading format, Curl adds has a numbered headings format that allows you to add
further structure. Numbered headings are specified in almost exactly the same way as normal headings:
{numbered-heading level=level-number, text }
However, the way in which they work is slightly more complex. For starters when they are displayed,
the heading automatically places a number, so if you wrote the following code:
|| numbered.curl
{curl 1.7 applet}
{applet license = "development"}
{numbered-heading level=1, This is a level 1 numbered heading }
An extra one indicating the heading number is added to the text:
1 This is a level 1 numbered heading
Numbered-headings display the number based on where they are in relation to other numbered
headings and other headings. So the following code:
|| numbered2.curl
{curl 1.7 applet}
{applet license = "development"}
{numbered-heading level=1, This is a level 1 numbered heading }
{numbered-heading level=2, This is a subsection of a level one numbered
heading }
would produce the following text:
1 This is a level 1 numbered heading
1.1 This is a level 1.1 subsection of a level one numbered heading
If you placed this second line under a normal heading as follows:
|| numbered3.curl
{curl 1.7 applet}
{applet license = "development"}
{heading level=1, This is a level 1 heading }
{numbered-heading level=2, This is a subsection of a level one heading }
then the numbered heading would still start as the next number down from the level in the heading,
despite the fact that the original heading has no number:
This is a level 1 heading
1.1 This is a subsection of a level one heading
Ideally for this reason, it's best not to mix headings and numbered headings.
The numbered headings can be used to create a large number of subsections. If you want to have a set
of numbered subsections you could do the following:
|| numbered4.curl
{curl 1.7 applet}
{applet license = "development"}
{numbered-heading level=1, A level one heading}
{numbered-heading level=2, A subsection of a level one heading}
{numbered-heading level=2, A subsection of a level one heading}
{numbered-heading level=3, A subsection of a level two heading}
This would display:
So each new number creates a new level, while each number, within the same level creates a new subsection on
the same level. Headings are a good way to organize content, in particular for items such as a table of contents.
Headings
Early Adopter Curl
Lists
|