Markdown菜鸟教程

Markdown菜鸟教程

Author:Yuan’s Q

目录


[TOC]


一、字体、格式类

1.1字体与颜色设置

浅红色文字:<font color="#dd0000">浅红色文字:</font><br /> 
深红色文字:<font color="#660000">深红色文字</font><br /> 
浅绿色文字:<font color="#00dd00">浅绿色文字</font><br /> 
深绿色文字:<font color="#006600">深绿色文字</font><br /> 
浅蓝色文字:<font color="#0000dd">浅蓝色文字</font><br /> 
深蓝色文字:<font color="#000066">深蓝色文字</font><br /> 
浅黄色文字:<font color="#dddd00">浅黄色文字</font><br /> 
深黄色文字:<font color="#666600">深黄色文字</font><br /> 
浅青色文字:<font color="#00dddd">浅青色文字</font><br /> 
深青色文字:<font color="#006666">深青色文字</font><br /> 
浅紫色文字:<font color="#dd00dd">浅紫色文字</font><br /> 
深紫色文字:<font color="#660066">深紫色文字</font><br />

浅红色文字:浅红色文字:

深红色文字:深红色文字

浅绿色文字:浅绿色文字

深绿色文字:深绿色文字

浅蓝色文字:浅蓝色文字

深蓝色文字:深蓝色文字

浅黄色文字:浅黄色文字

深黄色文字:深黄色文字

浅青色文字:浅青色文字

深青色文字:深青色文字

浅紫色文字:浅紫色文字

深紫色文字:深紫色文字

二、大小

size为1:<font size="1">size为1</font><br /> 
size为2:<font size="2">size为2</font><br /> 
size为3:<font size="3">size为3</font><br /> 
size为4:<font size="4">size为4</font><br /> 
size为10:<font size="10">size为10</font><br /> 
123456

size为1:size为1

size为2:size为2

size为3:size为3

size为4:size为4

size为10:size为10

1.2标题与目录

1.2段落、间距设置

1.3超链接与参考文献

1.4插入外部数据(图片)

二、表格、区块、代码块

1.1 插入表格

1.2 插入代码块

区块

二、数学公式类
1.1 常用符号

1.To see how any formula was written in any question or answer, including this one, right-click on the expression it and choose “Show Math As > TeX Commands”. (When you do this, the ‘$’ will not display. Make sure you add these. See the next point.)

2.For inline formulas,enclose the formula in $...$. For display formulars,use** $$...$$.These render differently.For example,type$\sum_{i=0}^n i^2=\frac{(n^2+n)(2n+1)}{6}$to show \sum_{i=0}^n i^2=\frac{(n^2+n)(2n+1)}{6}(which is inline mode) or type$$\sum_{i=0}^n i^2=\frac{(n^2+n)(2n+1)}{6}$$

​ $\sum_{i=0}^n i^2=\frac{(n^2+n)(2n+1)}{6}$(which is display mode).

3.For Greek letters, use \alpha, \beta, …, \omega: α,β,…ω. For uppercase, use \Gamma, \Delta, …, \Omega: Γ,Δ,…,Ω.

若需要斜体,\varSigma\varSigma

显示命令显示命令
\alpha\alpha\beta\beta
\gamma\gamma\delta\delta
\epsilon\epsilon\zeta\zeta
\eta\eta\theta\theta
\iota\iota\kappa\kappa
\lambda\lambda\mu\mu
\nu\nu\xi\xi
\pi\pi\rho\rho
\sigma\sigma\tau\tau
\upsilon\upsilon\phi\phi
\chi\chi\psi\psi
\omega\omega 

4.For superscripts and subscripts, use ^ and _. For example,x_i^2: x_i^2, \log_2 x: $log2x $.

5.Groups. Superscripts, subscripts, and other operations apply only to the next “group”. A “group” is either a single symbol, or any formula surrounded by curly braces {}. If you do 10^10, you will get a surprise: 10^10. But 10^{10} gives what you probably wanted: 10^{10}. Use curly braces to delimit a formula to which a superscript or subscript applies: x^5^6 is an error; {x^y}^z is {x^y}^z, and x^{y^z} is x^{y^z}. Observe the difference between x_i^2 x_i^2and x_{i^2}x_{i^2}.

6.Parentheses Ordinary symbols ()[] make parentheses and brackets (2+3)[4+4]. Use \{ and \} for curly braces {}.

These do not scale with the formula in between, so if you write (\frac{\sqrt x}{y^3}) the parentheses will be too small: (\frac{\sqrt x}{y^2}). \left(\right) will make the sizes adjust automatically to the formula they enclose: \left(\frac{\sqrt{x}}{y^2}\right).\left\{x\middle | \frac{x^2}{2} \in \mathbb{z}\right\} \left\{x\middle | \frac{x^2}{2} \in \mathbb{z}\right\},f_{comp}(y_{obs},y_{mis})=f_m(y_{mis})\cdot f_{o|m}(y_{obs},y_{mis})f_{comp}(y_{obs},y_{mis})=f_m(y_{mis})\cdot f_{o|m}(y_{obs},y_{mis})

\left and \right apply to all the following sorts of parenttheses:( and ) \left(x\right), | \left|x\right|, \vert \left\vert x \right\vert,\Vert \left\Vert x \right\Vert, \langle and \rangle $ \left\langle x \right\rangle$,\lceil and \rceil \left\lceil x \right\rceil,and \lfoorandrfloor\left\lfloor  x \right\rfloor.\middle can be used to add additional dividers.

There are also invisible parentheses, denoted by .: \left.\frac12\right\rbrace is \left.\frac12\right\rbrace.

If manual size adjustments are required: \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) gives $\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) $.

\underbrace{a\cdot a\cdots a}_{b\text{ times}} \underbrace{a\cdot a\cdots a}_{b\text{ times}}.

\underset{j=1}{\overset{\infty}{\LARGE\mathrm K}}\frac{a_j}{b_j}=\cfrac{a_1}{b_1+\cfrac{a_2}{b_2+\cfrac{a_3}{b_3+\ddots}}}

\underset{j=1}{\overset{\infty}{\LARGE\mathrm K}}\frac{a_j}{b_j}=\cfrac{a_1}{b_1+\cfrac{a_2}{b_2+\cfrac{a_3}{b_3+\ddots}}}.

Use \left and \right to make braces - (round), [square] and {curly} - scale up to be the size of their arguments. Thus

$$
f\left(
   \left[ 
     \frac{
       1+\left\{x,y\right\}
     }{
       \left(
          \frac{x}{y}+\frac{y}{x}
       \right)
       \left(u+1\right)
     }+a
   \right]^{3/2}
\right)
$$

f\left(   \left[      \frac{       1+\left\{x,y\right\}     }{       \left(          \frac{x}{y}+\frac{y}{x}       \right)       \left(u+1\right)     }+a   \right]^{3/2}\right)

$\lim\limits_{x \to 1} \frac{x^2-1}{x-1}$

\lim\limits_{x \to 1} \frac{x^2-1}{x-1}

$$ \bbox[yellow,5px]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
$$

$$ \bbox[yellow,5px]{e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n\qquad (1)}$$

$$ \bbox[yellow,5px,border:2px solid red]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
$$

$$ \bbox[yellow,5px,border:2px solid red]{e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n\qquad (1)}$$.

7.Sums and integrals \sum and \int; the subscript is the lower limit and the superscript is the upper limit, so for example \sum_1^n \sum_1^n. Don’t forget {} if the limits are more than a single symbol. For example, \sum_{i=0}^\infty i^2 is \sum_{i=0}^\infty i^2. Similarly, \prod \prod, \int \int\bigcup \bigcup, \bigcap \bigcap, \iint \iint, \iiint\iiint.

8.Fractions There are two ways to make these. \frac ab applies to the next two groups, and produces ab; for more complicated numerators and denominators use {}: \frac{a+1}{b+1} is \frac{a+1}{b+1}. If the numerator and denominator are complicated, you may prefer \over, which splits up the group that it is in: {a+1\over b+1} is {a+1\over b+1}.

9.Fonts

  • Use \mathbb or \Bbb for “blackboard bold”: \mathbb{CHNQRZ}.
  • Use \mathbf for boldface: \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}
  • Use \mathtt for “typewriter” font: \mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}
  • Use \mathrm for roman font: \mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}
  • Use \mathsf for sans-serif font: \mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}
  • Use \mathcal for “calligraphic” letters: \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
  • Use \mathscr for script letters: /mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}.
  • Use \mathfrak for “Fraktur” (old German style) letters:\mathfrak {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}

10.Radical signs Use sqrt, which adjusts to the size of its argument: \sqrt{x^3} \sqrt[3]{x^3}; \sqrt[3]{\frac xy} \sqrt[3]{\frac xy}. For complicated expressions, consider using {...}^{1/2} instead.

11.Some special functions such as “lim”, “sin”, “max”, “ln”, and so on are normally set in roman font instead of italic font. Use \lim, \sin, etc. to make these: \sin x sinx, not sin x sinx. Use subscripts to attach a notation to \lim: lim_{x\to \infty},\lim_{x \to \infty}.

12.There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:

  • \lt \gt \le \leq\leqq \leqslant \ge \geq \geqq \geqslant \neq\lt \gt \le \leq\leqq \leqslant \ge \geq \geqq \geqslant \neq.You can use \not to put a slash through almost anything:\not\lt\not\ltbut it often looks bad.
  • \times \div \pm \mp \times \  \div \  \pm \mp.cdotis a centered dot:x\cdot y
  • \cup \cat \setminus\subset \subseqeq \subsetneq \supset \in \notin \emptyset \varnothing\cup \cap \setminus\subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing.
  • {n+1 \choose 2k} or \binom{n+1}{2k}\binom{n+1}{2k}
  • \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto
  • \land \lor \lnot \forall \exists \top \bot \vdash \vDash \propto \land \lor \lnot \forall \exist \top \bot \vdash \vDash\ \propto
  • \star \ast \oplus \otimes \odot \circ \bullet\star \ast \oplus \otimes \odot \circ \bullet
  • \tilde{a} \hat{a} \vec{a} \bar{a} \tilde{a}\ \hat{a}\ \vec{a}\ \bar{a}
  • \approx \sim \simeq \cong \equiv \prec \lhd \approx \sim \simeq \cong \equiv \prec \lhd.
  • \infty \aleph_0 \infty \aleph_0\nabla \partial\frac{y}{x} \nabla \partial\frac{y}{x}\Im \Re \Im \Re
  • For modular equivalence, use \pmod like this: a\equiv b\pmod n a\equiv b\pmod n
  • \ldots is the dots in a_1,a_2,\ldots,a_ncdots is the dots in a_1+a_2+\cdots+a_n.

13.Spaces MathJax usually decides for itself how to space formulas, using a complex set of rules. Putting extra literal spaces into formulas will not change the amount of space MathJax puts in: a␣b and a␣␣␣␣b are both ab. To add more space, use \, for a thin space a\, b; \; for a wider space a\;b. \quad and \qquad are large spaces: a\quad b, a\qquad b.

14.Accents and diacritical marks Use \hat for a single symbol \hat{x}, \widehat for a larger formula\widehat{xy} . If you make it too wide, it will look silly. Similarly, there are \bar \bar{x}and \overline \overline{xyz}, and \vec \vec{x} and \overrightarrow$ \overrightarrow{}$ \overrightarrow{xyz} and \overleftrightarrow{}\overleftrightarrow{xyz} .For dots, as in \frac{d}{dx}x\dot x=\ddot x^2+x\ddot x^2, use \dot and \ddot.

15.Special characters used for MathJax interpreting can be escaped using the \ character: \$$ $$, \{ \{​, \_ \_ etc. If you want \ itself \backslash, you should use \backslash \\, because \\ is for a new line.

16.Named colors are browser-dependent; if a browser doesn’t know a particular color name, it may render the text as black. The following colors are standard in HTML4 and CSS2 and should be interpreted the same by most browsers: \color{red}{text} or use #rgb text\color{red}{text}

1.2矩阵与数组

1.Use $$\begin{matrix}…\end{matrix}$$ In between the \begin and \end, put the matrix elements. End each matrix row with \\, and separate matrix elements with &. For example,

$$
  \begin{matrix}
  1 & x & x^2 \\
  1 & y & y^2 \\
  1 & z & Z^2 \\
  \end{matrix}
$$

produce:
$$
\begin{matrix}
1 & x & x^2 \
1 & y & y^2 \
1 & z & Z^2 \
\end{matrix}
$$
MathJax will adjust the sizes of the rows and columns so that everything fits.

2.TO add brackets,either use \left...\rightas in section 6 of the tutorial, or replace matrix with pmatrix\begin{pmatrix} 1&2\\3&4\end{pmatrix},bmatrix\begin{bmatrix}1&2\\3&4\end{bmatrix},Bmatrix\begin{bmatrix}1 & 2 \\ 3&4 \end{bmatrix},vmatrix\begin{vmatrix}1&2\\3&4\end{vmatrix},Vmatrix\begin{Vmatrix}1&2\\3&4\end{Vmatrix}.

3.Usecdots\cdots\ddots\ddotsvdots\vdots when you want to omit some of the entries:

$\begin{pmatrix}1&a_1&a_1^2 &\cdots &a_1^n\\1 &a_2 &a_2^2&\cdots&a_2^2\\\vdots&\vdots&\vdots&\ddots&\vdots\\1&a_m&a_m^2&\cdots&a_m^n\end{pmatrix}$.

4.For horizontally “augmented” matrices, put parentheses or brackets around a suitably-formatted table; see arrays below for details. Here is an example:

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

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

5.For vertically “augmented” matrices, use \hline. For example

$$
  \begin{pmatrix}
    a & b\\
    c & d\\
  \hline
    1 & 0\\
    0 & 1
  \end{pmatrix}
$$

$$
\begin{pmatrix}
a & b\
c & d\
\hline
1 & 0\
0 & 1
\end{pmatrix}
$$

6.数组

It is often easier to read tables formatted in MathJax rather than plain text or a fixed width font. Arrays and tables are created with the array environment. Just after \begin{array} the format of each column should be listed, use c for a center aligned column, r for right aligned, l for left aligned and a | for a vertical line. Just as with matrices, cells are separated with & and rows are broken using \\. A horizontal line spanning the array can be placed before the current line with \hline.

For example,

\begin{array}{c|lcr}n & \text{Left} & \text{Center} & \text{Right} \\\hline1 & 0.24 & 1 & 125 \\2 & -1 & 189 & -8 \\3 & -20 & 2000 & 1+10i\end{array}

\begin{array} {{c|lcr}}
n & \text{Left} &\text{Center}&\text{Right} \\ 
\hline 
1&0.24 &1 & 125\\ 
2 & -1 & 189 &-8\\
3 & -20 & 2000 &1+10i
\end{array}
1.3方程(组)

1.Aligned equaltions

Often people want a series of equations where the equals signs are aligned. To get this, use \begin{align}…\end{align}. Each line should end with \\, and should contain an ampersand at the point to align at, typically immediately before the equals sign.

For example,
$$
\begin{align}\sqrt{37} &=\sqrt{\frac{73^2-1}{12^2}} \
&=\sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}}\
&=\sqrt{\frac{73^2}{12^2}}\cdot\sqrt{\frac{73^2-1}{73^2}}\
&\approx \frac{73}{12} \left ( 1-\frac{1}{{2.73}^2}\right)
\end{align}\
$$
is produced by:

```\begin{align}\sqrt{37} &=\sqrt{\frac{73^2-1}{12^2}} \
\begin{align}\sqrt{37} &=\sqrt{\frac{73^2-1}{12^2}} \
&=\sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}}\
&=\sqrt{\frac{73^2}{12^2}}\cdot\sqrt{\frac{73^2-1}{73^2}}\
&\approx \frac{73}{12} \left ( 1-\frac{1}{{2.73}^2}\right)
\end{align}\


1.2 Use `\begin{cases}…\end{cases}`.  End each case with a `\\`, and use `&` before parts that should be aligned.

For example, you get this:

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

is produced by:

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


The brace can be moved to the right: 

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

by writing this:

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


3.**multi-line equation**Multi-line equation is actually just one equation rather than several equations. So the correct environment is `aligned` instead of `align` $$\begin{equation}\begin{aligned}a &= b + c \\  &= d + e + f + g \\  &= h + i\end{aligned}\end{equation}\tag{2}\label{eq2}$$

Equation [(2)](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference?page=1&tab=votes#mjx-eqn-eq2) is a multi-line equation. The code to produce equation [(2)](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference?page=1&tab=votes#mjx-eqn-eq2) is

$'\begin{equation}\begin{aligned}$



$'\begin{align}$
```

\begin{align}a &= b + c \tag{3} \\ x &= yz \tag{4} \\ l &= m - n \tag{5}\end{align}.

4

三、markdown应用篇
3.1markdown 与博客【CSDN为例,支持数学公式,让您宝贵的时间只专注于学习】
3.2markdown与邮件【炫酷的邮件,亮瞎小伙伴的眼】
3.3 markdown 与微信公众号【不支持数学公式、不支持图片】
3.4 Rmarkdown【喝咖啡的时候就得到了美美的结果】
四、markdown高级【插件的使用】
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: Markdown是一种轻量级标记语言,用于方便地记笔记和写博客。它的初衷是为了简化排版的过程,只需要关注内容的编写,而不用担心排版的细节。Markdown具有很多强大的功能,例如流程图和复杂的公式呈现,但个人认为这些高级用法与它的初衷有些违背,因为有专门的工具可以更方便地完成这些任务。如果想了解更多详细的Markdown高级用法,可以参考菜鸟教程Markdown高级用法和Cmd Markdown简明语法手册。\[1\]在Markdown中,还有一些特殊符号需要处理,可以使用反斜杠\来插入这些特殊符号,例如反引号、星号、底线、花括号、方括号、括弧、井字号、加号、减号、英文句点和惊叹号等。\[3\] #### 引用[.reference_title] - *1* *2* [手把手教会你使用Markdown【从入门到精通一篇就够了】](https://blog.csdn.net/qq_40818172/article/details/126260661)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Markdown使用教程(详细)](https://blog.csdn.net/qq_43278189/article/details/120832456)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值