diff --git a/index.html b/index.html index 73caecb..016b000 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,7 @@
+ In order to get automatic first line indentation of paragraphs, like in
+ default LaTeX articles, the class
+ indent-pars
can be used with article
tag.
+
<article class="indent-pars">
+ ...
+</article>
+
+ The CSS style provided follows babel
specific language rules: by default,
+ the first paragraph after a section title is not indented in English, unlike Spanish and
+ French languages.
+
+ To avoid first line indentation of some specific paragraph, the class no-indent
+ can be used.
<p class="no-indent">...</p>
+
The labels of theorems, definitions, lemmas and proofs can be changed diff --git a/lang/es.css b/lang/es.css index 00598bd..5a3ea73 100644 --- a/lang/es.css +++ b/lang/es.css @@ -2,3 +2,8 @@ :lang(es) .lemma::before { content: 'Lema ' counter(theorem) '. ' !important; } :lang(es) .proof::before { content: 'Demostración. ' attr(title) !important; } :lang(es) .definition::before { content: 'Definición ' counter(definition) '. ' !important; } +:lang(es) .indent-pars h2 + p, +:lang(es) .indent-pars h3 + p, +:lang(es) .indent-pars h4 + p { + text-indent: var(--text-indent-size); +} diff --git a/lang/fr.css b/lang/fr.css index 9751edf..3bc903c 100644 --- a/lang/fr.css +++ b/lang/fr.css @@ -2,3 +2,8 @@ :lang(fr) .lemma::before { content: 'Lemme ' counter(theorem) '. ' !important; } :lang(fr) .proof::before { content: 'Démonstration. ' attr(title) !important; } :lang(fr) .definition::before { content: 'Définition ' counter(definition) '. ' !important; } +:lang(fr) .indent-pars h2 + p, +:lang(fr) .indent-pars h3 + p, +:lang(fr) .indent-pars h4 + p { + text-indent: var(--text-indent-size); +} diff --git a/style.css b/style.css index be1c6f4..ca352b4 100644 --- a/style.css +++ b/style.css @@ -111,6 +111,11 @@ --table-border-color: black; --sidenote-target-border-color: hsl(55, 55%, 70%); --footnotes-border-color: hsl(0, 0%, 39%); + --text-indent-size: 1.463rem; /* In 12pt [Latin Modern font] LaTeX article + \parindent =~ 17.625pt; taking also into account the ratio + 1pt[LaTeX] = (72 / 72.27) * 1pt[HTML], with default 12pt/1rem LaTeX.css font + size, the identation value in rem CSS units is: + \parindent =~ 17.625 * (72 / 72.27) / 12 = 1.463rem. */ } .latex-dark { @@ -201,6 +206,27 @@ p { margin-top: 1rem; } +/* Indents paragraphs like in LaTeX documents*/ +.indent-pars p { + text-indent: var(--text-indent-size); +} + +.indent-pars p.no-indent, +p.no-indent { + text-indent: 0; +} + +.indent-pars ol p, +.indent-pars ul p { + text-indent: 0; +} + +.indent-pars h2 + p, +.indent-pars h3 + p, +.indent-pars h4 + p { + text-indent: 0; +} + /* A elements that don't have a class get default styles */ a:not([class]) { text-decoration-skip-ink: auto; @@ -429,12 +455,14 @@ dl dd { width: 18vw; margin-right: -20vw; margin-bottom: 1em; + text-indent: 0; } .sidenote.left { float: left; margin-left: -20vw; margin-bottom: 1em; + text-indent: 0; } /* (WIP) add border when a sidenote is clicked on */ diff --git a/style.min.css b/style.min.css index a118fbc..4fbe0e9 100644 --- a/style.min.css +++ b/style.min.css @@ -3,4 +3,4 @@ * * Source: https://github.com/vincentdoerig/latex-css * Licensed under MIT (https://github.com/vincentdoerig/latex-css/blob/master/LICENSE) -*/@font-face{font-family:'Latin Modern';font-style:normal;font-weight:normal;font-display:swap;src:url('./fonts/LM-regular.woff2') format('woff2'),url('./fonts/LM-regular.woff') format('woff'),url('./fonts/LM-regular.ttf') format('truetype')}@font-face{font-family:'Latin Modern';font-style:italic;font-weight:normal;font-display:swap;src:url('./fonts/LM-italic.woff2') format('woff2'),url('./fonts/LM-italic.woff') format('woff'),url('./fonts/LM-italic.ttf') format('truetype')}@font-face{font-family:'Latin Modern';font-style:normal;font-weight:bold;font-display:swap;src:url('./fonts/LM-bold.woff2') format('woff2'),url('./fonts/LM-bold.woff') format('woff'),url('./fonts/LM-bold.ttf') format('truetype')}@font-face{font-family:'Latin Modern';font-style:italic;font-weight:bold;font-display:swap;src:url('./fonts/LM-bold-italic.woff2') format('woff2'),url('./fonts/LM-bold-italic.woff') format('woff'),url('./fonts/LM-bold-italic.ttf') format('truetype')}@font-face{font-family:'Libertinus';font-style:normal;font-weight:normal;font-display:swap;src:url('./fonts/Libertinus-regular.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:italic;font-weight:normal;font-display:swap;src:url('./fonts/Libertinus-italic.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:normal;font-weight:bold;font-display:swap;src:url('./fonts/Libertinus-bold.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:italic;font-weight:bold;font-display:swap;src:url('./fonts/Libertinus-bold-italic.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:normal;font-weight:600;font-display:swap;src:url('./fonts/Libertinus-semibold.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:italic;font-weight:600;font-display:swap;src:url('./fonts/Libertinus-semibold-italic.woff2') format('woff2')}*,*::before,*::after{box-sizing:border-box}:root{--body-color:hsl(0,5%,10%);--body-bg-color:hsl(210,20%,98%);--link-visited:hsl(0,100%,33%);--link-focus-outline:hsl(220,90%,52%);--pre-bg-color:hsl(210,28%,93%);--kbd-bg-color:hsl(210,5%,100%);--kbd-border-color:hsl(210,5%,70%);--table-border-color:black;--sidenote-target-border-color:hsl(55,55%,70%);--footnotes-border-color:hsl(0,0%,39%)}.latex-dark{--body-color:hsl(0,0%,86%);--body-bg-color:hsl(0,0%,16%);--link-visited:hsl(196 80% 77%);--link-focus-outline:hsl(215,63%,73%);--pre-bg-color:hsl(0,1%,25%);--kbd-bg-color:hsl(0,0%,16%);--kbd-border-color:hsl(210,5%,70%);--table-border-color:white;--sidenote-target-border-color:hsl(0,0%,59%);--footnotes-border-color:hsl(0,0%,59%);--proof-symbol-filter:invert(80%)}@media(prefers-color-scheme:dark){.latex-dark-auto{--body-color:hsl(0,0%,86%);--body-bg-color:hsl(0,0%,16%);--link-visited:hsl(196 80% 77%);--link-focus-outline:hsl(215,63%,73%);--pre-bg-color:hsl(0,1%,25%);--kbd-bg-color:hsl(0,0%,16%);--kbd-border-color:hsl(210,5%,70%);--table-border-color:white;--sidenote-target-border-color:hsl(0,0%,59%);--footnotes-border-color:hsl(0,0%,59%);--proof-symbol-filter:invert(80%)}}body,h1,h2,h3,h4,p,ul[class],ol[class],li,figure,figcaption,dl,dd{margin:0}html{font-size:1rem}@media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}body.libertinus{font-family:'Libertinus',Georgia,Cambria,'Times New Roman',Times,serif}body{font-family:'Latin Modern',Georgia,Cambria,'Times New Roman',Times,serif;line-height:1.8;max-width:80ch;min-height:100vh;overflow-x:hidden;margin:0 auto;padding:2rem 1.25rem;counter-reset:theorem;counter-reset:definition;counter-reset:sidenote-counter;color:var(--body-color);background-color:var(--body-bg-color);text-rendering:optimizeLegibility}p{text-align:justify;hyphens:auto;-webkit-hyphens:auto;-moz-hyphens:auto;margin-top:1rem}a:not([class]){text-decoration-skip-ink:auto}a,a:visited{color:var(--link-visited)}a:focus{outline-offset:2px;outline:2px solid var(--link-focus-outline)}img{max-width:100%;height:auto;display:block}input,button,textarea,select{font:inherit}textarea{width:100%}article>*+*{margin-top:1em}code,pre,kbd{font-family:Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace;font-size:85%}pre{padding:1rem 1.4rem;max-width:100%;overflow:auto;border-radius:4px;background:var(--pre-bg-color)}pre code{font-size:95%;position:relative}kbd{background:var(--kbd-bg-color);border:1px solid var(--kbd-border-color);border-radius:2px;padding:2px 4px;font-size:75%}table{border-collapse:collapse;border-spacing:0;width:auto;max-width:100%;border-top:2.27px solid var(--table-border-color);border-bottom:2.27px solid var(--table-border-color);overflow-x:auto;counter-increment:caption}table tr>th[scope='col']{border-bottom:1.36px solid var(--table-border-color)}table tr>th[scope='row']{border-right:1.36px solid var(--table-border-color)}table>tbody>tr:first-child>td,table>tbody>tr:first-child>th{border-top:1.36px solid var(--table-border-color)}table>tbody>tr:last-child>td,table>tbody>tr:last-child>th{border-bottom:1.36px solid var(--table-border-color)}th,td{text-align:left;padding:.5rem;line-height:1.1}caption{text-align:left;font-size:.923em;padding:0 .25em .25em;width:100%;margin-left:0}caption::before{content:'Table ' counter(caption) '. ';font-weight:bold}.scroll-wrapper{overflow-x:auto}.scroll-wrapper>table td{white-space:nowrap}h1:first-child{text-align:center}nav ol{counter-reset:item;padding-left:2rem}nav li{display:block}nav li:before{content:counters(item,'.') ' ';counter-increment:item;padding-right:.85rem}dl dd{text-align:center}.theorem{counter-increment:theorem;display:block;margin:12px 0;font-style:italic}.theorem::before{content:'Theorem ' counter(theorem) '. ';font-weight:bold;font-style:normal}.lemma{counter-increment:theorem;display:block;margin:12px 0;font-style:italic}.lemma::before{content:'Lemma ' counter(theorem) '. ';font-weight:bold;font-style:normal}.proof{display:block;margin:12px 0;font-style:normal;position:relative}.proof::before{content:'Proof. ' attr(title);font-style:italic}.proof:after{content:'◾️';filter:var(--proof-symbol-filter);position:absolute;right:-12px;bottom:-2px}.definition{counter-increment:definition;display:block;margin:12px 0;font-style:normal}.definition::before{content:'Definition ' counter(definition) '. ';font-weight:bold;font-style:normal}.author{margin:.85rem 0;font-variant-caps:small-caps;text-align:center}.sidenote{font-size:.8rem;float:right;clear:right;width:18vw;margin-right:-20vw;margin-bottom:1em}.sidenote.left{float:left;margin-left:-20vw;margin-bottom:1em}.sidenote:target{border:var(--sidenote-target-border-color) 1.5px solid;padding:0 .5rem;scroll-margin-block-start:10rem}.sidenote-number{counter-increment:sidenote-counter}.sidenote-number::after,.sidenote::before{position:relative;vertical-align:baseline}.sidenote-number::after{content:counter(sidenote-counter);font-size:.7rem;top:-0.5rem;left:.1rem}.sidenote-number ~ .sidenote::before{content:counter(sidenote-counter) ' ';font-size:.7rem;top:-0.5rem}label.sidenote-toggle:not(.sidenote-number){display:none}blockquote .sidenote{margin-right:-24vw;width:18vw}label.sidenote-toggle{display:inline;cursor:pointer}input.sidenote-toggle{display:none}@media(max-width:1050px){label.sidenote-toggle:not(.sidenote-number){display:inline}.sidenote{display:none}.sidenote-toggle:checked+.sidenote{display:block;margin:.5rem 1.25rem 1rem .5rem;float:left;left:1rem;clear:both;width:95%}blockquote .sidenote{margin-right:-25vw;width:16vw}}.footnotes p{text-align:left;line-height:1.5;font-size:85%;margin-bottom:.4rem}.footnotes{border-top:1px solid var(--footnotes-border-color)}.abstract,.abstract p{text-align:center;margin-top:0}.abstract{margin:2.25rem 0}.abstract>h2{font-size:1rem;margin-bottom:-0.2rem}.latex span:nth-child(1){text-transform:uppercase;font-size:.75em;vertical-align:.28em;margin-left:-0.48em;margin-right:-0.15em;line-height:1ex}.latex span:nth-child(2){text-transform:uppercase;vertical-align:-0.5ex;margin-left:-0.1667em;margin-right:-0.125em;line-height:1ex}h1{font-size:2.5rem;line-height:3.25rem;margin-bottom:1.625rem}h2{font-size:1.7rem;line-height:2rem;margin-top:3rem}h3{font-size:1.4rem;margin-top:2.5rem}h4{font-size:1.2rem;margin-top:2rem}h5{font-size:1rem;margin-top:1.8rem}h6{font-size:1rem;font-style:italic;font-weight:normal;margin-top:2.5rem}h3,h4,h5,h6{line-height:1.625rem}h1+h2{margin-top:1.625rem}h2+h3,h3+h4,h4+h5{margin-top:.8rem}h5+h6{margin-top:-0.8rem}h2,h3,h4,h5,h6{margin-bottom:.8rem} +*/@font-face{font-family:'Latin Modern';font-style:normal;font-weight:normal;font-display:swap;src:url('./fonts/LM-regular.woff2') format('woff2'),url('./fonts/LM-regular.woff') format('woff'),url('./fonts/LM-regular.ttf') format('truetype')}@font-face{font-family:'Latin Modern';font-style:italic;font-weight:normal;font-display:swap;src:url('./fonts/LM-italic.woff2') format('woff2'),url('./fonts/LM-italic.woff') format('woff'),url('./fonts/LM-italic.ttf') format('truetype')}@font-face{font-family:'Latin Modern';font-style:normal;font-weight:bold;font-display:swap;src:url('./fonts/LM-bold.woff2') format('woff2'),url('./fonts/LM-bold.woff') format('woff'),url('./fonts/LM-bold.ttf') format('truetype')}@font-face{font-family:'Latin Modern';font-style:italic;font-weight:bold;font-display:swap;src:url('./fonts/LM-bold-italic.woff2') format('woff2'),url('./fonts/LM-bold-italic.woff') format('woff'),url('./fonts/LM-bold-italic.ttf') format('truetype')}@font-face{font-family:'Libertinus';font-style:normal;font-weight:normal;font-display:swap;src:url('./fonts/Libertinus-regular.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:italic;font-weight:normal;font-display:swap;src:url('./fonts/Libertinus-italic.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:normal;font-weight:bold;font-display:swap;src:url('./fonts/Libertinus-bold.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:italic;font-weight:bold;font-display:swap;src:url('./fonts/Libertinus-bold-italic.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:normal;font-weight:600;font-display:swap;src:url('./fonts/Libertinus-semibold.woff2') format('woff2')}@font-face{font-family:'Libertinus';font-style:italic;font-weight:600;font-display:swap;src:url('./fonts/Libertinus-semibold-italic.woff2') format('woff2')}*,*::before,*::after{box-sizing:border-box}:root{--body-color:hsl(0,5%,10%);--body-bg-color:hsl(210,20%,98%);--link-visited:hsl(0,100%,33%);--link-focus-outline:hsl(220,90%,52%);--pre-bg-color:hsl(210,28%,93%);--kbd-bg-color:hsl(210,5%,100%);--kbd-border-color:hsl(210,5%,70%);--table-border-color:black;--sidenote-target-border-color:hsl(55,55%,70%);--footnotes-border-color:hsl(0,0%,39%);--text-indent-size:1.463rem}.latex-dark{--body-color:hsl(0,0%,86%);--body-bg-color:hsl(0,0%,16%);--link-visited:hsl(196 80% 77%);--link-focus-outline:hsl(215,63%,73%);--pre-bg-color:hsl(0,1%,25%);--kbd-bg-color:hsl(0,0%,16%);--kbd-border-color:hsl(210,5%,70%);--table-border-color:white;--sidenote-target-border-color:hsl(0,0%,59%);--footnotes-border-color:hsl(0,0%,59%);--proof-symbol-filter:invert(80%)}@media(prefers-color-scheme:dark){.latex-dark-auto{--body-color:hsl(0,0%,86%);--body-bg-color:hsl(0,0%,16%);--link-visited:hsl(196 80% 77%);--link-focus-outline:hsl(215,63%,73%);--pre-bg-color:hsl(0,1%,25%);--kbd-bg-color:hsl(0,0%,16%);--kbd-border-color:hsl(210,5%,70%);--table-border-color:white;--sidenote-target-border-color:hsl(0,0%,59%);--footnotes-border-color:hsl(0,0%,59%);--proof-symbol-filter:invert(80%)}}body,h1,h2,h3,h4,p,ul[class],ol[class],li,figure,figcaption,dl,dd{margin:0}html{font-size:1rem}@media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}body.libertinus{font-family:'Libertinus',Georgia,Cambria,'Times New Roman',Times,serif}body{font-family:'Latin Modern',Georgia,Cambria,'Times New Roman',Times,serif;line-height:1.8;max-width:80ch;min-height:100vh;overflow-x:hidden;margin:0 auto;padding:2rem 1.25rem;counter-reset:theorem definition sidenote-counter;color:var(--body-color);background-color:var(--body-bg-color);text-rendering:optimizeLegibility}p{text-align:justify;hyphens:auto;-webkit-hyphens:auto;-moz-hyphens:auto;margin-top:1rem}.indent-pars p{text-indent:var(--text-indent-size)}.indent-pars p.no-indent,p.no-indent{text-indent:0}.indent-pars ol p,.indent-pars ul p{text-indent:0}.indent-pars h2+p,.indent-pars h3+p,.indent-pars h4+p{text-indent:0}a:not([class]){text-decoration-skip-ink:auto}a,a:visited{color:var(--link-visited)}a:focus{outline-offset:2px;outline:2px solid var(--link-focus-outline)}img{max-width:100%;height:auto;display:block}input,button,textarea,select{font:inherit}textarea{width:100%}article>*+*{margin-top:1em}code,pre,kbd{font-family:Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace;font-size:85%}pre{padding:1rem 1.4rem;max-width:100%;overflow:auto;border-radius:4px;background:var(--pre-bg-color)}pre code{font-size:95%;position:relative}kbd{background:var(--kbd-bg-color);border:1px solid var(--kbd-border-color);border-radius:2px;padding:2px 4px;font-size:75%}table{border-collapse:collapse;border-spacing:0;width:auto;max-width:100%;border-top:2.27px solid var(--table-border-color);border-bottom:2.27px solid var(--table-border-color);overflow-x:auto;counter-increment:caption}table tr>th[scope='col']{border-bottom:1.36px solid var(--table-border-color)}table tr>th[scope='row']{border-right:1.36px solid var(--table-border-color)}table>tbody>tr:first-child>td,table>tbody>tr:first-child>th{border-top:1.36px solid var(--table-border-color)}table>tbody>tr:last-child>td,table>tbody>tr:last-child>th{border-bottom:1.36px solid var(--table-border-color)}th,td{text-align:left;padding:.5rem;line-height:1.1}caption{text-align:left;font-size:.923em;padding:0 .25em .25em;width:100%;margin-left:0}caption::before{content:'Table ' counter(caption) '. ';font-weight:bold}.scroll-wrapper{overflow-x:auto}.scroll-wrapper>table td{white-space:nowrap}h1:first-child{text-align:center}nav ol{counter-reset:item;padding-left:2rem}nav li{display:block}nav li:before{content:counters(item,'.') ' ';counter-increment:item;padding-right:.85rem}dl dd{text-align:center}.theorem{counter-increment:theorem;display:block;margin:12px 0;font-style:italic}.theorem::before{content:'Theorem ' counter(theorem) '. ';font-weight:bold;font-style:normal}.lemma{counter-increment:theorem;display:block;margin:12px 0;font-style:italic}.lemma::before{content:'Lemma ' counter(theorem) '. ';font-weight:bold;font-style:normal}.proof{display:block;margin:12px 0;font-style:normal;position:relative}.proof::before{content:'Proof. ' attr(title);font-style:italic}.proof:after{content:'◾️';filter:var(--proof-symbol-filter);position:absolute;right:-12px;bottom:-2px}.definition{counter-increment:definition;display:block;margin:12px 0;font-style:normal}.definition::before{content:'Definition ' counter(definition) '. ';font-weight:bold;font-style:normal}.author{margin:.85rem 0;font-variant-caps:small-caps;text-align:center}.sidenote{font-size:.8rem;float:right;clear:right;width:18vw;margin-right:-20vw;margin-bottom:1em;text-indent:0}.sidenote.left{float:left;margin-left:-20vw;margin-bottom:1em;text-indent:0}.sidenote:target{border:var(--sidenote-target-border-color) 1.5px solid;padding:0 .5rem;scroll-margin-block-start:10rem}.sidenote-number{counter-increment:sidenote-counter}.sidenote-number::after,.sidenote::before{position:relative;vertical-align:baseline}.sidenote-number::after{content:counter(sidenote-counter);font-size:.7rem;top:-0.5rem;left:.1rem}.sidenote-number ~ .sidenote::before{content:counter(sidenote-counter) ' ';font-size:.7rem;top:-0.5rem}label.sidenote-toggle:not(.sidenote-number){display:none}blockquote .sidenote{margin-right:-24vw;width:18vw}label.sidenote-toggle{display:inline;cursor:pointer}input.sidenote-toggle{display:none}@media(max-width:1050px){label.sidenote-toggle:not(.sidenote-number){display:inline}.sidenote{display:none}.sidenote-toggle:checked+.sidenote{display:block;margin:.5rem 1.25rem 1rem .5rem;float:left;left:1rem;clear:both;width:95%}blockquote .sidenote{margin-right:-25vw;width:16vw}}.footnotes p{text-align:left;line-height:1.5;font-size:85%;margin-bottom:.4rem}.footnotes{border-top:1px solid var(--footnotes-border-color)}.abstract,.abstract p{text-align:center;margin-top:0}.abstract{margin:2.25rem 0}.abstract>h2{font-size:1rem;margin-bottom:-0.2rem}.latex span:nth-child(1){text-transform:uppercase;font-size:.75em;vertical-align:.28em;margin-left:-0.48em;margin-right:-0.15em;line-height:1ex}.latex span:nth-child(2){text-transform:uppercase;vertical-align:-0.5ex;margin-left:-0.1667em;margin-right:-0.125em;line-height:1ex}h1{font-size:2.5rem;line-height:3.25rem;margin-bottom:1.625rem}h2{font-size:1.7rem;line-height:2rem;margin-top:3rem}h3{font-size:1.4rem;margin-top:2.5rem}h4{font-size:1.2rem;margin-top:2rem}h5{font-size:1rem;margin-top:1.8rem}h6{font-size:1rem;font-style:italic;font-weight:normal;margin-top:2.5rem}h3,h4,h5,h6{line-height:1.625rem}h1+h2{margin-top:1.625rem}h2+h3,h3+h4,h4+h5{margin-top:.8rem}h5+h6{margin-top:-0.8rem}h2,h3,h4,h5,h6{margin-bottom:.8rem}