Editing Wikitext/Indents and Lists

In common with word processors, Wikitext allows the use of paragraph indents and various kinds of bullet and numbered lists. The few examples below show how it is done.

Indents are broadly similar to the idea of tabs on a word processor, though they can be used only at the start of a line.

Numbered lists find use in formal listings such as legal documents, and in specifications and other texts where paragraph reference numbers might be quoted. Bullets are much used in lists of hyperlinks, and in many summaries.

An introduction to HTML lists has been included, since this method alone allows the use of the alphabet and Roman numbers for list labels.

Indentation

edit

Indentation means increasing a paragraph's left margin. In wikitext this TAB character is the colon. When a colon is added before the start of a paragraph, the whole paragraph will be moved in by one TAB stop. To move the paragraph further, simply add more colons. Here is the text to indent three short paragraphs:

:This was given ''one'' indent

::This was given ''two'' indents

:::This was given ''three'' indents

and the result of doing so is:

This was given one indent
This was given two indents
This was given three indents


Note that indents are often used in combination with other symbols such as bullets; when they used in this way the indents should be written first, then the bullets.

Lists

edit

The table of contents found on each page is handled automatically by the software and is not accessible using the list syntax. This subject refers to user-made lists within the text.

Lists are useful for short comments and summaries and are easy to make.

Numbered Lists

edit

To make an automatically numbered list of the first order, just add a hash symbol, sometimes called an octothorp or number sign, before each line of the list. It looks like this:

#The First Item
#The Second Item
#The Third Item
#The Fourth Item
#The Fifth Item

The result is this:

  1. The First Item
  2. The Second Item
  3. The Third Item
  4. The Fourth Item
  5. The Fifth Item


To add a second order of numbering to the list, give the sub-items two hash symbols. The sub-item will then indent itself beneath the level one list item that resides above it. Additional levels of listing are made by adding more hash symbols. Here is an example:

#The First Item
##Sub Item
#The Second Item
#The Third Item
##Sub Item
###Sub-sub Item
#The Fourth Item
#The Fifth Item

The result of this wikitext coding is:

  1. The First Item
    1. Sub Item
  2. The Second Item
  3. The Third Item
    1. Sub Item
      1. Sub-sub Item
  4. The Fourth Item
  5. The Fifth Item


Bullet Lists

edit

Bullet lists are used more often than numbered lists, perhaps because they are less formal. The bullet lists make blue square bullets against each item in the list. It is done by adding an asterisk before each list item. Additional levels of listing are made by adding more asterisks. Using the same theme as above, consider the following text:

*The First Item
*Sub Item
*The Second Item
*The Third Item
**Sub Item
***Sub-sub Item
*The Fourth Item
*The Fifth Item

The result of this text listing is:

  • The First Item
    • Sub Item
  • The Second Item
  • The Third Item
    • Sub Item
      • Sub-sub Item
  • The Fourth Item
  • The Fifth Item


Since lists are made up of paragraphs, it is a simple matter to add colons for indentation before the list code to shift each list item further across the page. Colons need added to each list item for this effect.

Definition Lists

edit

Definition lists are usefully formatted for their purpose. They have a bold heading, followed by a normal text section on the lines that follow. Their name is self explanatory, for these lists are ideal for defining terms. They can be made in both HTML and Wikitext but only the simpler wikitext version is explained here. Note that the method needs only the semi-colon and the full-colon for its effect. The following text entry shows how to make list items:

;Mono-spaced fonts:A mono-spaced font is so-named because every glyph in the set has equal width...
;Proportional fonts:Proportional fonts are made with glyphs of different width...
;WikiBooks house font:The WikiBooks house font is 9 point ''Arial'' roman, a proportional font with a particularly clear style...The quick brown fox jumps over the lazy dog's back.   The quick brown fox jumps over the lazy dog's back.

The result of this text listing is:

Mono-spaced fonts
A mono-spaced font is so-named because every glyph in the set has equal width...
Proportional fonts
These fonts are made with glyphs of different width...
WikiBooks house font
The WikiBooks house font is 9 point Arial roman, a proportional font with a particularly clear style...The quick brown fox jumps over the lazy dog's back. The quick brown fox jumps over the lazy dog's back.

Note that wrapped lines are also indented.

Other Ordered Lists

edit

Alpha and Roman lists need HTML formats. These other list types are easily made in HTML, as well as the more usual numbered lists. In addition, their starting points can be preset.

The rules for making these alternative lists are as follows:

  • Ordered lists are enclosed in the tags <ol></ol>.
  • Each list item must start with the tag <li>.
  • The list format is set as follows in the leading <ol> tag with the type attribute. See the drop-box for examples.
    • Numbering is set with type=1; the number one.
    • Lower case alphabet is set with type=a
    • Upper case alphabet is set with type=A
    • Lower case Roman numbers are set with type=i
    • Upper case Roman numbers are set with type=I; the capital letter.
  • The start value is also set in the leading <ol> tag, with the start attribute. See the drop-box for examples.
    • Numbered lists use the intended start integer as a value. If omitted, the default is always equivalent to the first character of the intended set, as decided by type.
    • Alpha lists use the alphabet position value; e.g. start=3 for 'c'.
    • Zero and negative start values have no meaning except for numbered lists.
  • Arbitrary list labels can be set in any <li></li> tag with the value attribute. The label must belong to the selected type. For example, if type is for an alphabetic list, an arbitrary Roman number would be inappropriate.
    • Values are numbers representing the position in the type set; e.g. 3 for 'c' .
    • The start attribute should be omitted for this method; avoids confusion.
    • List items without values will follow-on from the previous label.

In the event that list-making adversely affects follow-on text, ensure that there is a blank line or a break tag between the two. Examples of HTML list formats can be found in the examples below.

Consider the following example. The sample code uses type=a to choose lower case alpha listing and the entry start=2 sets the starting point as the second letter of the alphabet; the letter b.

<ol type="a" start="2">
<li> These listing labels use lower case alphabet.
<li> This list starts with the ''second'' letter of the alphabet.
<li> Change ''type'' and ''start'' value for different formats.
</ol>

When the code runs it looks like this:

  1. These listing labels use lower case alphabet.
  2. This list starts with the second letter of the alphabet.
  3. Change type and start value for different formats.


HTML List Options and Examples

edit

The HTML List Code

edit
<ol type="a" start=1>
<li> This is the first item for lower case alpha starting with 'a'.
<li> This is the second item.
<li> This is the last.
</ol>

HTML List Examples

edit
Numbers

With type = 1 , (the number one), and start = 432 we obtain:

  1. This is the first item for numbers starting with '432'.
  2. This is the second item.
  3. This is the last.
Alpha Lower Case

With type = a and start = 2 we obtain:

  1. This is the first item for lower case alpha starting with 'b'.
  2. This is the second item.
  3. This is the last.
Alpha Upper Case

With type = A, and either start = 1 or not providing a value for start, we obtain:

  1. This is the first item of upper case starting with A.
  2. This is the second item.
  3. This is the last.
Roman Numbers, Lower Case

With type = i and start = 3 we obtain:

  1. This is the first lower case roman item starting with iii.
  2. This is the second item.
  3. This is the last.
Roman Numbers, Upper Case

With type = I, (the capital letter eye), and start = 2

  1. This is the first uppercase roman item starting with II.
  2. This is the second item.
  3. This is the last.
Negative Numbers

With type = 1, (the number one), and start = -29

  1. This is the first number starting with -29.
  2. This is the second item.
  3. This is the last.
More Negative Numbers

With type = 1, (the number one), and start = -1

  1. This is the first number starting with -1.
  2. This is the second item.
  3. This is the last.

Proper reversed lists will become a part of HTML5. See Reversed Lists.

The various listing options are easily changed, and an alternative method for simple numbering of lines can be found in Numbered Prose. Although bullet lists can be made in HTML by setting the list items in <ul></ul> tags instead of <ol></ol> tags, the rendering is likely to afford only the default bullet type instead of the three types that are theoretically possible. For a complete description of HTML lists refer to the external page Lists in HTML.