feat: basic latex support
parent
8e083d4a93
commit
cc86136bcb
@ -0,0 +1,38 @@
|
||||
---
|
||||
title: "CJK + Latex Test (测试)"
|
||||
---
|
||||
|
||||
## Chinese, Japanese, Korean Support
|
||||
几乎在我们意识到之前,我们已经离开了地面。
|
||||
|
||||
우리가 그것을 알기도 전에 우리는 땅을 떠났습니다.
|
||||
|
||||
私たちがそれを知るほぼ前に、私たちは地面を離れていました。
|
||||
|
||||
## Latex
|
||||
|
||||
Block math works with two dollar signs `$$...$$`
|
||||
|
||||
$$f(x) = \int_{-\infty}^\infty
|
||||
f\hat(\xi\),e^{2 \pi i \xi x}
|
||||
\,d\xi$$
|
||||
|
||||
Inline math also works with single dollar signs `$...$`. For example, Euler's identity but inline: $e^{i\pi} = 0$
|
||||
|
||||
Aligned equations work quite well:
|
||||
|
||||
$$
|
||||
\begin{aligned}
|
||||
a &= b + c \\
|
||||
&= e + f \\
|
||||
\end{aligned}
|
||||
$$
|
||||
|
||||
And matrices
|
||||
|
||||
$$
|
||||
\begin{bmatrix}
|
||||
1 & 2 & 3\\
|
||||
a & b & c
|
||||
\end{bmatrix}
|
||||
$$
|
@ -0,0 +1,21 @@
|
||||
{{if $.Site.Data.config.enableLatex}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css" integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js" integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
renderMathInElement(document.body, {
|
||||
// customised options
|
||||
// • auto-render specific keys, e.g.:
|
||||
delimiters: [
|
||||
{left: '$$', right: '$$', display: true},
|
||||
{left: '$', right: '$', display: false},
|
||||
{left: '\\(', right: '\\)', display: false},
|
||||
{left: '\\[', right: '\\]', display: true}
|
||||
],
|
||||
// • rendering keys, e.g.:
|
||||
throwOnError : false
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
Loading…
Reference in New Issue