Markdown 学习小记–进阶技巧-数学公式篇
1.公式块的与行内公式的添加
1.公式块
格式: $$+公式+$$
输出示例:
f
(
x
)
=
s
i
n
x
f(x) = sinx
f(x)=sinx
注:当我输入$$之后再输入回车Typora自动调出代码块
2.行内公式
格式: $+公式+$
输出示例:应该是这样子吧 f ( x ) = s i n x f(x) = sinx f(x)=sinx
2.常用数学符号代码
1.上下标、正负无穷
2.加减乘、分式、根号、省略号
3.三角函数
4.矢量、累加累乘、极限
5.希腊字母
6.关系运算符号
注:此些公式都要按照$+LaTeX代码+$
来写
3.矩阵
1.简单矩阵
格式:$$+\begin{matrix}+数字+\end{matrix}+$$
生成, 每一行以\\
结尾表示换行,元素间以&
间隔,式子的表示序号\tag{1}
(右边的序号)。
输出示例:
3
1
4
1
5
9
2
6
5
(示例1)
\begin{matrix} 3&1&4\\ 1&5&9 \\ 2&6&5 \end{matrix}\tag{示例1}
312156495(示例1)
注意:&和\\
不可少
2.带括号的矩阵
1.带中括号的矩阵
格式:$$
\left\{
\begin{matrix}
数字
\end{matrix}
\right\}\tag{数字}
$$
输出示例:
{
1
2
3
4
5
6
7
8
9
}
(示例2)
\left\{ \begin{matrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \\ \end{matrix} \right\}\tag{示例2}
⎩⎨⎧147258369⎭⎬⎫(示例2)
2.带中括号的矩阵
格式:$$`
\left\[
\begin{matrix}
数字
\end{matrix}
\right\]\tag{数字}
$$
注意:将括号改成自己想要的即可
3.带小括号的矩阵
格式:同理
4. 包含希腊字母和省略号的矩阵
输出示例:
行省略号\cdots
,列省略号\vdots
,斜向省略号(左上至右下)\ddots
。
{
1
2
⋯
5
6
7
⋯
10
⋮
⋮
⋱
⋮
α
α
+
1
⋯
α
+
4
}
\left\{ \begin{matrix} 1 & 2 & \cdots & 5 \\ 6 & 7 & \cdots & 10 \\ \vdots & \vdots & \ddots & \vdots \\ \alpha & \alpha+1 & \cdots & \alpha+4 \end{matrix} \right\}
⎩⎪⎪⎪⎨⎪⎪⎪⎧16⋮α27⋮α+1⋯⋯⋱⋯510⋮α+4⎭⎪⎪⎪⎬⎪⎪⎪⎫
$$
\left\{
\begin{matrix}
1 & 2 & \cdots & 5 \\
6 & 7 & \cdots & 10 \\
\vdots & \vdots & \ddots & \vdots \\
\alpha & \alpha+1 & \cdots & \alpha+4
\end{matrix}
\right\}
$$
4.行列式
格式:
$$
\begin{vmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{vmatrix} \tag{示例3}
$$
输出示例:
∣ 1 2 3 4 5 6 7 8 9 ∣ (7) \begin{vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{vmatrix} \tag{7} ∣∣∣∣∣∣147258369∣∣∣∣∣∣(7)
5.表格
1.简易表格
格式:
$$
\begin{array}{|c|c|c|}
\hline 2&9&4\\
\hline 7&5&3\\
\hline 6&1&8\\
\hline
\end{array}
$$
输出示例:
2
0
0
1
2
0
0
1
2
0
0
1
2
0
0
1
2
0
0
1
\begin{array}{|c|c|c|c|c|} \hline 2&0&0&1&\\ \hline 2&0&0&1&\\ \hline 2&0&0&1&\\ \hline 2&0&0&1&\\ \hline 2&0&0&1&\\ \hline \end{array}
22222000000000011111
注:1.{|c|c|c|}
,其中c
l
r
分别代表居中、左对齐及右对齐。
2.竖直分割线:在定义式中插入 |
, (||
表示两条竖直分割线)。
3.水平分割线:在下一行输入前插入 \hline
,以下图真值表为例。
4.每行元素间均须要插入 &
,每行元素以 \\
结尾。
2.真值表
格式:
$$
\begin{array}{cc|c}
A&B&F\\
\hline 0&0&0\\
0&1&1\\
1&0&1\\
1&1&1\\
\end{array}
$$
输出样例:
A B F 0 0 0 0 1 1 1 0 1 1 1 1 \begin{array}{cc|c} A&B&F\\ \hline 0&0&0\\ 0&1&1\\ 1&0&1\\ 1&1&1\\ \end{array} A0011B0101F0111
3.多行等式对齐
格式:
$$
\begin{aligned}
a &= b + c \\
&= d + e + f
\end{aligned}
$$
输出样例:
a = b + c = d + e + f \begin{aligned} a &= b + c \\ &= d + e + f \end{aligned} a=b+c=d+e+f
注:感觉我自己也可以手动对齐
4.方程组
格式:
$$
\begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{cases}
$$
输出样例:
{ 3 x + 5 y + z 7 x − 2 y + 4 z − 6 x + 3 y + 2 z \begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases} ⎩⎪⎨⎪⎧3x+5y+z7x−2y+4z−6x+3y+2z
5.函数表达式
格式:
$$
f(n) =
\begin{cases}
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
\end{cases}
$$
输出样例:
f ( n ) = { n / 2 , if n is even 3 n + 1 , if n is odd f(n) = \begin{cases} n/2, & \text{if }n\text{ is even} \\ 3n+1, & \text{if }n\text{ is odd} \end{cases} f(n)={n/2,3n+1,if n is evenif n is odd