LATAX学习笔记
伪代码
伪代码过长自动换行不能缩进
\Statex \qquad \qquad \qquad
伪代码双栏
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{multicol}
\usepackage[UTF8]{ctex} %输出中文
\floatname{algorithm}{Algorithm} %算法
\begin{multicols}{2}
\begin{algorithm}[H]
\caption{算法栏}
\label{findme}
\begin{algorithmic}[1]
\end{algorithmic}
\end{algorithm}
\end{multicols}
latex公式怎么在word中呈现
- 编写latex公式
- alt+=
- 转为线性
参考链接:latex公式如何在word中呈现
公式换行
公式编号
多行公式多编号
C ^ t = t a n h ( W C ⊙ [ h t − 1 , x t ] + b C ) i t = σ ( W i ⊙ [ h t − 1 , x t ] + b i ) f t = σ ( W f ⊙ [ h t − 1 , x t ] + b f ) C t = f t ∗ C t − 1 + i t ∗ C ^ t o t = σ ( W o ⊙ [ h t − 1 , x t ] + b o ) h t = o t ∗ t a n h ( C t ) % 多行公式多编号 \begin{align} \hat{C}_t &= tanh(W_C\odot[h_{t-1},x_t]+b_C) \\ i_t&=\sigma(W_i\odot[h_{t-1},x_t]+b_i) \\ f_t&=\sigma(W_f\odot[h_{t-1},x_t]+b_f) \\ C_t&=f_t * C_{t-1}+i_t * \hat{C}_t \\ o_t&=\sigma(W_o\odot[h_{t-1},x_t]+b_o) \\ h_t&=o_t * tanh(C_t) \end{align} C^titftCtotht=tanh(WC⊙[ht−1,xt]+bC)=σ(Wi⊙[ht−1,xt]+bi)=σ(Wf⊙[ht−1,xt]+bf)=ft∗Ct−1+it∗C^t=σ(Wo⊙[ht−1,xt]+bo)=ot∗tanh(Ct)
多行公式单编号,编号居中
C ^ t = t a n h ( W C ⊙ [ h t − 1 , x t ] + b C ) i t = σ ( W i ⊙ [ h t − 1 , x t ] + b i ) f t = σ ( W f ⊙ [ h t − 1 , x t ] + b f ) C t = f t ∗ C t − 1 + i t ∗ C ^ t o t = σ ( W o ⊙ [ h t − 1 , x t ] + b o ) h t = o t ∗ t a n h ( C t ) % 多行公式单编号 \begin{equation} \begin{aligned} &\hat{C}_t = tanh(W_C\odot[h_{t-1},x_t]+b_C) \\ &i_t=\sigma(W_i\odot[h_{t-1},x_t]+b_i) \\ &f_t=\sigma(W_f\odot[h_{t-1},x_t]+b_f) \\ &C_t=f_t * C_{t-1}+i_t * \hat{C}_t \\ &o_t=\sigma(W_o\odot[h_{t-1},x_t]+b_o) \\ &h_t=o_t * tanh(C_t) \end{aligned} \end{equation} C^t=tanh(WC⊙[ht−1,xt]+bC)it=σ(Wi⊙[ht−1,xt]+bi)ft=σ(Wf⊙[ht−1,xt]+bf)Ct=ft∗Ct−1+it∗C^tot=σ(Wo⊙[ht−1,xt]+bo)ht=ot∗tanh(Ct)
多行公式无编号
C ^ t = t a n h ( W C ⊙ [ h t − 1 , x t ] + b C ) i t = σ ( W i ⊙ [ h t − 1 , x t ] + b i ) f t = σ ( W f ⊙ [ h t − 1 , x t ] + b f ) C t = f t ∗ C t − 1 + i t ∗ C ^ t o t = σ ( W o ⊙ [ h t − 1 , x t ] + b o ) h t = o t ∗ t a n h ( C t ) % 多行公式无编号 \begin{align*} \hat{C}_t &= tanh(W_C\odot[h_{t-1},x_t]+b_C) \\ i_t&=\sigma(W_i\odot[h_{t-1},x_t]+b_i) \\ f_t&=\sigma(W_f\odot[h_{t-1},x_t]+b_f) \\ C_t&=f_t * C_{t-1}+i_t * \hat{C}_t \\ o_t&=\sigma(W_o\odot[h_{t-1},x_t]+b_o) \\ h_t&=o_t * tanh(C_t) \end{align*} C^titftCtotht=tanh(WC⊙[ht−1,xt]+bC)=σ(Wi⊙[ht−1,xt]+bi)=σ(Wf⊙[ht−1,xt]+bf)=ft∗Ct−1+it∗C^t=σ(Wo⊙[ht−1,xt]+bo)=ot∗tanh(Ct)
多行公式多编号,有的行没有编号
C ^ t = t a n h ( W C ⊙ [ h t − 1 , x t ] + b C ) i t = σ ( W i ⊙ [ h t − 1 , x t ] + b i ) f t = σ ( W f ⊙ [ h t − 1 , x t ] + b f ) C t = f t ∗ C t − 1 + i t ∗ C ^ t o t = σ ( W o ⊙ [ h t − 1 , x t ] + b o ) h t = o t ∗ t a n h ( C t ) % 多行公式多编号,有的行没有编号 \begin{align} \hat{C}_t &= tanh(W_C\odot[h_{t-1},x_t]+b_C) \\ i_t&=\sigma(W_i\odot[h_{t-1},x_t]+b_i) \nonumber \\ f_t&=\sigma(W_f\odot[h_{t-1},x_t]+b_f) \\ C_t&=f_t * C_{t-1}+i_t * \hat{C}_t \\ o_t&=\sigma(W_o\odot[h_{t-1},x_t]+b_o) \\ h_t&=o_t * tanh(C_t) \end{align} C^titftCtotht=tanh(WC⊙[ht−1,xt]+bC)=σ(Wi⊙[ht−1,xt]+bi)=σ(Wf⊙[ht−1,xt]+bf)=ft∗Ct−1+it∗C^t=σ(Wo⊙[ht−1,xt]+bo)=ot∗tanh(Ct)
一行公式分多行写
cos 2 x = cos 2 x − sin 2 x = 2 cos 2 x − 1 %split环境(用$对齐)(一个公式分为多行排版) \begin{equation} \begin{split} \cos 2x &= \cos^2 x - \sin^2 x\\ &= 2\cos^2 x - 1 \end{split} \end{equation} cos2x=cos2x−sin2x=2cos2x−1
case划分
D ( x ) = { 1 , i f x ∈ Q 0 , i f x ∈ R \begin{equation} D(x) = \begin{cases} 1, & if \ x \in Q \\ 0, & if \ x \in R \end{cases} \end{equation} D(x)={1,0,if x∈Qif x∈R
大括号单编号
{ x = e q 1 y = e q 2 + 1 \begin{align} \left\{ %在equation环境下使用,用\left\{命令添加左大括号,用\right.以打点.结束 \begin{aligned} x&=eq1\\ y&=eq2+1 \end{aligned} \right. \end{align} {xy=eq1=eq2+1
大括号多编号
KaTeX parse error: Undefined control sequence: \usepackage at position 2: \̲u̲s̲e̲p̲a̲c̲k̲a̲g̲e̲{cases} % 大括号多编…
参考链接:enter link description here
latex导出
我目前使用overleasf导出pdf
然后把pdf放在inkscape中,导出svg文件
清晰度问题:
可以增加DPI=500,就很清晰了
latex数学公式
LaTex中把下标置于文本正下方的方法: max x \max \limits_{x} xmax
\limits
∑
i
=
0
N
x
i
\sum\limits_{i=0}^N {x_i}
i=0∑Nxi
参考链接