Skip to content

Commit f552746

Browse files
authored
feat: add CSS counter for figure captions (#72)
* feat: add CSS counter for figure captions * Add translations for figure captions prefix Added translations for Czech, Danish, German, Spanish, French and Italian, from their respective `babel-<lang>` LaTeX packages.
1 parent 032d5ce commit f552746

7 files changed

Lines changed: 22 additions & 0 deletions

File tree

lang/cs.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
:lang(cs) .proof::before { content: 'Důkaz. ' attr(title) !important; }
44
:lang(cs) .definition::before { content: 'Definice ' counter(definition) '. ' !important; }
55
:lang(cs) caption::before { content: 'Tabulka ' counter(caption) '. ' !important; }
6+
:lang(cs) figcaption::before { content: 'Obrázek ' counter(figcaption) '. ' !important; }

lang/da.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
:lang(da) .proof::before { content: 'Bevis. ' attr(title) !important; }
44
:lang(da) .definition::before { content: 'Definition ' counter(definition) '. ' !important; }
55
:lang(da) caption::before { content: 'Tabel ' counter(caption) '. ' !important; }
6+
:lang(da) figcaption::before { content: 'Figur ' counter(figcaption) '. ' !important; }

lang/de.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
:lang(de) .proof::before { content: 'Beweis. ' attr(title) !important; }
44
:lang(de) .definition::before { content: 'Definition ' counter(definition) '. ' !important; }
55
:lang(de) caption::before { content: 'Tabelle ' counter(caption) '. ' !important; }
6+
:lang(de) figcaption::before { content: 'Abbildung ' counter(figcaption) '. ' !important; }

lang/es.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
:lang(es) .proof::before { content: 'Demostración. ' attr(title) !important; }
44
:lang(es) .definition::before { content: 'Definición ' counter(definition) '. ' !important; }
55
:lang(es) caption::before { content: 'Tabla ' counter(caption) '. ' !important; }
6+
:lang(es) figcaption::before { content: 'Figura ' counter(figcaption) '. ' !important; }
67
:lang(es) .indent-pars h2 + p,
78
:lang(es) .indent-pars h3 + p,
89
:lang(es) .indent-pars h4 + p {

lang/fr.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
:lang(fr) .proof::before { content: 'Démonstration. ' attr(title) !important; }
44
:lang(fr) .definition::before { content: 'Définition ' counter(definition) '. ' !important; }
55
:lang(fr) caption::before { content: 'Tableau ' counter(caption) '. ' !important; }
6+
:lang(fr) figcaption::before { content: 'Figure ' counter(figcaption) '. ' !important; }
67
:lang(fr) .indent-pars h2 + p,
78
:lang(fr) .indent-pars h3 + p,
89
:lang(fr) .indent-pars h4 + p {

lang/it.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
:lang(it) .proof::before { content: 'Dimostrazione. ' attr(title) !important; }
44
:lang(it) .definition::before { content: 'Definizione ' counter(definition) '. ' !important; }
55
:lang(it) caption::before { content: 'Tabella ' counter(caption) '. ' !important; }
6+
:lang(it) figcaption::before { content: 'Figura ' counter(figcaption) '. ' !important; }

style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,22 @@ table.borders-custom {
440440
text-align: right;
441441
}
442442

443+
/* Format figure captions (based on table captions) */
444+
figure {
445+
counter-increment: figcaption;
446+
}
447+
figcaption {
448+
text-align: left;
449+
font-size: 0.923em;
450+
padding: 0.25em 0.25em 0;
451+
width: 100%;
452+
margin-left: 0;
453+
}
454+
figcaption::before {
455+
content: 'Figure ' counter(figcaption) '. ';
456+
font-weight: bold;
457+
}
458+
443459
/* Center align the title */
444460
h1:first-child {
445461
text-align: center;

0 commit comments

Comments
 (0)