2024-10-15 08:09:14 +00:00
|
|
|
body {counter-reset: h2 figure table}
|
2024-10-05 06:27:07 +00:00
|
|
|
h2 {counter-reset: h3}
|
|
|
|
h3 {counter-reset: h4}
|
|
|
|
h4 {counter-reset: h5}
|
2024-10-11 09:43:02 +00:00
|
|
|
h5 {counter-reset: h6}
|
2024-10-05 06:27:07 +00:00
|
|
|
|
2024-10-18 07:33:33 +00:00
|
|
|
*[autonumbering] {
|
2024-10-05 06:27:07 +00:00
|
|
|
h2:before {
|
|
|
|
counter-increment: h2;
|
|
|
|
content: counter(h2) " ";
|
|
|
|
}
|
|
|
|
h3:before {
|
|
|
|
counter-increment: h3;
|
|
|
|
content: counter(h2) "." counter(h3) " ";
|
|
|
|
}
|
|
|
|
h4:before {
|
|
|
|
counter-increment: h4;
|
|
|
|
content: counter(h2) "." counter(h3) "." counter(h4) " ";
|
|
|
|
}
|
2024-10-11 09:43:02 +00:00
|
|
|
h5:before {
|
|
|
|
counter-increment: h5;
|
|
|
|
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " ";
|
|
|
|
}
|
|
|
|
h6:before {
|
|
|
|
counter-increment: h6;
|
|
|
|
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " ";
|
|
|
|
}
|
2024-10-05 06:27:07 +00:00
|
|
|
h2:before,
|
|
|
|
h3:before,
|
2024-10-11 09:43:02 +00:00
|
|
|
h4:before,
|
|
|
|
h5:before,
|
|
|
|
h6:before
|
2024-10-05 06:27:07 +00:00
|
|
|
{
|
|
|
|
font-family: monospace;
|
2024-10-11 09:43:02 +00:00
|
|
|
font-size: 1rem;
|
2024-10-05 06:27:07 +00:00
|
|
|
}
|
|
|
|
|
2024-10-15 08:09:14 +00:00
|
|
|
.table-of-contents :is(ol, ul) {
|
2024-10-05 06:27:07 +00:00
|
|
|
/*
|
|
|
|
each list gets a new counter
|
|
|
|
*/
|
|
|
|
counter-reset: item;
|
|
|
|
margin-inline-start: 0;
|
|
|
|
}
|
2024-10-15 08:09:14 +00:00
|
|
|
.table-of-contents li:before {
|
2024-10-05 06:27:07 +00:00
|
|
|
/*
|
|
|
|
the counter is added as a pseudo-element,
|
|
|
|
and nested counters are joined by a dot
|
|
|
|
*/
|
|
|
|
content: counters(item, ".") " ";
|
|
|
|
counter-increment: item;
|
|
|
|
/* ensure the counters align visually */
|
|
|
|
font-family: monospace;
|
|
|
|
font-weight: bold;
|
|
|
|
margin-inline-end: 1em;
|
|
|
|
}
|
2024-10-15 08:09:14 +00:00
|
|
|
/* tables and figures */
|
|
|
|
caption {
|
|
|
|
counter-increment: table;
|
|
|
|
&:before {
|
|
|
|
content: "Table " counter(table) ": ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
figcaption {
|
|
|
|
counter-increment: figure;
|
|
|
|
&:before {
|
|
|
|
content: "Figure " counter(figure) ": ";
|
|
|
|
}
|
2024-10-05 06:27:07 +00:00
|
|
|
}
|
2024-10-16 05:34:37 +00:00
|
|
|
/* footnotes */
|
|
|
|
#footnotes h2 {
|
|
|
|
counter-reset: h2;
|
|
|
|
&:before {
|
|
|
|
content: ''
|
|
|
|
}
|
|
|
|
}
|
2024-10-05 06:27:07 +00:00
|
|
|
}
|