Numbering ordered lists: Difference between revisions

No edit summary
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
To number bullets in the page text consecutively, you can add the following CSS to the page ''MediaWiki:Common.css''. Please note that this custom styling  may not work if it is incompatible with CSS declarations from other stylesheets in the wiki.


To create numbering as 1., 1.1, 1.1.1 and so on, use the following style:<syntaxhighlight lang="text">
Example for separately numbered footnotes.<ref>Footnote 1</ref> <ref>Footnote 2</ref><syntaxhighlight lang="css">
article ol {  
/* Styles for formatting sub-ordered-list-items with 1.1., 1.1.1., etc.)*/
counter-reset:section;  
/* First, set all numbered lists to use counter-reset */
list-style-type:none;  
.pdfcreator-page-content ol,
}
#mw-content-text ol,
article ol li {
ol.ve-ce-branchNode {
list-style-type:none;
    counter-reset: item;
}
    margin: 0.3em 0 0 2.2em;
article ol li ol {
}
counter-reset:subsection;
 
}
/* Display all list items in a numbered list in block display */
article ol li ol li ol{  
.pdfcreator-page-content ol > li,
counter-reset:subsubsection;  
#mw-content-text ol > li,
}
ol.ve-ce-branchNode > li {
article ol li:before{
    display: block;
     counter-increment:section;
}
    content:counter(section) ". ";
ol.ve-ce-branchNode > li > p {
    float: left;
     display: inline
    margin-right: 0.4em;
}
}
 
article ol li ol li:before {
/* Use a counter that checks the number of items and adds a "." between them and ends with ". " */
    counter-increment:subsection;
.pdfcreator-page-content ol > li:before,
     content:counter(section) "." counter(subsection) " ";
#mw-content-text ol > li:before,
}
ol.ve-ce-branchNode > li:before {
article ol li ol li ol li:before {
     content: counters(item, ".") ". ";
    counter-increment:subsubsection;
    counter-increment: item;
     content:counter(section) "." counter(subsection) "." counter(subsubsection) "" ;
}
}
 
/*Count footnotes separately*/
/*Number footnotes separately*/
article ol.references {  
.pdfcreator-page-content .references::marker,
counter-reset:ref; list-style-type:none;  
#mw-content-text .references::marker {
}
     content: " ";
article ol.references li:before{
}
     counter-increment:ref;
.pdfcreator-page-content ol.references,
     content:counter(ref) ". ";
#mw-content-text ol.references {
    float: left;
    counter-reset: ref;
     margin-right: 0.4em;
    list-style-type: none;
}
}
.pdfcreator-page-content ol.references li:before,
#mw-content-text ol.references li:before {
     counter-increment: ref;
     content: counter(ref) ". ";
     margin-right: 0;
}
</syntaxhighlight>Output:
</syntaxhighlight>Output:


Line 43: Line 50:
## Substep 1
## Substep 1
## Substep 2
## Substep 2
### Subsubstep 1
### SubSubstep 1
### SubSubstep 2
### SubSubstep 3
# Step 2
# Step 2
# Step 2
Bulleted lists that are not numbered are not affected by the CSS declarations:
 
* List item
** List item level 2
*** List item level 3
 
Numbering in a new "ordered list" starts back at 1:
 
# Step 1
## Substep 1
## Substep 2
### SubSubstep 1
### SubSubstep 2
### SubSubstep 3
# Step 2
# Step 2
# Step 2
# Step 2


== Example for footnote numbering ==
These footnotes are formatted separately, although they are also just ordered list in the page content.
[[Category:Customization]]
[[Category:Customization]]
[[en:{{FULLPAGENAME}}]]
[[de:Aufzählungslisten_nummerieren]]
[[de:Aufzählungslisten_nummerieren]]

Latest revision as of 09:34, 28 July 2026

To number bullets in the page text consecutively, you can add the following CSS to the page MediaWiki:Common.css. Please note that this custom styling may not work if it is incompatible with CSS declarations from other stylesheets in the wiki.

Example for separately numbered footnotes.[1] [2]

/* Styles for formatting sub-ordered-list-items with 1.1., 1.1.1., etc.)*/
/* First, set all numbered lists to use counter-reset */
.pdfcreator-page-content ol,
#mw-content-text ol,
ol.ve-ce-branchNode {
    counter-reset: item;
    margin: 0.3em 0 0 2.2em;
}

/* Display all list items in a numbered list in block display */
.pdfcreator-page-content ol > li,
#mw-content-text ol > li,
ol.ve-ce-branchNode > li {
    display: block;
}
ol.ve-ce-branchNode > li > p {
    display: inline
}

/* Use a counter that checks the number of items and adds a "." between them and ends with ". " */
.pdfcreator-page-content ol > li:before,
#mw-content-text ol > li:before,
ol.ve-ce-branchNode > li:before {
    content: counters(item, ".") ". ";
    counter-increment: item;
}

/*Number footnotes separately*/
.pdfcreator-page-content .references::marker,
#mw-content-text .references::marker {
    content: " ";
}
.pdfcreator-page-content ol.references,
#mw-content-text ol.references {
    counter-reset: ref;
    list-style-type: none;
}
.pdfcreator-page-content ol.references li:before,
#mw-content-text ol.references li:before {
    counter-increment: ref;
    content: counter(ref) ". ";
    margin-right: 0;
}

Output:

  1. Step 1
    1. Substep 1
    2. Substep 2
      1. SubSubstep 1
      2. SubSubstep 2
      3. SubSubstep 3
  2. Step 2
  3. Step 2
  4. Step 2

Bulleted lists that are not numbered are not affected by the CSS declarations:

  • List item
    • List item level 2
      • List item level 3

Numbering in a new "ordered list" starts back at 1:

  1. Step 1
    1. Substep 1
    2. Substep 2
      1. SubSubstep 1
      2. SubSubstep 2
      3. SubSubstep 3
  2. Step 2
  3. Step 2
  4. Step 2

Example for footnote numbering

These footnotes are formatted separately, although they are also just ordered list in the page content.

  1. Footnote 1
  2. Footnote 2


PDF exclude - start

To submit feedback about this documentation, visit our community forum.

PDF exclude - end