LaTeX數學公式輸入


【置頂 Tips 】

在 WinEdt 中快速添加公式字符而不必手動打出一個個letters~:

(1)針對 WinEdt 7.0版本,可如下圖所示操作,或者,直接 點擊工具欄“View--TeX GUI Symbols ” 

(而針對 WinEdt 10.3版本,直接 點擊工具欄“View--TeX Symbols ”)

即會出現如下 GUI Page Control :

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

LaTeX最強大的功能就是顯示美麗的數學公式:

1、數學公式的前后要加上 $\(\),比如:$f(x) = 3x + 7$\(f(x) = 3x + 7\) 效果是一樣的;
如果用 \[\],或者使用 $$$$,則改公式獨占一行;
如果用
\begin{equation}\end{equation},則公式除了獨占一行還會自動被添加序號,如何公式不想編號則使用 \begin{equation*}\end{equation*}.

 

2、字符
普通字符在數學公式中含義一樣,除了
# $ % & ~ _ ^ \ { }
若要在數學環境中表示這些符號# $ % & _ { },需要分別表示為\# \$ \% \& \_ \{ \},即在個字符前加上\

 

3、大於等於號和小於等於號:

    直接在正文區的公式環境中輸入下面的命令

大於號敲\geq ,小於號敲\leq

如:$$ 0\leq \mu_k \leq 1 \qquad and \qquad \sum_{k=1}^{M-1}\mu_k \leq 1  $$

 4、LaTeX公式換行等號對齊:

\begin{equation*}
\begin{aligned}
p(x|\mu,\sigma^2)&=\frac{1}{(2\pi\sigma^2)^{1/2}}exp\{-\frac{1}{2\sigma^2}(x-\mu)^2\}\\
&=\frac{1}{(2\pi\sigma^2)^{1/2}}exp\{-\frac{1}{2\sigma^2}x^2+\frac{\mu}{\sigma^2}x-\frac{1}{2\sigma^2}\mu^2\}\\
&= h(x)g(\eta)exp(\eta^T u(x))
\end{aligned}
\end{equation*}

其中,\\ 表示換行, & 表示對齊點

 5、矩陣:

對於少於 10 列的矩陣,可使用 matrix,pmatrix,bmatrix,Bmatrix,vmatrix 和 Vmatrix 等環境。

$$\begin{matrix}1 & 2\\3 &4\end{matrix}$$
$$\begin{pmatrix}1 & 2\\3 &4\end{pmatrix}$$
$$\begin{bmatrix}1 & 2\\3 &4\end{bmatrix}$$
$$\begin{Bmatrix}1 & 2\\3 &4\end{Bmatrix}$$
$$\begin{vmatrix}1 & 2\\3 &4\end{vmatrix}$$
$$\begin{Vmatrix}1 & 2\\3 &4\end{Vmatrix}$$

 (via :http://www.cnblogs.com/houkai/p/3399646.html

 

6、分段函數的表示方法:

\begin{equation}
k(x-y)=
\begin{cases}
1: &\mbox{$|x_i-y_j| \leq \frac{1}{2} $(i=1,...,D)}\\
0: &\mbox{otherwise}
\end{cases}
\end{equation}

7、下括線的使用方式:\underbrace{ }_{ }

 Codes:

\begin{frame}{For the $\mu_k$}
 Setting the derivatives of (9.14) with respect to the means $\mu_k$ of the Gaussian components to zero:\\
$$ 0=-\sum_{n=1}^N \underbrace{\frac{\pi_k \mathcal{N}(x_n|\mu_k,\Sigma_k)}{\sum_j \pi_j \mathcal{N}(x_n|\mu_j,\Sigma_j)}}_{\gamma (z_{nk})} \Sigma_k (x_n-\mu_k) \eqno{(9.16)} $$
\end{frame}

 

效果如下:

 

 

 

Latex數學公式中的空格:

兩個quad空格 a \qquad b a \qquad b 兩個m的寬度
quad空格 a \quad b a \quad b 一個m的寬度
大空格 a\ b a\ b 1/3m寬度
中等空格 a\;b a\;b 2/7m寬度
小空格 a\,b a\,b 1/6m寬度
沒有空格 ab ab\,  
緊貼 a\!b a\!b 縮進1/6m寬度


\quad、1em、em、m代表當前字體下接近字符‘M’的寬度(approximately the width of an "M" in the current font) 

 

可參見:常用數學符號的 LaTeX 表示方法,,非常具體!

 

 

 

via:http://blog.sina.com.cn/s/blog_5e16f1770100fs38.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM