Numbering section headings: Difference between revisions

(Created page with "To number section headings, you can add the following declarations to the page ''MediaWiki:Common.css'': <syntaxhighlight lang="text"> article {counter-reset: h2counter;} art...")
Tag: 2017 source edit
 
No edit summary
Line 1: Line 1:
To number section headings, you can add the following declarations to the page ''MediaWiki:Common.css'':
To number section headings, you can add the following declarations to the page ''MediaWiki:Common.css'':
 
{{Textbox|boxtype=note|header=|text=The numbering created in common.css is not applied in the PDF export!|icon=yes}}<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
article {counter-reset: h2counter;}
article {counter-reset: h2counter;}
article  h1 {counter-reset: h2counter;}
article  h1 {counter-reset: h2counter;}
Line 35: Line 34:
        
        
     }
     }
   
/*Keine Nummerierung bei */
#mw-content-text .sectionflex h2::before, #mw-content-text .sectionflex h3::before,  #mw-content-text .bs-social-entity-wrapper h3::before {content:none}
#mw-content-text .mw-category h2::before, #mw-content-text .mw-category-generated h2::before,#mw-content-text .mw-category h3::before, #mw-content-text .mw-category-generated h3::before {content:none}
.ns-special #mw-content-text h2::before, .ns-special #mw-content-text h3::before {content:none;}
#mw-content-text .bs-tag-pagetemplates h6::before {content:none}
</syntaxhighlight>
</syntaxhighlight>
[[Category:Customizing]]
[[Category:Customizing]]
[[en:{{FULLPAGENAME}}]]
[[en:{{FULLPAGENAME}}]]
[[en:Überschriften nummerieren]]
[[en:Überschriften nummerieren]]

Revision as of 15:23, 17 July 2023

To number section headings, you can add the following declarations to the page MediaWiki:Common.css:

The numbering created in common.css is not applied in the PDF export!
article {counter-reset: h2counter;}
article  h1 {counter-reset: h2counter;}
article  h2 {counter-reset: h3counter;}
article #toc h2#mw-toc-heading {counter-reset: h2counter 0}
article  h3  {counter-reset: h4counter;}
article  h4  {counter-reset: h5counter;}
article  h5 {counter-reset: h6counter;}
article  h2:before, article #mw-content-text h2:before {
        content: counter(h2counter) ".\0000a0\0000a0";
        counter-increment: h2counter;
      
    }
article #toc h2#mw-toc-heading:before {content:""}
article  h3:before {
        content: counter(h2counter) "." counter(h3counter) ".\0000a0\0000a0";
        counter-increment: h3counter;

    }
article  h4:before {
        content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) ".\0000a0\0000a0";
        counter-increment: h4counter;
       
    }
article  h5:before {
        content: counter(h2counter) "." counter(h3counter) "." counter(h4counter)"."counter(h5counter) ".\0000a0\0000a0";
        counter-increment: h5counter;
       
    }
article  h6:before {
        content: counter(h2counter) "." counter(h3counter) "." counter(h4counter)"."counter(h5counter)"." counter(h6counter) ".\0000a0\0000a0";
        counter-increment: h6counter;
       
    }
    
/*Keine Nummerierung bei */
#mw-content-text .sectionflex h2::before, #mw-content-text .sectionflex h3::before,  #mw-content-text .bs-social-entity-wrapper h3::before {content:none}
#mw-content-text .mw-category h2::before, #mw-content-text .mw-category-generated h2::before,#mw-content-text .mw-category h3::before, #mw-content-text .mw-category-generated h3::before {content:none}
.ns-special #mw-content-text h2::before, .ns-special #mw-content-text h3::before {content:none;}
#mw-content-text .bs-tag-pagetemplates h6::before {content:none}



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

Discussions