B
′
=
−
∂
×
E
,
E
′
=
∂
×
B
−
4
π
j
,
}
Maxwell’s equations
\left.\begin{aligned} B'&=-\partial \times E,\\ E'&=\partial \times B - 4\pi j, \end{aligned} \right\} \qquad \text{Maxwell's equations}
B′E′=−∂×E,=∂×B−4πj,}Maxwell’s equations 注:如果各个方程需要在某个字符处对齐(如等号对齐),只需在所有要对齐的字符前加上 & 符号。如果不需要公式编号,只需在宏包名称后加上 * 号。
\begin{aligned}
\sigma_1 &= x + y &\quad \sigma_2 &= \frac{x}{y} \\
\sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2'
&= \frac{\partial \frac{x}{y}}{\partial x}
\begin{aligned}
σ
1
=
x
+
y
σ
2
=
x
y
σ
1
′
=
∂
x
+
y
∂
x
σ
2
′
=
∂
x
y
∂
x
\begin{aligned} \sigma_1 &= x + y &\quad \sigma_2 &= \frac{x}{y} \\ \sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2' &= \frac{\partial \frac{x}{y}}{\partial x} \end{aligned}
σ1σ1′=x+y=∂x∂x+yσ2σ2′=yx=∂x∂yx
a
0
=
1
π
∫
−
π
π
f
(
x
)
 
d
x
a
n
=
1
π
∫
−
π
π
f
(
x
)
cos
n
x
 
d
x
=
=
1
π
∫
−
π
π
x
2
cos
n
x
 
d
x
b
n
=
1
π
∫
−
π
π
f
(
x
)
sin
n
x
 
d
x
=
=
1
π
∫
−
π
π
x
2
sin
n
x
 
d
x
\begin{aligned} a_0&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\,\mathrm{d}x\\[6pt] a_n&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\cos nx\,\mathrm{d}x=\\ &=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}x^2\cos nx\,\mathrm{d}x\\[6pt] b_n&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\sin nx\,\mathrm{d}x=\\ &=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}x^2\sin nx\,\mathrm{d}x \\[6pt] \end{aligned}
a0anbn=π1−π∫πf(x)dx=π1−π∫πf(x)cosnxdx==π1−π∫πx2cosnxdx=π1−π∫πf(x)sinnxdx==π1−π∫πx2sinnxdx
$$
z = \overbrace{
\underbrace{x}_\text{real} + i
\underbrace{y}_\text{imaginary}
}^\text{complex number}
$$
z
=
x
⎵
real
+
i
y
⎵
imaginary
⏞
complex number
z = \overbrace{ \underbrace{x}_\text{real} + i \underbrace{y}_\text{imaginary} }^\text{complex number}
z=realx+iimaginaryycomplex number
f
(
x
)
=
{
x
2
:
x
<
0
x
3
:
x
≥
0
f(x) = \left\{ \begin{array}{lr} x^2 & : x < 0\\ x^3 & : x \ge 0 \end{array} \right.
f(x)={x2x3:x<0:x≥0
u
(
x
)
=
{
exp
x
if
x
≥
0
1
if
x
<
0
u(x) = \begin{cases} \exp{x} & \text{if } x \geq 0 \\ 1 & \text{if } x < 0 \end{cases}
u(x)={expx1if x≥0if x<0
{
a
1
x
+
b
1
y
+
c
1
z
=
d
1
a
2
x
+
b
2
y
+
c
2
z
=
d
2
a
3
x
+
b
3
y
+
c
3
z
=
d
3
\left\{ \begin{array}{c} a_1x+b_1y+c_1z=d_1 \\ a_2x+b_2y+c_2z=d_2 \\ a_3x+b_3y+c_3z=d_3 \end{array} \right.
⎩⎨⎧a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3
线性模型
$$
h(\theta) = \sum_{j = 0} ^n \theta_j x_j
$$
h
(
θ
)
=
∑
j
=
0
n
θ
j
x
j
h(\theta) = \sum_{j = 0} ^n \theta_j x_j
h(θ)=j=0∑nθjxj
∂
J
(
θ
)
∂
θ
j
=
−
1
m
∑
i
=
0
m
(
y
i
−
h
θ
(
x
i
)
)
x
j
i
\frac{\partial J(\theta)}{\partial\theta_j}=-\frac1m\sum_{i=0}^m(y^i-h_\theta(x^i))x^i_j
∂θj∂J(θ)=−m1i=0∑m(yi−hθ(xi))xji
∂
J
(
θ
)
∂
θ
j
=
−
1
m
∑
i
=
0
m
(
y
i
−
h
θ
(
x
i
)
)
∂
∂
θ
j
(
y
i
−
h
θ
(
x
i
)
)
=
−
1
m
∑
i
=
0
m
(
y
i
−
h
θ
(
x
i
)
)
∂
∂
θ
j
(
∑
j
=
0
n
θ
j
x
j
i
−
y
i
)
=
−
1
m
∑
i
=
0
m
(
y
i
−
h
θ
(
x
i
)
)
x
j
i
\begin{aligned} \frac{\partial J(\theta)}{\partial\theta_j} & = -\frac1m\sum_{i=0}^m(y^i-h_\theta(x^i)) \frac{\partial}{\partial\theta_j}(y^i-h_\theta(x^i)) \\ & = -\frac1m\sum_{i=0}^m(y^i-h_\theta(x^i)) \frac{\partial}{\partial\theta_j}(\sum_{j=0}^n\theta_jx_j^i-y^i) \\ & = -\frac1m\sum_{i=0}^m(y^i-h_\theta(x^i))x^i_j \end{aligned}
∂θj∂J(θ)=−m1i=0∑m(yi−hθ(xi))∂θj∂(yi−hθ(xi))=−m1i=0∑m(yi−hθ(xi))∂θj∂(j=0∑nθjxji−yi)=−m1i=0∑m(yi−hθ(xi))xji
arg max
a
f
(
a
)
=
*
a
r
g
 
m
a
x
b
f
(
b
)
arg min
c
f
(
c
)
=
*
a
r
g
 
m
i
n
d
f
(
d
)
\begin{gathered} \operatorname{arg\,max}_a f(a) = \operatorname*{arg\,max}_b f(b) \\ \operatorname{arg\,min}_c f(c) = \operatorname*{arg\,min}_d f(d) \end{gathered}
argmaxaf(a)=*argmaxbf(b)argmincf(c)=*argmindf(d)
∑
′
C
n
\begin{aligned} \sum\nolimits' C_n \end{aligned}
∑′Cn
∑
n
=
1
′
C
n
\begin{aligned} \sum_{n=1}\nolimits' C_n \end{aligned}
∑n=1′Cn
求累乘
$$
\prod_{{
\begin{gathered}
1\le i \le n\\
1\le j \le m
\end{gathered}
}}
M_{i,j}
$$
∏
1
≤
i
≤
n
1
≤
j
≤
m
M
i
,
j
\prod_{ \begin{gathered} 1\le i \le n \\ 1\le j \le m \end{gathered} } M_{i,j}
1≤i≤n1≤j≤m∏Mi,j
开根号
$$
\sqrt x * \sqrt[3] x * \sqrt[-1] x
$$
x
∗
x
3
∗
x
−
1
\sqrt x * \sqrt[3] x * \sqrt[-1] x
x∗3x∗−1x
省略号的使用
$$
{1+2+3+\ldots+n}
$$
1
+
2
+
3
+
…
+
n
{1+2+3+\ldots+n}
1+2+3+…+n
2.3 其他格式
不同括号的效果如下: $ \tbinom{n}{k}$
⟶
\longrightarrow
⟶
(
n
k
)
\tbinom{n}{k}
(kn) $ \binom{n}{k}$
⟶
\longrightarrow
⟶
(
n
k
)
\binom{n}{k}
(kn) $ \dbinom{n}{k}$
⟶
\longrightarrow
⟶
(
n
k
)
\dbinom{n}{k}
(kn) $ {n\brace k}$
⟶
\longrightarrow
⟶
\{
n
k
\}
{n\brace k}
{kn} $ {n\choose k}$
⟶
\longrightarrow
⟶
(
n
k
)
{n\choose k}
(kn) $ {n\brack k}$
⟶
\longrightarrow
⟶
[
n
k
]
{n\brack k}
[kn]
上述括号特别适用于求和,求积,以及概率的表达式中,如独立重复事件表达式:
P
(
n
)
=
c
P(n) = {\Huge c}
P(n)=c
(
n
k
)
\dbinom{n}{k}
(kn)
上下标格式 $ stackrel{x}{y}$
⟶
\longrightarrow
⟶
y
x
\stackrel{x}{y}
yx $ overset{x}{y}$
⟶
\longrightarrow
⟶
y
x
\overset{x}{y}
yx $ underset{x}{y}$
⟶
\longrightarrow
⟶
y
x
\underset{x}{y}
xy
三、总结
在编辑的过程中,发现typora中的Latex公式环境在CSDN中Markdown编辑器中不适用。以及对于行内公式,CSDN中的$...$要求$与表达式之间不能有空格,不然也显示不出来,而Latex则没有如此严格。 后面查看Katex API中Handling Errors: If KaTeX encounters an error (invalid or unsupported LaTeX) and throwOnError hasn’t been set to false, then katex.render and katex.renderToString will throw an exception of type katex.ParseError. The message in this error includes some of the LaTeX source code, so needs to be escaped if you want to render it to HTML. For example… 上述文字说明了KaTeX确实对某些Latex公式不支持。最后希望以后CSDN平台也能兼容LaTeX格式。对Latex和Markdown感兴趣的,大家可以评论区留言交流。 后面再继续更新补充。。。