LaTeX中的数学公式

L A T E X L^AT_EX LATEX中的数学公式

行内公式

  • 前后两边使用$包裹,例如:
    f ( x ) = x 3 + 2 x 2 + 4 f_{(x)}=x^3+2x^2+4 f(x)=x3+2x2+4
  • 源码为
    $f_{(x)}=x^3+2x^2+4$

多行公式

  • 代码块上下使用$$包裹,例如:

[ 1 2 3 4 5 6 7 8 9 ] \left[ \begin{array}{c|cc} 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \right] 147258369

  • 源代码为:
$$
\left[
    \begin{array}{c|cc}
    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\
    7 & 8 & 9
    \end{array}
\right]
$$

角标

下角标

表达式源码
a 1 a_1 a1a_1
a 1 , a 2 a_1,a_2 a1,a2a_1,a_2

上角标

表达式源码
x 3 x^3 x3x^3
x n x^n xnx^n

括号

基础括号

表达式源码
( x ) (x) (x)(x)
[ x ] [x] [x][x]
{x}\{x\}
⟨ x ⟩ \lang x \rang x\lang x \rang
⟨ x ⟩ \langle x \rangle x\langle x \rangle
∣ x ∣ \lvert x \rvert x\lvert x \rvert
∥ x ∥ \lVert x \rVert x\lVert x \rVert

放大的圆括号

表达式源码
( x ) (x) (x)(x)
( x ) \big( x \big) (x)\big( x \big)
( x ) \Big( x \Big) (x)\Big( x \Big)
( x ) \bigg( x \bigg) (x)\bigg( x \bigg)
( x ) \Bigg( x \Bigg) (x)\Bigg( x \Bigg)

分数

\frac{a}{b}
a b \frac{a}{b} ba


\frac{a+2x}{b(n-1)}
a + 2 x b ( n − 1 ) \frac{a+2x}{b(n-1)} b(n1)a+2x

开方

\sqrt{a + b}
a + b \sqrt{a + b} a+b


\sqrt[n]{a + b}
a + b n \sqrt[n]{a + b} na+b

累加/累乘

\sum_{i = 0}^{n}\frac{1}{i^2}
∑ i = 0 n 1 i 2 \sum_{i = 0}^{n}\frac{1}{i^2} i=0ni21


\prod_{i = 0}^{n}\frac{1}{x^2}
∏ i = 0 n 1 x 2 \prod_{i = 0}^{n}\frac{1}{x^2} i=0nx21

三角函数

表达式源码
sin ⁡ \sin sin\sin
cos ⁡ \cos cos\cos
tan ⁡ \tan tan\tan
cot ⁡ \cot cot\cot
sec ⁡ \sec sec\sec
csc ⁡ \csc csc\csc
⊥ \bot \bot
∠ \angle \angle
6 0 ∘ 60^\circ 6060^\circ

对数函数

\ln{a + b}
ln ⁡ a + b \ln{a + b} lna+b


\log_{a}^{b}
log ⁡ a b \log_{a}^{b} logab


\lg{a + b}
lg ⁡ a + b \lg{a + b} lga+b

极限

表达式源码
lim ⁡ \lim lim\lim
→ \rightarrow \rightarrow
∞ \infty \infty

\lim_{n\rightarrow+\infty}n
lim ⁡ n → + ∞ n \lim_{n\rightarrow+\infty}n n+limn

向量

\vec{a}
a ⃗ \vec{a} a

微积分

表达式源码说明
′ \prime \prime
∫ \int \int积分
∬ \iint \iint双重积分
∭ \iiint \iiint三重积分
∮ \oint \oint曲线积分
∇ \nabla \nabla梯度

\int_0^2 x^2 dx
∫ 0 2 x 2 d x \int_0^2 x^2 dx 02x2dx

分支公式

$$
y=
\begin{cases}
-x,\quad x\leq 0\\
x, \quad x>0
\end{cases}
$$

$$
y=
\begin{cases}
-x,\quad x\leq 0\
x, \quad x>0
\end{cases}

$$

矩阵

不带括号

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

1 2 3 4 5 6 7 8 9 \begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} 147258369

括号

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

( 1 2 3 4 5 6 7 8 9 ) \left( \begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \right) 147258369

中括号

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

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

大括号

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

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

带省略号

$$
\left[
\begin{matrix}
a & b & \cdots & a\\
b & b & \cdots & b\\
\vdots & \vdots & \ddots & \vdots\\
c & c & \cdots & c
\end{matrix}
\right]
$$

[ a b ⋯ a b b ⋯ b ⋮ ⋮ ⋱ ⋮ c c ⋯ c ] \left[ \begin{matrix} a & b & \cdots & a\\ b & b & \cdots & b\\ \vdots & \vdots & \ddots & \vdots\\ c & c & \cdots & c \end{matrix} \right] abcbbcabc

带横线/竖线分割的矩阵

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

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


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

[ 1 2 3 4 5 6 7 8 9 ] \left[ \begin{array}{c|cc} 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \right] 147258369

字符的大小、位置和颜色

调整大小

表达式源码
a m o s c l o u d \Huge amoscloud amoscloud\Huge amoscloud
a m o s c l o u d \huge amoscloud amoscloud\huge amoscloud
a m o s c l o u d \LARGE amoscloud amoscloud\LARGE amoscloud
a m o s c l o u d \Large amoscloud amoscloud\Large amoscloud
a m o s c l o u d \large amoscloud amoscloud\large amoscloud
a m o s c l o u d \normalsize amoscloud amoscloud\normalsize amoscloud
a m o s c l o u d \small amoscloud amoscloud\small amoscloud
a m o s c l o u d \footnotesize amoscloud amoscloud\footnotesize amoscloud
a m o s c l o u d \scriptsize amoscloud amoscloud\scriptsize amoscloud
a m o s c l o u d \tiny amoscloud amoscloud\tiny amoscloud

修改颜色

$$
P\left(x_{l} \mid y_{l}\right) = \frac{P(x_l,y_l)}{P(y_l)}=\frac{\textcolor{#FF0000}{P(y_l\mid x_l)}P(x_l)}{P(y_l)}
$$

P ( x l ∣ y l ) = P ( x l , y l ) P ( y l ) = P ( y l ∣ x l ) P ( x l ) P ( y l ) P\left(x_{l} \mid y_{l}\right) = \frac{P(x_l,y_l)}{P(y_l)}=\frac{\textcolor{#FF0000}{P(y_l\mid x_l)}P(x_l)}{P(y_l)} P(xlyl)=P(yl)P(xl,yl)=P(yl)P(ylxl)P(xl)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AmosCloud2013

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值