65 Formatting Ordered Lists

In Pressbooks, you can choose to create ordered lists or bulleted lists. These options are available on the toolbar of your Visual Editor. 

Click the third and fourth icons on the visual editor toolbar to access lists.

The default setting for an ordered list is numbers:

  1. Apples
  2. Bananas
  3. Cherries

A hierarchical list will look like this:

  1. Fruit
    1. Apples
      1. Red Delicioius

However, you can change this setting from the default in the text editor of your chapter.

Newer (“Buckram”) Themes

If you’re on one of Pressbooks’ most recently updated themes,  you can change a default numbered list to Harvard, Decimal, or Legal formatted lists.

An ordered list in Harvard style.

This is an ordered list in Legal style.

An ordered list in decimal style.

To do this, go to the text editor of the intended chapter and find your list. It should look like this:

An ordered list in the text editor

 

Then, enter the following code in place of the first <ol> tag:

Harvard: <ol class=”harvard”>
Decimal: <ol class=”decimal”>
Legal: <ol class=”legal”>

Your ordered list should look like this in the text editor:

Text editor for a Harvard list

Then, switch back to your visual editor. Your list should now reflect your chosen format:

Ordered list in Harvard

 

NOTE: You can add additional items to any list that is already formatted with the ol class tags and the entire list will maintain the class formatting

Other Themes

We’re in the process of updating all Pressbooks themes. After this is complete, all themes will be able to create structured lists using the classes from above. However, older themes currently still need to apply a list style manually to each newly indented tier in the list.

All themes have upper alpha (A, B, C), lower alpha (a, b, c), upper roman (I, II, III), and lower roman (i, ii, iii) characters built into the CSS. You can apply these styles by editing the list in the text editor of your chapter.

Switch out the opening <ol> tag for every tier of the list that you want styled differently. The following are the style tags that you can put in place of the opening  <ol> tag:

Lower Alpha: <ol style=”list-style-type:lower-alpha”>
Upper Alpha: <ol style=”list-style-type:upper-alpha”>
Lower Roman: <ol style=”list-style-type:lower-roman”>
Upper Roman: <ol style=”list-style-type:upper-roman”>

A list that was in lower alpha instead of numbered would look this in your text editor:

<ol style=”list-style-type:lower-alpha”>
   <li>milk</li>
<li>cheese</li>
<li>yogurt</li>
</ol>

This would appear in your visual editor and exports as:

  1. Milk
  2. Cheese
  3. Yogurt

Create the list first through the visual editor using the Numbered List icon on the toolbar. Then, edit the list in the text editor to style it how you’d like. A list that had numbers for primary objects, upper alpha characters for secondary objects, and lower roman numerals for tertiary objects would be structured like this in the text editor:

<ol>
<li>Dairy
<ol style=”list-style-type: upper-alpha;”>
<li>Cheese
<ol style=”list-style-type: lower-roman;”>
<li>Havarti</li>
</ol>
</li>
</ol>
</li>
</ol>

This list would appear in your visual editor and exports as:

  1. Dairy
    1. Cheese
      1. Havarti

You can watch for theme updates (and other updates) in our Pressbooks blog!

License

Icon for the Creative Commons Attribution 4.0 International License

Pressbooks User Guide Copyright © 2012 by Book Oven Inc. (Pressbooks.com) is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book