KaTeX and Mermaid Test

This article is used to test the KaTeX and Mermaid features.

Configuration

Frontmatter Configuration

YAML
---
katex: true
mermaid: true
---
Click to expand and view more

Global Configuration

YAML
# hugo.yaml
katex:
  enabled: true
  delimiters: 
    - left: "$$"
      right: "$$"
      display: true
    - left: "$"
      right: "$"
      display: false

mermaid:
  enabled: true
Click to expand and view more

KaTeX Test

Inline Formula

This is an inline formula: $E = mc^2$, Einstein’s mass-energy equivalence formula.

Another example:When $a \neq 0$, the solutions to the quadratic equation $ax^2 + bx + c = 0$ are $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$.

Block Formula

Quadratic Formula

$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$

Euler’s Formula

$$e^{i\pi} + 1 = 0$$

Integral Formula

$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$

Matrix Representation

$$\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix}$$

Summation Formula

$$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$

Common Mathematical Symbols Test

Using predefined macros: $\RR$, $\NN$, $\ZZ$, $\QQ$, $\CC$

Copyright Notice

Author: Hugo Narrow

Link: https://hugo-narrow.vercel.app/posts/katex-mermaid-test/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Comments

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K Shortcut