/********************************/
/* EBOOK CHAPTER NUMBERING      */
/* Version:  20200204-001       */
/*                              */
/* Do not use spaces            */
/********************************/

/* Add the following in the <style type="text/css"> part of the XHTML file:
  body {counter-reset: number-L1 1} <!-- Assign chapter number to number-L1 -->
*/

/* Default settings implementent by class="number-L1" and class="number-L1-annex" */
.number-L1
    {
    counter-reset: number-L2; /* Create a number-L2 counter scope and set it to 0 */
    }

/* Print "Chapter" with the chapter number in front of it by class="number-L1" */
.number-L1:before 
    {
    content: counter(number-L1) "-";
    /* Assign chapter number to number-L1 in internal css part of xhtml files */
    }
.number-L2
    {
    counter-reset: number-L3; /* Create a number-3 counter scope and set it to 0 */
    }

/* Print chapter number before class "number-L2" */
.number-L2:before 
    {
    content: counter(number-L1) "." counter(number-L2) "-"; /* Prints chapter number */
    counter-increment: number-L2; /* Add 1 to number-L2 */
    }

.number-L3
    {
    counter-reset: number-L4; /* Create a number-4 counter scope and set it to 0 */
    }

/* Print chapter number before class "number-L3" */
.number-L3:before {
    content: counter(number-L1) "." counter(number-L2) "." counter(number-L3) "-"; 
    counter-increment: number-L3; /* Add 1 to number-L3 */
}

/* Print chapter number before class "number-L4" */
.number-L4:before {
    content: counter(number-L1) "." counter(number-L2) "." counter(number-L3) "." counter(number-L4)"-"; 
    counter-increment: number-L4; /* Add 1 to number-L3 */
}

/* Add the following in the <style type="text/css"> part of the XHTML file:
    {counter-reset: annex 1}
    <!-- Assigns annex number to variable annex -->
    To utilize the chapter numbering you can include in the body part of your Annex:
    <h1 id="annex-..." class="annex">Annex:&#160;...</h1>
    <h2 id="..." class="annex-L1">...</h2>
*/

.annex
    {
    counter-reset: annex-L1; 
    /* Create a annex-L1 counter scope and set it to 0 */
    }

    /* Print the annex letter in front of it by class="annex" */
.annex:before 
    {
    content: counter(annex, upper-alpha) "-";
    /* Assign annex number to annex in internal css part of xhtml files */
    }

.annex-L1
    {
    counter-reset: annex-L2;
    /* Create a annex-L2 counter scope and set it to 0 */
    }

    /* Print the chapter number in front of it by class="annex-L1" */
.annex-L1:before 
    {
    content: counter(annex, upper-alpha) "." counter(annex-L1) "-";
    counter-increment: annex-L1; 
    /* Add 1 to annex-L1 */
    }

.annex-L2
    {
    counter-reset: annex-L3;
    /* Create a annex-L3 counter scope and set it to 0 */
    }

    /* Print the chapter number before class "annex-L2" */
.annex-L2:before 
    {
    content: counter(annex, upper-alpha) "." counter(annex-L1) "." counter(annex-L2) "-";
    counter-increment: annex-L2; 
    /* Add 1 to annex-L2 */
    }

/* Print "annex" with the chapter number before class "annex-L3" */
.annex-L3:before {
    content: counter(annex, upper-alpha) "." counter(annex-L1) "." counter(annex-L2) "." counter(annex-L3) "-"; 
    counter-increment: annex-L3; /* Add 1 to annex-L3 */
}
