Markdown语法参考

用来修改Markdown样式的样例文件

Outline

[TOC]

Block Elements

Paragraph and line breaks

A paragraph is simply one or more consecutive lines of text. In markdown source code, paragraphs are separated by more than one blank lines. In Typora, you only need to press Return to create a new paragraph.

Press Shift + Return to create a single line break. However, most markdown parser will ignore single line break, to make other markdown parsers recognize your line break, you can leave two whitespace at the end of the line, or insert <br/>.

标题

引用

这是一段引用,可以查看它的样式。

列表

Input * list item 1 will create an un-ordered list, the * symbol can be replace with + or -.

Input 1. list item 1 will create an ordered list, their markdown source code is like:

  • 无序列表1
  • 无序列表2
  1. 有序列表1
  2. 有序列表2

任务列表

  • 任务1
  • 任务2
  • 完成任务3

代码块

Using fences is easy: Input ``` and press return. Add an optional language identifier after ``` and we’ll run it through syntax highlighting

1
2
3
import random
r = random.random()
print(r)

公式块

You can render LaTeX mathematical expressions using MathJax.

Input $$, then press ‘Return’ key will trigger an input field which accept Tex/LaTex source. Following is an example:
$$
\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}
$$
In markdown source file, math block is LaTeX expression wrapped by ‘$$’ mark:

1
2
3
4
5
6
7
$$
\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}
$$

行内公公式:$y_i = x(a_i)^2$。

  • 矩阵

$$
\left[
\begin{matrix}
1 & 2 & 3 \
4 & 5 & 6 \
7 & 8 & 9
\end{matrix}
\right]
\left{
\begin{matrix}
1 & 2 & 3 \
4 & 5 & 6 \
7 & 8 & 9
\end{matrix}
\right}
$$

  • 希腊字母表
大写 Markdown 小写 Markdown
A A $\alpha$ \alpha
B B $\beta$ \beta
$\Gamma$ \Gamma $\gamma$ \gamma
$\Delta$ \Delta $\delta$ \delta
E E $\epsilon$ \epsilon
$\varepsilon$ \varepsilon
Z Z $\zeta$ \zeta
H H $\eta$ \eta
$\Theta$ \Theta $\theta$ \theta
I I $\iota$ \iota
K K $\kappa$ \kappa
$\Lambda$ \Lambda $\lambda$ \lambda
M M $\mu$ \mu
N N $\nu$ \nu
$\Xi$ \Xi $\xi$ \xi
O O $\omicron$ \omicron
$\Pi$ \Pi $\pi$ \pi
P P $\rho$ \rho
$\Sigma$ \Sigma $\sigma$ \sigma
T T $\tau$ \tau
$\Upsilon$ \Upsilon $\upsilon$ \upsilon
$\Phi$ \Phi $\phi$ \phi
$\varphi$ \varphi
X X $\chi$ \chi
$\Psi$ \Psi $\psi$ \psi
$\Omega$ \Omega $\omega$ \omega
  • 三角函数:$\sin$
  • 对数函数:$\ln \log_2 \lg$
  • 关系运算符
运算符 Markdown 运算符 Markdown
$\pm$ \pm $\times$ \
$\div$ \div $\sum$ \sum
$\prod$ \prod $\neq$ \neq
$\leq$ \leq $\geq$ \geq
$\approx$ \approx $\approxeq$ \approxeq
  • 其他
符号 Markdown 符号 Markdown
$\frac{1}{2}$ \frac{1}{2} $\sqrt{2}$ \sqrt
$\cdot$ \cdot $\cdots$ \cdots
$\overline{X}$ \overline{X} $\underline{y}$ \underline{y}
$\infty$ \infty $\vec{a}$ \vec{a}
$\int$ \int $\rightarrow$ \rightarrow
$\partial$ \partial $\nabla$ \nabla
$\mathbf{E}$ \mathbf{E} $\mathrm{E}$ \mathbf{E}
$\in$ \in

表格

Input | First Header | Second Header | and press return key will create a table with two column.

表格头1 表格头2
内容格1 内容格2
偶数行1 偶数行2

脚注

[^footnote]: Here is the text of footnote.

水平分割线


YAML Front Matter

Table of Contents (TOC)

Input [toc] then press Return key will create a section for “Table of Contents” extracting all headers from one’s writing, its contents will be updated automatically.

Span Elements

链接

链接

内部链接

You can set the href to headers. Ctrl + 点击跳转

跳转到代码块标题

引用链接

Google

id为Google的链接定义在下面

网址

<www.google.com>

i@typora.io

图片

强调(<em>

强调

加粗(<strong>

加粗

代码

删除线

Mistaken

下划线(<u>

Underline

Emoji:smile:

:smile:

Github Emoji

行内公式

$\lim_{x\to \infty}\exp(-x) = 0$

高亮

==高亮==

HTML

You could use HTML to style content what pure Markdown does not support, for example, use <span style="color:red">this text is red</span> to add text with red color.

Embed Contents

Some websites provide iframe-based embed code which you could also paste into Typora, for example:

1
<iframe height='265' scrolling='no' title='Fancy Animated SVG Menu' src='http://codepen.io/jeangontijo/embed/OxVywj/?height=265&theme-id=0&default-tab=css,result&embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'></iframe>

Video

You could use the <video> HTML tag to embed videos, for example:

1
<video src="xxx.mp4" />

Other HTML Support

You could find details here.