Markdown常用语法
第一章 块元素
1.1标题
标题有6个等级,用#号表示
1 | # 标题1 |
1.2引用
使用>字符,表示引用
1 | > This is a blockquote with two paragraphs. This is first paragraph. |
This is a blockquote with two paragraphs. This is first paragraph.
This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.
1.3列表
1 | * red |
- red
- blue
1 | 1. red |
- red
- blue
1.4任务列表
用 [ ] 或者 [X] 未完成,完成)表示列表,通过点击复选框来更改状态(完成/未完成)
1 | - [ ] a task list item |
- a task list item
- list syntax required
- normal formatting, @mentions, #1234 refs
- incomplete
- completed
1.5代码块
使用 ```<语言> 按回车键,将会对代码进行高亮
1 | ```ruby |
1 | require 'redcarpet' |
###1.6数学
可以使用MathJax呈现LaTeX数学表达式
1 | $$ |
$$
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \
\end{vmatrix}
$$
1.7表格
使用 | First Header | Second Header | 按回车键,将会创建2列的表格
1 | | First Header | Second Header | |
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
还可以使用 : 号,来设置文字对齐方式
1 | | Left-Aligned | Center Aligned | Right Aligned | |
Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
col 3 is | some wordy text | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
###1.8 脚注
1 | 使用 [^footnote] 创建脚注. |
You can create footnotes like this[^1].
[^1]: Here is the text of the footnote.
1.10横线
输入 *** 或者 — 后,按回车键
1.11目录
输入 [toc] ,按回车键
[TOC]
第二章 Span元素
2.1链接
文字描述包含在 [] 内,链接地址包含在 () 内,() 要紧接着 [] 后面
1 | This is [an example](http://example.com/ "Title") inline link. |
This is an example inline link.
This link has no title attribute.
2.1.1引用链接
1 | [Bing][] |
Bing
And then define the link:
2.2图片
1 | 在链接格式前面添加 ! ,如下 |
在链接格式前面添加 ! ,如下
###2.3 强调
对应 HTML 的 标签
1 | *single asterisks* |
single asterisks
single underscores
如果像使用 * 号,在 * 号前使用 \
1 | \*this text is surrounded by literal asterisks\* |
*this text is surrounded by literal asterisks*
2.4加粗
1 | **double asterisks** |
double asterisks
double underscores
2.5代码
在文章中现实代码,用 ` 号表示
1 | Use the `printf()` function. |
Use the printf()
function.
2.6删除线
1 | ~~Mistaken text.~~ |
Mistaken text.
2.7下划线
1 | <u>Underline</u> |
Underline
###2.8Emoji 表情
用两个 : 号包含单词,或者在 编辑 -> 表情与符号 中选择
1 | :happy: |
:happy:
2.9高亮
这个功能默认是关闭的,如果要打开这个功能(以 Mac 版本为例),选择 Typora -> 偏好设置 -> markdown 标签,勾选高亮复选框
1 | ==highlight== |
==highlight==