MarkDown(三)
转载自https://blog.csdn.net/jzj_c_love/article/details/122279703
代码都可以在typora
中运行,给出的图片链接语法是Ketax
,可能有少数的不适用,但基本可以。
一、基本公式
1. 上下标
|
\[A_1^2\\B_{12}\\2^{x^2+y}\]
2. 分数
$$ |
\[\frac{x}{1+x^2}\\\frac{\frac{1}{2}+x}{y}\\\tfrac{a}{b}\frac{a}{b}\]
3. 开根号
$$ |
\[\sqrt{x}\sqrt[3]{x}\]
4. 组合数
$$ |
\[\binom{n}{k}\tbinom{n}{k}\]
5. 导数
$$ |
\[a'a''a^{\prime}\]
6. 取模
$$ |
\[x \pmod a\\2\mod{x}\]
7. 积分
$$ |
\[\int_{1}^{2}\intop_{2}^{1}\oint\smallint\\\iint\oiint\iiint\oiiint\]
8.微分
$$ |
\[\nabla  \partial x   \mathrm{d}x \dot x  \ddot y \Delta\]
9.累积/累乘/极限
$$ |
\[\sum_{i=1}^{k}\displaystyle\sum_{i=1}^n\textstyle\sum_{i=1}^n\\\prod_{i=1}^{k}\displaystyle\prod_{i=1}^n\textstyle\prod_{i=1}^n\\\lim_{k \to \infty}\lim\limits_{k \to \infty}\lim\nolimits_{k \to \infty}]\]
二、修饰符号
1. 简单的帽子
\hat{\theta} |
\[\hat{\theta}\widehat{AB}\\\bar{y}\overline{AB}\\\tilde{a}\widetilde{ac}\\\bar{a}\acute{a}\check{a}\grave{a}\\\dot{a}\ddot{a}\\\vec{a}\overline{a}\underline{a}\underset{min}{a}\\\hat{a}\widehat{a}\\\mathring{a}\dddot{a}\\\ddddot{a}\]
2. 帽子和袜子
$$ |
\[\overleftarrow{AB}\overrightarrow{AB}\overleftrightarrow{AB}\\\underleftarrow{AB}\underrightarrow{AB}\underleftrightarrow{AB}\\\overbrace{AB}\underbrace{AB}\\\overline{AB}\underline{AB}\]
3. 盒子和帽子
$$ |
\[\overbrace{a+b+c}^{\text{note}}\\\underbrace{a+b+c}_{\text{note}}\\\boxed{\pi=3.14}\]
4. 各种括号
$$ |
\[( \big(\Big(\bigg(\Bigg(\]
$$ |
\[[]<>|-2|\{\}\]
$$ |
\[\lgroup x \rgroup\lVert a \rVert\lceil 2.6 \rceil\lfloor 1.2 \rfloor\ulcorner\urcorner\llcorner\lrcorner\]
三、字母
1、数学环境默认字体
\[mathnormal\\\mathnormal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathnormal{abcdefghijklmnopqrstuvwxyz}\\\mathnormal{1234567890}\]
2、意大利体
\[mathit\\\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathit{abcdefghijklmnopqrstuvwxyz}\\\mathit{1234567890}\]
##3、罗马体
\[mathrm\\\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathrm{abcdefghijklmnopqrstuvwxyz}\\\mathrm{1234567890}\]
4、粗体
\[mathbf\\\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathbf{abcdefghijklmnopqrstuvwxyz}\\\mathbf{1234567890}\]
5、无衬线体
\[mathsf\\\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathsf{abcdefghijklmnopqrstuvwxyz}\\\mathsf{1234567890}\]
6、打印机体
\[mathtt\\\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathtt{abcdefghijklmnopqrstuvwxyz}\\\mathtt{1234567890}\]
7、手写体
\[mathcal\\\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathcal{abcdefghijklmnopqrstuvwxyz}\\\mathcal{1234567890}\]
8、黑板粗体
\[mathbb\\\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathbb{abcdefghijklmnopqrstuvwxyz}\\\mathbb{1234567890}\]
9、花体
\[mathscr\\\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathscr{abcdefghijklmnopqrstuvwxyz}\\\mathscr{1234567890}\]
10、哥特体
\[mathfrak\\\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\\mathfrak{abcdefghijklmnopqrstuvwxyz}\\\mathfrak{1234567890}\]
11、其他字母
\text{字母} |
\[\text{R}\text{A}\text{C}\text{L}\\\bf{R}\bf{A}\bf{C}\bf{L}\\\mathit{R}\mathit{A}\mathit{C}\mathit{L}\\\pmb{R}\pmb{A}\pmb{C}\pmb{L}\\\cal{R}\cal{A}\cal{C}\cal{L}\]
\tiny ABCabc |
\[\tiny ABCabc\\\small ABCabc\\\normalsize ABCabc\\\large ABCabc\\\Large ABCabc\\\huge ABCabc\\\Huge ABCabc\\{\tiny ABC} {\large ABC}\]
12、希腊字母
\[\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu \nu \xi \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega \\\Gamma \varGamma \gamma \digamma \\\Delta \varDelta \delta \\\epsilon \varepsilon \\\Theta \varTheta \theta \vartheta \\\kappa \varkappa\\\Xi \varXi \xi\\\Pi \varPi \pi \varpi\\\rho \varrho\\\Sigma \varSigma \sigma \varsigma\\\Upsilon \varUpsilon \upsilon\\\Phi \varPhi \phi \varphi\\\Psi \varPsi \psi\\\Omega \varOmega \omega\\\]
13、希伯来字母
\[\aleph \beth \daleth \gimel\]
$$
$$
四、算术运算符号
\times |
\[\times\div\cdot\%\circ\ast\star\otimes\oplus\odot\oslash\pm\mp\dotplus\divideontimes\textbackslash\]
五、比较运算符
\[= \ne \neq\\< \nless > \ngtr\\\leq \le \nleq \leqq \nleqq \lneqq \lvertneqq \leqslant \nleqslant \lneq\\\geq \ge \ngeq \geqq \ngeqq \gneqq \gvertneqq \geqslant \ngeqslant \gneq\\\lesssim \lnsim \lessapprox \lnapprox\\\gtrsim \gnsim \gtrapprox \gnapprox\\\prec \nprec \\\succ \nsucc\\\preceq \npreceq \precneqq\\\succeq \nsucceq \succneqq\\\in \notin \ni \owns\\\ll \lll\gg \ggg\\\sim \nsim \simeq \cong \ncong\\\approx\equiv\doteq\\\subset \subseteq \nsubseteq \subsetneq \varsubsetneq \\\subseteqq \nsubseteqq \subsetneqq \varsubsetneqq\\\supset \supseteq \nsupseteq \supsetneq \varsupsetneq\\\supseteqq \nsupseteqq \supsetneqq \varsupsetneqq\\\smile \frown\perp\models\\\mid \nmid\shortmid \nshortmid \shortparallel \nshortparallel\\\vdash \nvdash \dashv\vDash \nvDash \Vvdash\Vdash \nVdash \nVDash\\\propto\bowtie \Join\\\vartriangleleft \ntriangleleft \trianglelefteq \ntrianglelefteq\\\vartriangleright \ntriangleright \trianglerighteq \ntrianglerighteq\\\]
六、集合运算符
\in |
\[\in\owns \not\subset \not\supset\subseteq\supseteq\\\cap\cup\land\lor\\\neg\emptyset\varnothing\\\because\forall\exists\therefore\cap\cup\land\lor\sqcup\sqcap\]
七、各种箭头
\gets |
\[\gets\leftarrow\to\rightarrow\leftrightarrow\\\uparrow\downarrow\updownarrow\Leftarrow\Rightarrow\Leftrightarrow\iff\\\Uparrow\Downarrow\Updownarrow\nearrow\searrow\swarrow\nwarrow\longleftarrow\longrightarrow\longleftrightarrow\Longleftarrow\Longrightarrow\Longleftrightarrow\longmapsto\xrightarrow{over}\xrightarrow[over]{}\xrightarrow[under]{over}\xleftarrow[]{over}\xleftarrow[under]{}\xleftarrow[under]{over}\]
\[\rightarrow \nrightarrow \longrightarrow \Rightarrow \nRightarrow \Longrightarrow \\\leftarrow \nleftarrow \longleftarrow \Leftarrow \nLeftarrow \Longleftarrow \\\leftrightarrow \nleftrightarrow \Leftrightarrow \nLeftrightarrow \longleftrightarrow \iff \Longleftrightarrow\\\uparrow \downarrow \updownarrow \Uparrow \Downarrow \\\nearrow \swarrow \nwarrow \searrow \\\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \\\upharpoonleft \downharpoonleft \upharpoonright \downharpoonright \\\rightleftharpoons \leftrightharpoons \\\curvearrowleft \curvearrowright \circlearrowleft \circlearrowright \\\Lsh \Rsh \upuparrows \downdownarrows \leftleftarrows \rightrightarrows \]
七、空间间距
A\!B |
\[A\!B\\AB\\A\thinspace B\\A\:B\\A\ B\\A \enspace B\\A\quad B\\A\qquad B\]
八、矩阵
A= |
\[A=\begin{pmatrix}a & b & \cdots & c \\\\d & e & \cdots & f \\\\\vdots & \vdots & \ddots & \vdots \\\\g & h & \cdots & j\end{pmatrix}\tag{5.1}\]
A = \begin{matrix} |
\[A = \begin{matrix}a & b\\c & d\end{matrix}\]
B = \begin{pmatrix} |
\[B = \begin{pmatrix}a & b\\\\c & d\end{pmatrix}\]
C = \begin{vmatrix} |
\[C = \begin{vmatrix}a & b\\\\c & d\end{vmatrix}\]
D = \begin{bmatrix} |
\[D = \begin{bmatrix}a & b\\\\c & d\end{bmatrix}\]
E = \begin{Vmatrix} |
\[E = \begin{Vmatrix}a & b\\\\c & d\end{Vmatrix}\]
\begin{aligned} |
\[\begin{aligned}f(x) &= (x+1)^2\\\\&= x^2 + 2x + 1\end{aligned}\]
f(x) = \begin{cases} |
\[f(x) = \begin{cases}a &\text{if b}\\\\b &\text{if a}\\\\\end{cases}\]
\begin{cases} |
\[\begin{cases}\begin{aligned}x + 2y &= 1\\\\3x - y &= 5\end{aligned}\end{cases}\]
g(x,y)=\left\{ |
\[g(x,y)=\begin{cases}\begin{array}{rcl}\frac{M_g - d}{M_f-b}[f(x,y)-b]+d & & {b \leq f(x,y) \leq M_f}\\\\F^*_L & & {S_L \leq 0 < S_M}\\\\F^*_R & & {S_M \leq 0 < S_R}\\\\F_R & & {S_R \leq 0}\end{array} \end{cases}\]
九、修改字体大小
AB |
\[AB\Huge AB\huge AB\\AB\LARGE AB\Large AB\large AB\\AB\small AB\tiny AB\]
十、划掉
\cancel{5} |
\[\cancel{5}\bcancel{5}\xcancel{ABC}\not =\]
十一、常见图形
\Box |
\[\Box\square\blacksquare\triangle\triangledown\blacktriangle\diamond\Diamond\star\bigstar\circ\bullet\bigcirc\bigodot\diamondsuit\clubsuit\heartsuit\spadesuit\angle\measuredangle\top\bot\infty\checkmark\dagger\ddagger\yen\\]$
十二、声明宏
对于一些复杂但是只有少许不同的表达式,可以声明一个函数来调用,提高源码的可读性,减少出错
\def\macroname#1#2{ |
宏允许带任意数量的参数(也可以不带参),必须是#1,#2,……这样的命名格式,同时注意再定义宏的时候注意让#1与,否则会解析成#。再调用的时候格式为,可以参考一下的例子
\def\Normal#1#2#3{ |
\[\def\Normal#1#2#3{\frac{1}{\sqrt{2\pi}\ #3}\exp{[-\frac{(#1 - #2)^2}{2\ #3^2}]}} f(x)=\Normal{x}{u_1}{\sigma_1}\\f(y)=\Normal{y}{u_2}{\sigma_2}\\\]
\def\EXP{ |
\[\def\EXP{e^x = 1 + x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + \cdots} \EXP\]
十三、其他
1、排版
公式居中:
E=mc^2\\ |
\[E=mc^2\\\]
添加标签:
cos\theta+isin\theta=e^{i\theta}\tag{1.1} |
\[cos\theta+isin\theta=e^{i\theta}\tag{1.1}\]
\[E=mc^2\]
等号对齐:
\begin{align}f(x)=&x-1\\=&(x-1)(x^2+x+1)\end{align}\\ |
\[\begin{align}f(x)=&x-1\\=&(x-1)(x^2+x+1)\end{align}\\\]
\begin{equation} \begin{split} |
\[\begin{equation} \begin{split}a &= b + c - d \\ &= e - f \\ &= g + h \\ &= i\end{split} \end{equation}\\\]
2、公式加方框行号 \[\begin{equation}\boxed{a^{2}=b^{2}+c^{2}-2bc\cos A }\\\end{equation}\]
\[{ \bbox[#EFF]{\boxed{\text{求导数: }y=\sin^2\left(\frac1x\right)-2^x.}}}\]
\ldots \quad \cdots \quad \vdots \quad \ddots \quad \dotsc |
\[\ldots \quad \cdots \quad \vdots \quad \ddots \quad \dotsc\]
3、 求和符号下多行限制条件
\prod_{k_0,k_1,\ldots>0\atop |
\[\prod_{k_0,k_1,\ldots>0\atop    k_0+k_1+\cdots=n}  {A_{k_0}A_{k_0}\cdots}\]
4、上下标记
\overline{x+y} \qquad \underline{a+b} \qquad \overbrace{1+2+\cdots+n}^{n个} \qquad \underbrace{a+b+\cdots+z}_{共有26个} |
\[\overline{x+y} \qquad \underline{a+b} \qquad \overbrace{1+2+\cdots+n}^{n个} \qquad \underbrace{a+b+\cdots+z}_{共有26个}\]
5、显示长方程
\begin{multline} |
\[\begin{multline}p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\ - 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3\end{multline}\]
6、普通数学符号 $$
\[ 7、其他符号 \]\[ 8、可带上下限的数学算子巨型符号 \]
\
\
\$$
9、LaTex二元运算符
\[\triangleleft \triangleright \bigtriangleup \bigtriangledown\\\blacktriangleleft \blacktriangleright\\\wedge \land \vee \lor\\\cap \cup \sqcap \sqcup\\\ddagger \dagger\\\uplus \amalg \diamond \bullet \wr \div\\\odot \oslash \otimes \oplus\\\mp \pm \circ \bigcirc \setminus \\\cdot \ast \times \star\\\]
10、AMS二元运算符 \[\dotplus\smallsetminus\intercal\\\Cap \doublecap \Cup \doublecup\\\barwedge \veebar \doublebarwedge\\\boxminus \boxdot \boxplus\\\ltimes \rtimes\\\divideontimes\\\leftthreetimes \rightthreetimes\\\curlywedge \curlyvee\\\centerdot\\\circleddash \circledast \circledcirc\\\lhd \unlhd \rhd \unrhd\\\]
11、其他 \[ \begin{CD} && @V V\partial V &@VV\partial V&@V V\partial V \\ 0@>>>S_q(X;G')@>\phi>>S_q(X;G)@>\psi>>S_q(X;G'')@>>>0 \\ && @V V\partial V &@VV\partial V&@V V\partial V \\ 0@>>>S_{q-1}(X;G')@>\phi>>S_{q-1}(X;G)@>\psi>>S_{q-1}(X;G'')@>>>0 \\ && @V V\partial V &@VV\partial V&@V V\partial V \end{CD} \]
\[ \begin{CD} 0@>>>G'@>\phi>>G@>\psi>>G''@>>>0 \end{CD} \]
\[\begin{array}{c|c} \cap&\color{blue}{BC}\\ \hline \color{red}A&-3\\ \color{blue}B&-1\\ \color{blue}C&-1\\ \end{array}\]
$$x x \
$$