Skip to content

Markdown Cheatsheet

Updated:

Paragraph

Heading1

Heading2

Heading3

Heading4

Heading5
Heading6
# Heading1
## Heading2
### Heading3
#### Heading4
##### Heading5
###### Heading6

Emphasized text

_emphasized text_
or
*Emphasized text*

Strikethrough text

~~Strikethrough text~~

Strong text

**Strong text**

Strong emphasized text

___Strong emphasized text___
or
***Strong emphasized text***

Link

https://www.github.com
or
[Link](https://www.github.com)
or
<https://www.github.com>

Anchor

[Anchor](#paragraph "Goto Paragraph")

Table

Left aligned HeaderRight aligned HeaderCenter aligned Header
Content CellContent CellContent Cell
Content CellContent CellContent Cell
| Left aligned Header | Right aligned Header | Center aligned Header |
|:--------------------|---------------------:|:---------------------:|
| Content Cell        |         Content Cell |     Content Cell      |
| Content Cell        |         Content Cell |     Content Cell      |

List

- Bullet list
  - Nested bullet
    - Sub-nested bullet etc
- Bullet list 2
or
* Bullet list
  * Nested bullet
    * Sub-nested bullet etc
* Bullet list 2
  1. Numbered list
    1. Nested number
    2. Nested number 2
  2. Numbered list 2
1. Numbered list
  1. Nested number
  2. Nested number 2
2. Numbered list 2
- [ ] An uncompleted task
- [x] A completed task

Blockquote

Blockquote

Nested blockquote

> > Blockquote
>
> > Nested blockquote

Horizontal line


---
or
- - -

Image

picture alt

![picture alt](https://github.com/fluidicon.png)

HTML

Title 1

Content 1

<details>
  <summary>Title 1</summary>
  <p>Content 1 Content 1 Content 1 Content 1 Content 1</p>
</details>

Goto Paragraph

<a href="#paragraph">Goto Paragraph</a>
Align Center
<center>Align Center</center>

⌘F

<kbd>⌘F</kbd>

Hotkey list:

KeySymbol
Option
Control
Command
Shift
Caps Lock
Tab
Esc
Power
Return
Delete
Up
Down
Left
Right

x2

x<sup>2</sup>

x2

x<sub>2</sub>

Emoji

😀

😀
or
:smile:

Diff

-window.addEventListener('resize', this.resize);
+window.removeEventListener('resize', this.resize);

Mermaid

Flowchart

Directions

DirectionDescription
TBTop to bottom
TDTop-down/ same as top to bottom
BTBottom to top
RLRight to left
LRLeft to right

Shapes

ShapeDescription
A or B[b]Rect
C(c)Rect width border radius
D((d))Circle
E{e}Ribbon
F{f}Diamond

Connections

ConnectionDescription
A1—>B1Line with arrow
A1—|>B1Line with triangle arrow
A2---B2Line without arrow
A1—*B1Line with solid diamond
A2—oB2Line without diamond
A3—text---B3Line with text
A4—text—>B4Line with arrow and text
A5-.->B5Dotted line with arrow
A5..|>B5Dotted line with triangle arrow
A6-.-B6Dotted line without arrow
A7-.text.-B7Dotted line with text
A8-.text.->B8Dotted line with arrow and text
A9==>B9Bold line with arrow
A10===B10Bold line without arrow
A11==text==>B11Bold line with arrow and text
A12==text===B12Bold line with text

Style

graph LR
  id1(Start)-->id2(Stop)
  style id1 fill:#f9f,stroke:#333,stroke-width:4px
  style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5, 5

Sequence Diagram

sequenceDiagram
  Alice->>John: Hello John, how are you?
  John->>Alice: Hi Alice, I'm good thanks!

Gantt Chart

gantt
  title A Gantt Diagram
  dateFormat  YYYY-MM-DD
  section Section
  A task           :a1, 2024-01-01, 30d
  Another task     :after a1  , 20d

Class Diagram

classDiagram
  Animal <|-- Duck
  Animal <|-- Fish
  Animal : +String name
  Animal : +int age
  Duck : +String beakColor
  Fish : +int fins

State Diagram

stateDiagram-v2
  [*] --> Still
  Still --> [*]
  Still --> Moving
  Moving --> Still
  Moving --> Crash
  Crash --> [*]

Pie Chart

pie title Pets adopted in 2018
  "Dogs" : 386
  "Cats" : 300
  "Rats" : 100

LaTeX

Operators

- $x + y$
- $x - y$
- $x \times y$ 
- $x \div y$
- $\dfrac{x}{y}$
- $\sqrt{x}$ 

Symbols

- $\pi \approx 3.14159$
- $\pm \, 0.2$
- $\dfrac{0}{1} \neq \infty$
- $0 < x < 1$
- $0 \leq x \leq 1$
- $x \geq 10$
- $\forall \, x \in (1,2)$
- $\exists \, x \notin [0,1]$
- $A \subset B$
- $A \subseteq B$
- $A \cup B$
- $A \cap B$
- $X \implies Y$
- $X \impliedby Y$
- $a \to b$
- $a \longrightarrow b$
- $a \Rightarrow b$
- $a \Longrightarrow b$
- $a \propto b$
......

Spaces

\quad   Horizontal space
\qquad  Large horizontal space
\,      Small space
\:      Medium space
\;      Large space
\!      Negative space

Font Sizes

$\Huge Hello!$
$\huge Hello!$
$\LARGE Hello!$
$\Large Hello!$
$\large Hello!$
$\normalsize Hello!$
$\small Hello!$
$\scriptsize Hello!$
$\tiny Hello!$

Greek alphabets

\alpha    A
\beta     B
\gamma    \Gamma
\delta    \Delta
\epsilon  E         \varepsilon
\zeta     Z
\eta      H
\theta    \Theta    \vartheta
\zeta     I
\kappa    K         \varkappa
\lambda   \Lambda
\mu       M
\nu       N
\xi       \Xi
\omicron  O
\pi       \Pi       \varpi
\rho      P         \varrho
\sigma    \Sigma    \varsigma
\tau      T
\upsilon  \Upsilon
\phi      \Phi      \varphi
\chi      X
\psi      \Psi
\omega    \Omega

Functions

$$
f(x)=
\begin{cases}
1/d_{ij} & \quad \text{when $d_{ij} \leq 160$}\\
0 & \quad \text{otherwise}
\end{cases}
$$

Matrix

$$
M =
\begin{bmatrix}
\frac{5}{6} & \frac{1}{6} & 0 \\[0.3em]
\frac{5}{6} & 0 & \frac{1}{6} \\[0.3em]
0 & \frac{5}{6} & \frac{1}{6}
\end{bmatrix}
$$
$$
M =
\begin{pmatrix}
1 & 0 \\
0 & 1
\end{pmatrix}
\begin{pmatrix}
1 & 0 \\
0 & 1
\end{pmatrix}
$$
$$
A_{m,n} =
\begin{pmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{pmatrix}
$$

Reference


Previous Post
专业术语——计算机
Next Post
Git Cheatsheet