Markdown

Markdown语法检索

Posted by Ryan Yim on 2020-10-03
Estimated Reading Time 15 Minutes
Words 2.9k In Total
Viewed Times

Common Markdown references.

Markdown 语法检索

帮助文档(Docs) > https://commonmark.org/help/

语法 别称 效果 备注
*Italic* _Italic_ Italic 斜体
**Bold** __Bold__ Bold 粗体
# Heading 1 Heading 1
=========
见下方 一级标题
## Heading 2 Heading 2
---------
见下方 二级标题
[Link](http://a.com) [Link][1]

[1]: http://b.org
百度 超链接
![Image](http://url/a.png) ![Image][1]

[1]: http://url/b.jpg
Github 图片
> Blockquote 见下方 段落
* List
* List
* List
- List
- List
- List
见下方 无序列表
1. One
2. Two
3. Three
1. One
2. Two
3. Three
1. One
2. Two
3. Three
有序列表
Horizontal Rule

---
Horizontal Rule

***
Horizontal Rule

—-
水平分割线
`Inline code` with backticks Inline code with backticks 单行代码
```
# code block
print ‘3 backticks or’
print ‘indent 4 spaces’
```
···# code block
····print '3 backticks or'
····print 'indent 4 spaces'
见下方 代码块
- [] 清单
- [x] 打勾的
- [] 清单
- [x] 打勾的
清单
~~删除~~ 删除 删除线
<u>下划线</u> 下划线 下划线
$$$
公式
$$$
数学公式
[1]: xxxx [0]: sss 脚标

尝试 - Try it :

Bilibili

1
<p><iframe src="//player.bilibili.com/player.html?aid=797031703&bvid=BV1Ey4y1y7Qr&cid=234096629&page=1" frameborder="no" scrolling="no" width="95%" height="600" border="0" framespacing="0" allowfullscreen="true"></iframe></p>

插入下载链接

1
<a href="文件路径" download="下载的文件名">链接名称</a>

插入iframe网页

1
2
3
4
5
6
7
8
9
10
11
 <iframe  
height=1000
width=100%
src="网页链接"
frameborder=0
allowfullscreen>
</iframe>

> https://www.sunzhongwei.com/video-websites-embed-bilibili-iframe-code-video-disable-play-automatically

网站中嵌入 B 站视频,禁止 iframe 代码中的视频自动播放: 禁用方法很简单,就是在视频 url 链接最后加上 autoplay=0

Gitalk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---

Gitalk:

<p>
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk@latest/dist/gitalk.min.js"></script>
</p>
<div id="gitalk-container"></div>
<p>
<script type='text/javascript'>
var gitalk = new Gitalk({
clientID: '',
clientSecret: '',
repo: '',
owner: '',
admin: [''],
distractionFreeMode: false // Facebook-like distraction free mode
})
gitalk.render('gitalk-container')
</script>
</p>


---

时序图

Hexo自带:

graph LR 绘图 —> 导出图像 导出图像 —> 上传服务器 上传服务器 —> 文章插入

Flowchart示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
```flow
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.baidu.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
```
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
~~~
​```flow
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.baidu.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e

~~~

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

## 数学公式

### 来源 - 1

- [MathJax - Example](https://jsbin.com/?html,output)

然后粘贴以下代码:

```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>MathJax example</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js">
</script>
</head>
<body>
<p>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]
</p>
</body>
</html>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
数学公式快速复制 - 对照在下方
左括号 \left\{\begin{matrix}\end{matrix}\right.\\
或者: \begin{cases}\end{cases}\\
右括号 \left.\begin{matrix}\end{matrix}\right\}\\
上标 x^1
下标 y_1 ^1_2y^2_4 x^{2019}
换行 \\
空格 \
分数 1\frac{2}{3}4
省略号 \cdots

$$f(x_1,x_2,\underbrace{\ldots}_{\rm ldots} ,x_n) = x_1^2 + x_2^2 + \underbrace{\cdots}_{\rm cdots} + x_n^2$$

格式:\\
A\left\{\begin{matrix}
b\\
c\\
d\\
\end{matrix}\right.
e
\left.\begin{matrix}
f\\
g\\
\end{matrix}\right\}\\

\left\{\begin{matrix}
b\\
c\\
d\\
\end{matrix}\right.
\left.\begin{matrix}
b\\
c\\
d\\
\end{matrix}\right\}
\\
\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)

来源 - 2

如何插入公式

LaTeX的数学公式有两种:行中公式和独立公式。行中公式放在文中与其它文字混编,独立公式单独成行。

例子:
\$[J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha}\]$

显示: [Jα(x)=∑m=0∞(−1)mm!Γ(m+α+1)(x2)2m+α]

如何插入公式大括号
矩阵:
1
2
3
4
5
6
7
$$
\begin{bmatrix} 1&x&x^2\\ 1&y&y^2\\ 1&z&z^2 \end{bmatrix}
\\
\begin{bmatrix} 1&x&x^2\\\\ 1&y&y^2\\\\ 1&z&z^2 \end{bmatrix}
\\
vmatrix ||、Bmatrix{}、pmatrix()
$$
分段函数:
1
2
3
4
5
6
7
$$
f(x)=
\begin{cases}
0& \text{x=0}\\\\
1& \text{x!=0}
\end{cases}
$$

矩阵:

分段函数:

如何输入上下标

^表示上标, _表示下标。如果上下标的内容多于一个字符,要用{}把这些内容括起来当成一个整体。上下标是可以嵌套的,也可以同时使用。

例子:

显示:

另外,如果要在左右两边都有上下标,可以用\sideset命令。

例子:

显示:

如何输入括号和分隔符

()、[]和|表示自己,{}表示{}。当要显示大号的括号或分隔符时,要用\left和\right命令。

例子:

显示:

有时候要用\left.或\right.进行匹配而不显示本身。 例子:`\left. \frac{{\rm d}u}{{\rm d}x} \right| _{x=0}` 显示: $$ \left. \frac{{\rm d}u}{{\rm d}x} \right| _{x=0} $$
如何输入分数

例子:

显示:

如何输入开方

例子:

显示:

如何输入省略号

数学公式中常见的省略号有两种,\ldots表示与文本底线对齐的省略号,\cdots表示与文本中线对齐的省略号。

例子:

显示:

如何输入矢量

例子:

显示

如何输入积分

例子:

显示:

如何输入极限运算

例子:

1
2
$\lim\limits_{n \rightarrow +\infty} \frac{1}{n(n+1)}$ 
$$\lim_{n \rightarrow +\infty} \frac{1}{n(n+1)}$$

显示:

如何输入累加、累乘运算**

例子:

显示:

如何进行公式应用

例子:

显示:

如何输入希腊字母

例子:

1
2
3
4
5
6
\alpha A \beta B \gamma \Gamma \delta \Delta \epsilon E 
\varepsilon  \zeta Z \eta H \theta \Theta \vartheta
\iota I \kappa K \lambda \Lambda \mu M \nu N
\xi \Xi o O \pi \Pi \varpi  \rho P
\varrho  \sigma \Sigma \varsigma  \tau T \upsilon \Upsilon
\phi \Phi \varphi  \chi X \psi \Psi \omega \Omega
如何输入其它特殊字符
关系运算符:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
±:\pm 
×:\times
÷:\div
∣:\mid
∤:\nmid
⋅:\cdot
∘:\circ
∗:\ast
⨀:\bigodot
⨂:\bigotimes
⨁:\bigoplus
≤:\leq
≥:\geq
≠:\neq
≈:\approx
≡:\equiv
∑:\sum
∏:\prod
∐:\coprod
集合运算符:
1
2
3
4
5
6
7
8
9
10
11
12
13
∅:\emptyset 
∈:\in
∉:\notin
⊂:\subset
⊃:\supset
⊆:\subseteq
⊇:\supseteq
⋂:\bigcap
⋃:\bigcup
⋁:\bigvee
⋀:\bigwedge
⨄:\biguplus
⨆:\bigsqcup
对数运算符:
1
2
3
log:\log 
lg:\lg
ln:\ln
三角运算符:
1
2
3
4
5
6
7
8
9
⊥:\bot 
∠:\angle
30∘:30^\circ
sin:\sin
cos:\cos
tan:\tan
cot:\cot
sec:\sec
csc:\csc
微积分运算符:
1
2
3
4
5
6
7
8
9
′:\prime 
∫:\int
∬:\iint
∭:\iiint
⨌:\iiiint
∮:\oint
lim:\lim
∞:\infty
∇:\nabla
逻辑运算符:
1
2
3
4
5
6
7
∵:\because 
∴:\therefore
∀:\forall
∃:\exists
≠:\not=
≯:\not>
⊄:\not\subset
戴帽符号:
1
2
3
\hat{y} 
\check{y}
\breve{y}
连线符号:
1
2
3
\overline{a+b+c+d} 
\underline{a+b+c+d}
\overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0}
箭头符号:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
↑:\uparrow 
↓:\downarrow
⇑:\Uparrow
⇓:\Downarrow
→:\rightarrow
←:\leftarrow
⇒:\Rightarrow
⇐:\Leftarrow
⟶:\longrightarrow
⟵:\longleftarrow
⟹:\Longrightarrow
⟸:\Longleftarrow
⟺:\Longleftrightarrow

\mapsto
\longmapsto
\hookleftarrow
\hookrightarrow
\leftharpoonup
\rightharpoonup
\leftharpoondown
\rightharpoondown
\rightleftharpoons
\leadsto
\nearrow
\searrow
\swarrow
\nwarrow
\nleftarrow
\nrightarrow
\nLeftarrow
\nRightarrow
\nleftrightarrow
\nLeftrightarrow
\dashrightarrow
\dashleftarrow
\leftleftarrows
\leftrightarrows
\Lleftarrow
\twoheadleftarrow
\leftarrowtail
\looparrowleft
\leftrightharpoons
\curvearrowleft
\circlearrowleft
\Lsh
\upuparrows
\upharpoonleft
\downharpoonleft
\multimap
\leftrightsquigarrow
\rightrightarrows
\rightleftarrows
\rightrightarrows
\rightleftarrows
\twoheadrightarrow
\rightarrowtail
\looparrowright
\rightleftharpoons
\curvearrowright
\circlearrowright
\Rsh
\downdownarrows
\upharpoonright
\downharpoonright
\rightsquigarrow

要输出字符 空格 # $ % &  { } ,用命令: `\空格 # $ \% \&  { }`

如何进行字体转换

要对公式的某一部分字符进行字体转换,可以用{\rm 需转换的部分字符}命令,其中\rm可以参照下表选择合适的字体。一般情况下,公式默认为意大利体。

1
2
3
4
5
\rm  罗马体       \it  意大利体 
\bf  黑体        \cal  花体
\sl  倾斜体       \sf  等线体
\mit  数学斜体      \tt  打字机字体
\sc  小体大写字母

使用\mathbb\Bbb来显示黑板粗体字,NQRZ

使用\mathbf来显示粗体字,A**BCDabcd**

使用\mathtt来显示打印式字体,ABCDabcd

使用\mathrm来显示罗马字体,ABCDabcd

使用\mathcal来显示手写字体,ABCDabc**d

使用\mathscr来显示剧本字体,ABCDabcd

使用\mathfrak来显示Fraktur字母(一种旧的德国字体),ABCDabcd

来源 - 3

来源 简书

分数,平方

算式 markdown
7x+51+y27x+51+y2 \frac{7x+5}{1+y^2}

下标

算式 markdown
z=z**lz=zl z=z_l

省略号

省略号 markdown
⋯⋯ \cdots

行间公式(使用两个$包含公式可以独立一行)

行间公式 markdown
ddxea**x=aea**xi=1n(X**iX¯¯¯¯)2ddxeax=aeax∑i=1n(Xi−X¯)2 \frac{d}{dx}e^{ax}=ae^{ax}\quad \sum_{i=1}^{n}{(X_i - \overline{X})^2}

开根号

算式 markdown
2–√;3–√n2;3n \sqrt{2};\sqrt[n]{3}

矢量

算式 markdown
a⃗ ⋅b⃗ =0a→⋅b→=0 \vec{a} \cdot \vec{b}=0

积分

算式 markdown
∫23x2dx∫32x2dx \int ^2_3 x^2 {\rm d}x

极限

算式 markdown
limn→+∞nlimn→+∞n \lim_{n\rightarrow+\infty} n

累加

算式 markdown
∑1i2∑1i2 \sum \frac{1}{i^2}

累乘

算式 markdown
∏1i2∏1i2 \prod \frac{1}{i^2}

希腊字母

大写 markdown 小写 markdown
AA A αα \alpha
BB B ββ \beta
ΓΓ \Gamma γγ \gamma
ΔΔ \Delta δδ \delta
EE E ϵϵ \epsilon
εε \varepsilon
ZZ Z ζζ \zeta
HH H ηη \eta
ΘΘ \Theta θθ \theta
II I ιι \iota
KK K κκ \kappa
ΛΛ \Lambda λλ \lambda
MM M μμ \mu
NN N νν \nu
ΞΞ \Xi ξξ \xi
OO O οο \omicron
ΠΠ \Pi ππ \pi
PP P ρρ \rho
ΣΣ \Sigma σσ \sigma
大写 markdown 小写 markdown
TT T ττ \tau
ΥΥ \Upsilon υυ \upsilon
ΦΦ \Phi ϕϕ \phi
φφ \varphi
XX X χχ \chi
ΨΨ \Psi ψψ \psi
ΩΩ \Omega ωω \omega

三角函数

三角函数 markdown
sinsin \sin

对数函数

算式 markdown
ln15ln⁡15 \ln15
log210log2⁡10 \log_2 10
lg7lg⁡7 \lg7

关系运算符

运算符 markdown
±± \pm
×× \times
÷÷ \div
∑∑ \sum
∏∏ \prod
≠≠ \neq
≤≤ \leq
≥≥ \geq

段落

一段

两段
两段

意大利

11_11_11

列表

无序:

  • 无序列表
  • 无序列表
  • 无序列表

有序:

清单

  • [ ] 清单

  • [x] 清单

- [] 清单

- [x] ??

表格中换行用<br>

水平分割线

上(下面空一行)


代码块

1
2
3
4
这里是代码块
一整块代码
一整块

表格:

1
2
3
||||
|---|---|---|
||||
1 2 3

一级标题

二级标题

三级标题

四级标题

五级标题
六级标题

If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !