0%

VsCode支持的markdown语法参考

VS Code 使用 Markdown 编写文档

1. 文本部分

1.1 斜体和粗体,删除线

使用 * 和 ** 表示斜体和粗体。

1
示例:这是*斜体*,这是**粗体**。
  • 这是斜体,这是粗体
    使用 ~~ 表示删除线。
    1
    ~~这是一段错误的文本。
  • 这是一段错误的文本。

1.2 分级标题

使用 === 表示一级标题,使用 — 表示二级标题。

你也可以选择在行首加井号表示不同级别的标题 (H1-H6),例如:# H1, ## H2, ### H3,#### H4。

1.3 常用 Emoji & Font-Awesome



更多emoji查看

1.4 引用和注脚

使用 [^keyword] 表示注脚。

标注

1
2
3
4
- 上标:30^th^
- 下标:H~2~O
- 脚注:Content [^1]
[^1]:Hi 这里是一个注脚,会自动拉到最后面排版
  • 上标:30^th^
  • 下标:H2O
  • 脚注:Content [^1]
    [^1]:Hi 这里是一个注脚,会自动拉到最后面排版

缩略:

1
2
3
4
*[HTML]: 超文本标记语言
*[W3C]: World Wide Web Consortium
The HTML specification
is maintained by the W3C.

*[HTML]: 超文本标记语言
*[W3C]: World Wide Web Consortium
The HTML specification
is maintained by the W3C.

1
2
3
4
这里要有空格隔开中文
*[月]: yue4
*[辍]: chuo4
明 明 如 月,何 时 可 辍

*[月]: yue4
*[辍]: chuo4
明 明 如 月,何 时 可 辍

标记

1
==marked==

==marked==

1.5 外链接

1
2
3
[关键词](链接地址 "(可选)添加一个标题")
图片带链接
[![](.//img/01.png '百度')](http://www.baidu.com)

这里是去 百度 的链接

1.6文字引用

1
>                   Only action can relieve the uneasiness.
Only action can relieve the uneasiness.
1
2
3
4
多层嵌套
>天大彭于晏
>>天大彭于晏
>>>天大彭于晏

天大彭于晏

天大彭于晏

天大彭于晏

1.7 内容目录

在段落中填写 [TOC] 以显示全文内容的目录结构。

[TOC]

1.8行内标记

注:用 ` 标记代码块将变成一行
代码

1
2
标记之外`hello 
world`标记之外

标记之外hello world标记之外

1.9支持内嵌CSS样式

代码:

1
<p style="color: #AD5D0F;font-size: 30px; font-family: '宋体';">内联样式</p>

内联样式

1.10 支持html标签

直接使用 HTML 标签,可以设置文字居中,字体颜色等样色(HTML 语法)
代码:

1
<div align="center" style="color:red">VS Code 使用 Markdown 编写文档</div>

演示:

VS Code 使用 Markdown 编写文档

2. 标签分类

在编辑区任意行的列首位置输入以下代码给文稿标签:

标签: 数学 英语 Markdown
Tags: 数学 英语 Markdown

2.0 常用布局

2.1 无序列表

使用 *,+,- 表示无序列表。

示例:

1
2
3
- 无序列表项 一
* 无序列表项 二
+ 无序列表项 三

效果:

  • 无序列表项 一
  • 无序列表项 二
  • 无序列表项 三

    2.2 有序列表(ol-li)

    使用数字和点表示有序列表。
    示例:
    1
    2
    3
    4
    5
    <ol >
    <li>有序列表项 一</li>
    <li>有序列表项 二</li>
    <li>有序列表项 三</li>
    </ol>
    1. 有序列表项 一
    2. 有序列表项 二
    3. 有序列表项 三
    1
    2
    3
    4
    注:序列.后 保持空格
    1. one
    2. two
    3. three
    演示:
  1. one
  2. two
  3. three

2.3 行内代码块

1
用 ```代码```进行包裹

2.4 插入图像

1
使用 ![](图片链接地址'描述') 插入图像。

2.5 表格支持

1
2
3
4
5
6
| 项目        | 价格   |  数量  |
| -------- | -----: | :----: |
| 计算机 | \$1600 | 5 |
| 手机 | \$12 | 12 |
| 管线 | \$1 | 234 |
| > | ce | ce|
项目 价格 数量
计算机 $1600 5
手机 $12 12
管线 $1 234
> ce ce

2.6 定义型列表

1
2
3
4
5
名词 1
: 定义 1(左侧有一个可见的冒号和四个不可见的空格)

代码块 2
: 这是代码块的定义(左侧有一个可见的冒号和四个不可见的空格)
名词 1
定义 1(左侧有一个可见的冒号和四个不可见的空格)
代码块 2
这是代码块的定义(左侧有一个可见的冒号和四个不可见的空格)

2.7表格对齐

注: : 代表对齐方式 ,** : 与 | 之间不要有空格**,否则对齐会有些不兼容

1
2
3
4
5
6
代码

| a | b | c |
|:-------:|:------------- | ----------:|
| 居中 | 左对齐 | 右对齐 |
|=========|===============|============|

演示

a b c
居中 左对齐 右对齐
========= =============== ============

2.8 Html 标签

本站支持在 Markdown 语法中嵌套 Html 标签,譬如,你可以用 Html 写一个纵跨两行的表格:
设置colspan,rowspan
Markdown表格之合并单元格效果

2.8 待办事宜 Todo 列表

使用带有 [ ] 或 [x] (未完成或已完成)项的列表语法撰写一个待办事宜列表,并且支持子列表嵌套以及混用Markdown语法,例如:

3.补充

3.1定义型列表

注:解释型定义

1
2
3
代码:
Markdown
: 轻量级文本标记语言,可以转换成html,pdf等格式 // 开头一个`:` + `Tab` 或 四个空格

Markdown
: 轻量级文本标记语言,可以转换成html,pdf等格式 // 开头一个: + Tab 或 四个空格

3.2自动邮箱链接

代码:

1
<xxx@outlook.com>

演示
1535045887@qq.com

3.3字体,字号与颜色

1
2
3
<font face="STCAIYUN">我是华文彩云</font>
<font color=gray size=5>color=gray</font>
<font color= #0099ff size=5 face="黑体">color=#0099ff size=5 face="黑体"</font>

我是华文彩云
color=gray
color=#0099ff size=5 face=”黑体”

Size:规定文本的尺寸大小。可能的值:从 1 到 7 的数字。浏览器默认值是 3。

##4. 数学和LaTeX
$ 表示行内公式:

质能守恒方程可以用一个很简洁的方程式 E=mc^2 来表达。

$$ 表示整行公式:

1
2
$$\sum_{i=1}^n a_i=0$$
$E=mc^2$

$$\sum_{i=1}^n a_i=0$$
$ E=mc^2$

4.1 常用计算速查

4.2省略号

1
2
3
$ a_1,a_2,\ldots,a_n$
$ a_1+a_2+\ldots+a_n$
$ a_1+a_2+\cdots+a_n$

$ a_1,a_2,\ldots,a_n$
$ a_1+a_2+\ldots+a_n$
$ a_1+a_2+\cdots+a_n$

4.3字体

1
2
3
4
$ \mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}   $
$ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $
$ \mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $
$ \mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $

$ \mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $
$ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $
$ \mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $
$ \mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $

4.4常用公式

1
2
3
4
5
6
7
8
$x_i^2$,$x_i^2+x_{i^2}$,$10^{10}$
$\log_2 x$
${x^y}^z+x^{y^z}$
$\sum^{j-1}_{k=0}{\widehat{\gamma}_{kj} z_k}$
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $
$\displaystyle \lim_{t \to 0} \int_t^1 f(t)\, dt$
$\lim_{t \to 0} \int_t^1 f(t)\, dt$.

$x_i^2$,$x_i^2+x_{i^2}$,$10^{10}$
$\log_2 x$
${x^y}^z+x^{y^z}$
$\sum^{j-1}{k=0}{\widehat{\gamma}{kj} z_k}$
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $
$\displaystyle \lim_{t \to 0} \int_t^1 f(t), dt$
$\lim_{t \to 0} \int_t^1 f(t), dt$.

1
2
如果需要大小调整,大小写切换写
$$\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) gives (((((x)))))$$

$$\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) gives (((((x)))))$$

1
2
3
括号自适应大小
$$(\frac{\sqrt x}{y^3})$$
$$ \left(\frac{\sqrt x}{y^3}\right)$$

$$(\frac{\sqrt x}{y^3})$$
$$ \left(\frac{\sqrt x}{y^3}\right)$$

4.5等式

1
2
3
4
5
6
7
$$
\begin{aligned}
a &= b + c \\
&= d + e + f + g \\
&= h + i
\end{aligned}
$$

$$
\begin{aligned}
a &= b + c \
&= d + e + f + g \
&= h + i
\end{aligned}
$$

4.6矩阵

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
$
\begin{matrix}
1 & x & x^2 \\
1 & y & y^2 \\
1 & z & z^2 \\
\end{matrix}
$ , $
\begin{pmatrix}
1 & 2 \\
1 & 2 \\
\end{pmatrix}
$ , $
\begin{bmatrix}
1 & 2 \\
1 & 2 \\
\end{bmatrix}
$ , $
\begin{Bmatrix}
1 & 2 \\
1 & 2 \\
\end{Bmatrix}
$ , $
\begin{vmatrix}
1 & 2 \\
1 & 2 \\
\end{vmatrix}
$ , $
\begin{Vmatrix}
1 & 2 \\
1 & 2 \\
\end{Vmatrix}
$

$
\begin{matrix}
1 & x & x^2 \
1 & y & y^2 \
1 & z & z^2 \
\end{matrix}
$ , $
\begin{pmatrix}
1 & 2 \
1 & 2 \
\end{pmatrix}
$ , $
\begin{bmatrix}
1 & 2 \
1 & 2 \
\end{bmatrix}
$ , $
\begin{Bmatrix}
1 & 2 \
1 & 2 \
\end{Bmatrix}
$ , $
\begin{vmatrix}
1 & 2 \
1 & 2 \
\end{vmatrix}
$ , $
\begin{Vmatrix}
1 & 2 \
1 & 2 \
\end{Vmatrix}
$

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
省略元素 \cdots\ddots ⋱ vdots ⋮


$$
\begin{matrix}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\
a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & a_{n3} & \cdots & a_{2n} \\
\end{matrix}
$$

$$ \left[
\begin{array}{cc|c}
1&2&3\\
4&5&6
\end{array}
\right]
$$


$$
f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
$$


$$
\left.
\begin{array}{l}
\text{if $n$ is even:}&n/2\\
\text{if $n$ is odd:}&3n+1
\end{array}
\right\}
=f(n)
$$

$$
\begin{matrix}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \
a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \
\vdots & \vdots & \vdots & \ddots & \vdots \
a_{n1} & a_{n2} & a_{n3} & \cdots & a_{2n} \
\end{matrix}
$$

$$ \left[
\begin{array}{cc|c}
1&2&3\
4&5&6
\end{array}
\right]
$$

$$
f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \
3n+1, & \text{if $n$ is odd}
\end{cases}
$$

$$
\left.
\begin{array}{l}
\text{if $n$ is even:}&n/2\
\text{if $n$ is odd:}&3n+1
\end{array}
\right}
=f(n)
$$

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
上下行的间距调整 ex
$$
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \\[5ex]
3n+1, & \text{if $n$ is odd}
\end{cases}
$$


$$
\left\{
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\
a_2x+b_2y+c_2z=d_2 \\
a_3x+b_3y+c_3z=d_3
\end{array}
\right.
$$

$$
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \[5ex]
3n+1, & \text{if $n$ is odd}
\end{cases}
$$

$$
\left{
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \
a_2x+b_2y+c_2z=d_2 \
a_3x+b_3y+c_3z=d_3
\end{array}
\right.
$$

aligned 对齐

1
2
3
4
5
6
7
8
9
$$ 
\left\{
\begin{aligned}
a_1x+b_1y+c_1z &=d_1+e_1 \\
a_2x+b_2y&=d_2 \\
a_3x+b_3y+c_3z &=d_3
\end{aligned}
\right.
$$

$$
\left{
\begin{aligned}
a_1x+b_1y+c_1z &=d_1+e_1 \
a_2x+b_2y&=d_2 \
a_3x+b_3y+c_3z &=d_3
\end{aligned}
\right.
$$

1
2
3
4
5
6
7
继续用em调整行距
$$\begin{cases}
a_1x+b_1y+c_1z=d_1 \\[2ex]
a_2x+b_2y+c_2z=d_2 \\[2ex]
a_3x+b_3y+c_3z=d_3
\end{cases}
$$

$$\begin{cases}
a_1x+b_1y+c_1z=d_1 \[2ex]
a_2x+b_2y+c_2z=d_2 \[2ex]
a_3x+b_3y+c_3z=d_3
\end{cases}
$$

颜色

5.流程图

5.1简单流程图

流程图语法参考

5.2序列图x`

代码:

效果:

1
2
3
4
A->>B: 你好
Note left of A: 我在左边
Note right of B: 我在右边
B-->A: 很高兴认识你
1
2
3
4
5
6
7
8
9
起床->吃饭: 稀饭油条
吃饭->上班: 不要迟到了
上班->午餐: 吃撑了
上班->下班:
Note right of 下班: 下班了
下班->回家:
Note right of 回家: 到家了
回家-->>起床:
Note left of 起床: 新的一天

未完待续….

5.3mermaid 甘特图

5.4 puml 序列图

5.5 dot

Thank you for your support