mirror of
https://github.com/vincentdoerig/latex-css.git
synced 2024-09-11 04:46:36 +03:00
feat: adds paragraph first line indentation (#50)
Co-authored-by: Vincent Dörig <dvincdt@gmail.com>
This commit is contained in:
parent
852f05eaa4
commit
dec3909be1
20
index.html
20
index.html
@ -60,6 +60,7 @@
|
|||||||
<li><a href="#definitions">Definitions</a></li>
|
<li><a href="#definitions">Definitions</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a href="#paragraphs">Paragraphs</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#language-support">Language Support</a></li>
|
<li><a href="#language-support">Language Support</a></li>
|
||||||
@ -184,6 +185,25 @@
|
|||||||
or a sign or symbol.<sup><a href="#fn2" id="ref2">2</a></sup>
|
or a sign or symbol.<sup><a href="#fn2" id="ref2">2</a></sup>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h3 id="paragraphs">Paragraphs</h3>
|
||||||
|
<p>
|
||||||
|
In order to get automatic first line indentation of paragraphs, like in
|
||||||
|
default <span class="latex">L<span>a</span>T<span>e</span>X</span> articles, the class
|
||||||
|
<code>indent-pars</code> can be used with <code>article</code> tag.
|
||||||
|
</p>
|
||||||
|
<pre><code class="language-html"><article class="indent-pars">
|
||||||
|
...
|
||||||
|
</article></code></pre>
|
||||||
|
<p>
|
||||||
|
The CSS style provided follows <code>babel</code> specific language rules: by default,
|
||||||
|
the first paragraph after a section title is not indented in English, unlike Spanish and
|
||||||
|
French languages.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
To avoid first line indentation of some specific paragraph, the class <code>no-indent</code>
|
||||||
|
can be used.</p>
|
||||||
|
<pre><code class="language-html"><p class="no-indent">...</p></code></pre>
|
||||||
|
|
||||||
<h2 id="language-support">Language Support</h2>
|
<h2 id="language-support">Language Support</h2>
|
||||||
<p>
|
<p>
|
||||||
The labels of theorems, definitions, lemmas and proofs can be changed
|
The labels of theorems, definitions, lemmas and proofs can be changed
|
||||||
|
@ -2,3 +2,8 @@
|
|||||||
:lang(es) .lemma::before { content: 'Lema ' counter(theorem) '. ' !important; }
|
:lang(es) .lemma::before { content: 'Lema ' counter(theorem) '. ' !important; }
|
||||||
:lang(es) .proof::before { content: 'Demostración. ' attr(title) !important; }
|
:lang(es) .proof::before { content: 'Demostración. ' attr(title) !important; }
|
||||||
:lang(es) .definition::before { content: 'Definición ' counter(definition) '. ' !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);
|
||||||
|
}
|
||||||
|
@ -2,3 +2,8 @@
|
|||||||
:lang(fr) .lemma::before { content: 'Lemme ' counter(theorem) '. ' !important; }
|
:lang(fr) .lemma::before { content: 'Lemme ' counter(theorem) '. ' !important; }
|
||||||
:lang(fr) .proof::before { content: 'Démonstration. ' attr(title) !important; }
|
:lang(fr) .proof::before { content: 'Démonstration. ' attr(title) !important; }
|
||||||
:lang(fr) .definition::before { content: 'Définition ' counter(definition) '. ' !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);
|
||||||
|
}
|
||||||
|
28
style.css
28
style.css
@ -111,6 +111,11 @@
|
|||||||
--table-border-color: black;
|
--table-border-color: black;
|
||||||
--sidenote-target-border-color: hsl(55, 55%, 70%);
|
--sidenote-target-border-color: hsl(55, 55%, 70%);
|
||||||
--footnotes-border-color: hsl(0, 0%, 39%);
|
--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 {
|
.latex-dark {
|
||||||
@ -201,6 +206,27 @@ p {
|
|||||||
margin-top: 1rem;
|
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 elements that don't have a class get default styles */
|
||||||
a:not([class]) {
|
a:not([class]) {
|
||||||
text-decoration-skip-ink: auto;
|
text-decoration-skip-ink: auto;
|
||||||
@ -429,12 +455,14 @@ dl dd {
|
|||||||
width: 18vw;
|
width: 18vw;
|
||||||
margin-right: -20vw;
|
margin-right: -20vw;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
text-indent: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidenote.left {
|
.sidenote.left {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -20vw;
|
margin-left: -20vw;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
text-indent: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (WIP) add border when a sidenote is clicked on */
|
/* (WIP) add border when a sidenote is clicked on */
|
||||||
|
2
style.min.css
vendored
2
style.min.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user