I. Introduction to Markdown

Markdown is a lightweight markup language that unifies the process of writing and typesetting into plain text, creating documents with the suffix.md or.markdown. In addition, Github, Zhihu and Evernote all support Markdown, which was founded by John Gruber in 2004. Markdown aims to be easy to read and write. The written documents can be exported in VARIOUS formats such as HTML, Word, image, PDF and Epub, and are compatible with the use of HTML tags.

Second, Markdown grammar

1. Markdown shortcut keys

  • Directory:@ + [TOC] + (Catalog title)
  • Cancellation:Ctrl / Command + Z
  • Repeat:Ctrl / Command + Y
  • Bold:Ctrl / Command + B
  • Italics:Ctrl / Command + I
  • Looking for:Ctrl / Command + F
  • Replacement:Ctrl / Command + G
  • Title:Ctrl / Command + Shift + H
  • Unordered list:Ctrl / Command + Shift + U
  • Ordered list:Ctrl / Command + Shift + O
  • Check list:Ctrl / Command + Shift + C
  • Insert code:Ctrl / Command + Shift + K
  • Insert connection:Ctrl / Command + Shift + L
  • Insert picture:Ctrl / Command + Shift + G

2. The Markdown title

Markdown supports two header syntax, seText-like and ATX-like forms. The setext-like form is in the form of the bottom line, using = (highest-order heading) and – (second-order heading), any number of = and – will work;

I show the primary title = = = = = = = = = = = = = = = = = I show the secondary title -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --Copy the code

The effect is as follows:

I prefer the ATX-like form, in which 1 to 6 # are inserted at the beginning of the line, corresponding to levels 1 to 6 of the heading, with a space between the # and the heading generally required. ;

# 1 title # # 2 headlines # # # # # # # 3 4 headlines # # # # # # # 5 # # # # six levels of headingsCopy the code

The effect is as follows:

3. The Markdown format

1) Dividing line

You can create a line with more than three *, -, and _ lines, and nothing else in the line. You can also insert Spaces between asterisks and minus signs. Each of the following ways can create a dividing line.

***

* * *

*****

- - -

----------
Copy the code

The effect is as follows:


2) Text style

Markdown does not support text font or color Settings and requires HTML tags.

* * _ _ * * bold italic text italic text text bold text (* * * * * * * * bold italic text ___ ___ bold italic text < u > underlined < / u >Copy the code

The effect is as follows:

Italic text Italic text Bold text Bold italic text Bold italic text Underline

3) Fonts and colors

<font color =" gray" size = 2> Font color </font> <font color =" red" size = 4> font color </font> = background color == <font face=" black "size = </font> <font face="STCAIYUN" size = 4 </font>Copy the code

The effect is as follows:

Font Colouring Font Colouring == Background colour == I am Bold I am Chinese hangkai I am Chinese colour cloud

4. Markdown list

Markdown supports both unordered and ordered lists, which can be nested with reference blocks.

1) Unordered lists

Unordered lists are marked with an asterisk *, a plus +, or a minus -, and are spaced one space between the output.

* first term * second term * third term + first term + second term + third term - first term - second term - third termCopy the code

The effect is as follows:

  • The first item
  • The second
  • The third

3) Ordered lists

Ordered lists use numbers and add. , and a blank space between the output content;

1. Item 1 2. Item 2 3Copy the code

The effect is as follows:

  1. The first item
  2. The second
  3. The third

5. Markdown references

A reference is a > symbol at the beginning of a paragraph followed by a Space symbol Space;

> Outermost > > Layer 1 nesting > > > Layer 2 nesting > + Unordered list first item > 1. Ordered list first item > 2. Ordered list second item > + unordered list second item > + unordered list third itemCopy the code

The effect is as follows:

The outermost layer

The first layer is nested

The second layer is nested

  • Unordered list first item
  1. The first item in an ordered list
  2. Ordered list second item
  • Unordered list second item
  • Unordered list item 3

6. Markdown code

If the code is a function or fragment on a paragraph, it can be enclosed in backquotes, or the Tab key. In code blocks, &, <, and > are automatically converted to HTML entities, making it very easy to use Markdown to insert the sample HTML source code.

Markdown code ` ```c You can also wrap a piece of code around it and specify a language (or not)Copy the code

The effect is as follows:

Markdown code

You can also wrap a piece of code around it and specify a language (or not).Copy the code

7. Markdown links

Markdown supports two types of link syntax: inline and reference. Inline is often used more often.

1) Inline form

Link general format: [] to write the link text,() to write the link address,() in the “” can specify the title attribute for the link, the title attribute can be added. The effect of the title property is that the specified title text appears when you hover over the link. [link text](link address “link title”). Link address and link title are preceded by a space.

This is a link [CSDN](https://www.csdn.net/ "title") <http://baidu.com/>Copy the code

The effect is as follows:

This is a link to CSDN baidu.com

2) Reference formula

Referential hyperlinks are usually used for academic papers, or, alternatively, if a link is used in multiple places throughout the paper, it is good to create links by reference, which allows you to manage links uniformly.

A few websites I visit regularly [Google][1] [1]:http://www.google.com "Google"Copy the code

The effect is as follows:

I often go to several websites Google

8. Markdown images

Picture general format: exclamation mark! Square brackets [] put the alternative text of the picture, and a normal bracket () put the url of the picture. #pic_center center, #pic_right right, =width x hight

! [how to insert pictures in the markdown] (HTTP: / / https://p1-jj.byteimg.com/tos-cn-i-t2oaga2asx/gold-user-assets/2020/5/25/1724b713088acdca~tplv-t2oaga 2asx-image.image)Copy the code

The effect is as follows:

9. The Markdown form

Markdown form using | to separate different cell, use – to separate header and other lines, center alignment by default.

| | | header header header | | : – | : – : | – | | | | cell cell cell | | | | | cell cell cell

  • - :Align the content and title bar to the right.
  • : -Aligns the content and title bar to the left.
  • : - :Center the content and title bar.

The effect is as follows:

header header header
The cell The cell The cell
The cell The cell The cell

10. LaTeX formula

1) The in-line formula $

Mass energy conservation equation: $E= MC ^2$Copy the code

The effect is as follows:

symbol The code says
$x^2$
$x_2$
$e^{xy}$
$\frac{ x }{ y }$
$\sqrt{ x }$
$\ldots$(Text bottom line alignment)
$\cdots$(Line alignment of text)
\vec{ a }
$\int_0^2 x {\rm d}x$
$\iint$
$\infty$
$\lim\limits_{n \rightarrow +\infty} \frac{1}{n}$
$\sum_{i=0}^n \frac{1}{i^2}$
$\prod_{i=0}^n \frac{1}{i^2}$
\left\{123\right\}
$\pm$
$\times$
\div
\mid
$\ast$
$\leq$
\geq
\neq
$\uparrow$
\downarrow
$\rightarrow$
$\leftarrow$
\Uparrow
$\Downarrow$
\Leftarrow
$\Rightarrow$
$\forall$
$\exists$
$\not=$

2) A whole line of formulas?

? Function name =\begin{cases} Formula 1 & condition 1 \\ formula 2 & Condition 2 \\ formula 3 & condition 3 \end{cases}?Copy the code

The effect is as follows:



reference

1. Comparison table of English names of Chinese fonts

Chinese name The English name style
HuaWenXi black STXihei HuaWenXi black
Chinese blackbody STHeiti Chinese blackbody
Chinese regular script STKaiti Chinese regular script
Chinese song typeface STSong Chinese song typeface
Chinese imitation song dynasty style typeface STFangsong Chinese imitation song dynasty style typeface
Beautiful black Pro LiHei Pro Medium Beautiful black Pro
Li song Pro LiSong Pro Light Li song Pro
The regular script BiauKai The regular script
The apple is beautiful and black Apple LiGothic Medium The apple is beautiful and black
The apples are beautiful Apple LiSung Light The apples are beautiful
New pmingliu PMingLiU New pmingliu
pmingliu MingLiU pmingliu
The regular script DFKai-SB The regular script
blackbody SimHei blackbody
Song typeface SimSun Song typeface
The new song typeface NSimSun The new song typeface
Imitation song dynasty style typeface FangSong Imitation song dynasty style typeface
Regular script KaiTi Regular script
Imitation song dynasty style typeface _GB2312 FangSong_GB2312 Imitation song dynasty style typeface _GB2312
Regular script _GB2312 KaiTi_GB2312 Regular script _GB2312
Microsoft is in bold Microsoft JhengHei Microsoft is in bold
Microsoft jas black Microsoft YaHei Microsoft jas black
Official script LiSu Official script
end YouYuan end
HuaWenXi black STXihei HuaWenXi black
Chinese regular script STKaiti Chinese regular script
HuaWenZhong song STZhongsong HuaWenZhong song
Founder ShuTi FZShuTi Founder ShuTi
Founder yao body FZYaoti Founder yao body
Chinese clouds STCaiyun Chinese clouds
Chinese amber STHupo Chinese amber
Chinese official script STLiti Chinese official script
Chinese travel model STXingkai Chinese travel model
HuaWenXin wei STXinwei HuaWenXin wei

2. Hexadecimal mapping table between English names of common colors

The color of Hex color value
AntiqueWhite #FAEBD7
Aqua #00FFFF
Aquamarine #7FFFD4
Bisque #FFE4C4
Black # 000000
Blue #0000FF
BlueViolet #8A2BE2
Brown #A52A2A
Chartreuse #7FFF00
Chocolate #D2691E
Coral #FF7F50
CornflowerBlue #6495ED
Crimson #DC143C
DarkBlue #00008B
DarkCyan #008B8B
DarkGreen # 006400
DarkMagenta #8B008B
Darkorange #FF8C00
DarkOrchid #9932CC
DarkRed #8B0000
DarkSeaGreen #8FBC8F
DarkTurquoise #00CED1
DeepPink #FF1493
DeepSkyBlue #00BFFF
DodgerBlue #1E90FF
Fuchsia #FF00FF
GreenYellow #ADFF2
Indigo #4B0082
Magenta #FF00FF
SkyBlue ##87CEEB
SpringGreen #00FF7F
Turquoise #40E0D0
VioletRed #D02090
Yellow #FFFF00
YellowGreen #9ACD32
Teal # 008080
SeaGreen #2E8B57
Wheat #F5DEB3