Numbered list 1. … A. … a. … ?. …

A numbered list compiles a set of items whose order is often significant, for example chapters in a table of contents, instructions on how to make cookies or the results of a sports competition. Each item in a numbered list is marked by an ordinal number of some kind.

How to

A numbered list is a block, so it usually needs to be preceded and followed by a blank line except when it is at the start or end of a file respectively.

Start a list and each subsequent item either with a number or with a question mark for automatic numbering, followed by a dot and whitespace before the item’s text. A number can be an integer made of decimal digits, even a negative one with a leading hyphen for a minus sign. But it can also be made of either small or capital letters. Aneamal does not recognize Roman numerals specifically, but you can still use them as they are indistinguishable from letters which the Aneamal Translator understands.

A list can start with any number, not just 1., a. or A. and you are free in your choice for subsequent items too. The same number can be used repeatedly within the same list. However, subsequent items must have numbers of the same kind; so do not number items with capital letters in a list that started with a decimal number. You can always switch to automatic numbering with ?. though in which case the Aneamal Translator will use the previous item’s number increased by one.

You can start an item with two ordinal numbers, each one followed by a dot, to create a subordinate item. An item numbered 2.1. is a subordinate item of an item with the ordinal number 2.. The first number of a subordinate item must be identical to the number of the item it belongs to. A subordinate item’s second number is independent of its first number and can be of a different kind. All subordinate items of a main item make up a nested list. Nested lists can have lists nested in them as well whose items would be numbered with more than two numbers then.

Examples

With digits

1. Mathieu van der Poel
2. Wout van Aert
3. Tadej Pogačar
4. Mads Pedersen
  1. Mathieu van der Poel
  2. Wout van Aert
  3. Tadej Pogačar
  4. Mads Pedersen

The example above shows the first few places from the 2023 UCI Road World Championships in men’s cycling. The example below has items in reverse order. It’s a countdown.

3. Hold me
2. Thrill me
1. Kiss me
  1. Hold me
  2. Thrill me
  3. Kiss me

List numbers usually increase or decrease by one from item to item, but they don’t have to as the third example demonstrates. It lists domesticated animals numbered by their nuclear chromosome count, yet ordered alphabetically:

38. cat
78. dog
46. human
38. pig
54. sheep
  1. cat
  2. dog
  3. human
  4. pig
  5. sheep

Note

Leading zeros are permitted in Aneamal, but are not preserved when translated to a webpage:

007. James Bond
101. Dalmatians
  1. James Bond
  2. Dalmatians

With letters

The next example uses small letters for alphabetic numbering:

a. antlion
b. bumblebee
c. cicada
  1. antlion
  2. bumblebee
  3. cicada

Aneamal does not recognize Roman numerals as such, but it does recognize them as numbers composed of capital letters from the alphabet. So the next example that lists cities which hosted Summer Olympic Games between the world wars works nevertheless:

VII. Antwerp
VIII. Paris
IX. Amsterdam
X. Los Angeles
XI. Berlin
  1. Antwerp
  2. Paris
  3. Amsterdam
  4. Los Angeles
  5. Berlin

Automatic numbering

Here is an example with items marked by ?. for automatic numbering:

-1. squared imaginary unit
?. neutral element of addition
?. neutral element of multiplication
?. smallest prime number
  1. squared imaginary unit
  2. neutral element of addition
  3. neutral element of multiplication
  4. smallest prime number

Alphabetic numbering works automatically as well. As you can see in the example below, Z is followed by AA in the alphabetic number system. This is also how spreadsheet applications typically number spreadsheet columns:

Y. twenty-five
?. twenty-six
?. twenty-seven
?. twenty-eight
  1. twenty-five
  2. twenty-six
  3. twenty-seven
  4. twenty-eight

The next example shows fully automatical numbering. By default, browsers display such lists with increasing decimal numbers starting at one:

?. Justus Jonas
?. Peter Shaw
?. Bob Andrews
  1. Justus Jonas
  2. Peter Shaw
  3. Bob Andrews

But the symbols used for automatic numbering are a design choice that can be altered in a stylesheet. CSS has many predefined counter styles and developers can define own ones, too. For instance, the following example applies small Greek letters as list numbers automatically.

?. Athens
?. Thessaloniki
?. Patras
  1. Athens
  2. Thessaloniki
  3. Patras

Note

Automatic numbering continues lists starting with Roman numerals or romanettes alphabetically and not as you would expect from the Roman number system.

i. prīmus
ii. secundus
?. tertius
?. quārtus
  1. prīmus
  2. secundus
  3. tertius
  4. quārtus

Nested list

The following list provides a table of contents for this webpage wherein items represent section headings and subordinate items represent subsection headings.

0. Introduction
1. How to
2. Examples
2.a. With digits
2.b. With letters
2.c. Automatic numbering
2.d. Nested list
3. For developers
4. Further reading
  1. Introduction
  2. How to
  3. Examples
    1. With digits
    2. With letters
    3. Automatic numbering
    4. Nested list
  4. For developers
  5. Further reading

For developers

When Aneamal is translated to HTML, a numbered list is turned into an HTML ol element and its items are turned into HTML li elements inside.

A HTML type attribute on the ul element controls the kind of numbering used. Its value is 1 for lists with digits, a for lists with small letters and A for lists with capital letters. The numerical value of each item is set in a value attribute on each li element. So the third example becomes:

<ol type='1'>
<li value='38'>cat</li>
<li value='78'>dog</li>
<li value='46'>human</li>
<li value='38'>pig</li>
<li value='54'>sheep</li>
</ol>

A list numbered alphabetically becomes:

<ol type='a'>
<li value='1'>antlion</li>
<li value='2'>bumblebee</li>
<li value='3'>cicada</li>
</ol>

The Summer Olympics example is translated as follows. Note how the HTML value attributes are not increasing from seven to eleven like the displayed Roman numbers VII to XI appear to do. This is due to Roman numerals actually being handled as alphabetic letters whose numeric value is computed differently.

<ol type='A'>
<li value='15115'>Antwerp</li>
<li value='392999'>Paris</li>
<li value='258'>Amsterdam</li>
<li value='24'>Los Angeles</li>
<li value='633'>Berlin</li>
</ol>

A list with subordinate items is translated to nested HTML ordered lists like this:

<ol type='1'>
<li value='0'>Introduction</li>
<li value='1'>How to</li>
<li value='2'>Examples
<ol type='a'>
<li value='1'>With digits</li>
<li value='2'>With letters</li>
<li value='3'>Automatic numbering</li>
<li value='4'>Nested lists</li>
</ol>
</li>
<li value='3'>For developers</li>
<li value='4'>See also</li>
</ol>

Fully automatically numbered lists as in the Greco-themed example have neither type nor value attributes.

<ol>
<li>Athens</li>
<li>Thessaloniki</li>
<li>Patras</li>
</ol>

Here is CSS code that sets the list-style-property to make browsers display small Greek letters before each item instead of the default decimal numbers:

ol:not([type]) {
	list-style-type: lower-greek;
}

Further reading