latex数学公式(行内(间)公式标注/希腊字母/数学函数/配对括号/定理环境
本博文源于Latex,主要對Latex的數學公式進行學習,Latex的核心莫過于它的數學公式的宏包,宏包過于強大,以致于數學公式編輯起來非常優美。本博文分為:
- 行內行間兩種公式的編寫
- 各種字母的數學
- 數學函數的使用
- 配對括號的使用
- 多行公式的編輯
- 定理環境的輸入
實驗效果
實驗內容
行內與行間
行內代碼與行間代碼csdn都是支持的,這一部分可以參加博主的博文
Latex歐拉公式編輯-最美的數學公式
因此在使用的時候記住常用的符號即可。
打的都會被markdown析構掉,因此直接看代碼即可。
%開始行內公式學習 From $ a+b>c $,we have..\par From \(a+b>c\),we have.... %結束行內公式學習 %開始行間公式學習 Since $$ x^n+y^n=z^n, $$ \[x^n+y^n=z^n,\] \begin{displaymath} x^n+y^n=z^n, e^{i\pi} + 1 =0, \end{displaymath} we have... %結束行間公式學習公式標注
這個公式標注,csdn里好像運行的不怎么友好,不過,可以肯定的是標注是\begin{equation}到\end{equation}之間是公式編輯,然后會被加標注
$$x_1+y_1>z_1 \eqno{(1)} $$ \begin{equation} x^n+y^n=z^n \end{equation} \begin{equation} x^n+y^n=z^n \end{equation} \begin{equation} x^n+y^n=z^n \end{equation}因此運行結果如下:
希臘字母學習
一連串的希臘字母還包含黑板體和花體的英文字母,都是非常炫酷的。引入黑板體和花體的時候要特別注意引入包\usepackage{amssymb}
%開始對希臘字母進行學習 \[ \alpha\beta\delta\eta\gamma\iota \lambda\kappa\omega\sigma\zeta \] \[\Delta\Gamma\Lambda\Phi\Pi\Psi \Sigma\Theta\Omega\Upsilon\Xi \] %結束對希臘字母進行學習 %開始對黑板體或者花體進行輸出 $$ \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$ %結束對黑板體learning結果為
數學函數
數學函數充次整個高等數學的半壁江山,這些我用matlab跑了一遍其實也都是函數調用的問題。在latex中以下有特殊的作用:
- \int:積分
- \lim極限
- \sqrt根號
- \sin \cos \tan是三角函數
- \frac是分式
因此理解之后,然后再去看latex代碼就會發現有點眉目,積分和極限的趨向根據代碼中照貓畫虎即可。
%開始數學函數學習 \[ \frac{1}{2}+\frac{1}{3}=\frac{5}{6} \] \[ \sqrt{2}\cdot\sqrt[4]{2}=\sqrt[4]{8}\] \[ 2\sin x \cos x = \sin 2x \] \[ \lim_{n\to\infty}\frac{1}{n}=0 \] \[ \int\frac{1}{x} dx=\ln|x|+C \] \[ \int_0^\infty\frac{1}{x} dx=\ln|x|+C \]%結束對數學函數學習配對括號
括號沒配對之前,應該是這樣子的,配對之后就更加美觀了
在latex中\left和\right就是掌握配對的。
第三行代碼可以根據自己想要的括號進行相應的調整進行配對。
公式拆分進多行
公式拆分多行是latex防止數學公式過長的一種設置,公式的對齊和編號是更加美觀好看的再表現。因此就分成了:
- 對齊加編號\begin{align}%對齊
- 對齊不加編號\begin{align*}
- 不對齊加編號\begin{gather}%不對齊
- 不對齊不加編號\begin{gather*}
外加上每個都好關門,因此代碼就變成這樣子了
%開始多行公式學習\begin{gather}%不對齊 x+y=5\\ 2x+2y=8 \end{gather} \begin{align}%對齊 x + y &= 5 \\ 2x + 3y &= 8 \end{align} \begin{gather*}%不對齊不編號 x+y=5\\ 2x+2y=8 \end{gather*} \begin{align*}%對齊不編號 x + y &= 5 \\ 2x + 3y &= 8 \end{align*} \begin{equation} \begin{split} (2+3)\cdot5 &= 2\cdot5 + 3\cdot5 \\&=25 \end{split} \end{equation} \begin{equation} \left. \begin{aligned} x+y &> 5 \\ y-y &> 11 \end{aligned} \ \right\}\Rightarrow x^2 - y^2 > 55 \end{equation} \begin{eqnarray*} a x + b y &=& u \\ c x + d y &=& v \end{eqnarray*}%結束多行公式學習定理環境
定理環境是將理論與結論相融合,比如一條定理可以推出相應的結論。比如:一條定理加一條結論、一條定理加兩三條結論等等
如果要對其編號的話,加上[section]。沒特殊要求默認就行了。
實驗完整源碼
\documentclass[UTF8]{article}\usepackage{amssymb} %引入黑板體或者花體 \usepackage{amsmath} \usepackage{titletoc} \usepackage{ctexcap}\begin{document} %開始行內公式學習 From $ a+b>c $,we have..\par From \(a+b>c\),we have.... %結束行內公式學習 %開始行間公式學習 Since $$ x^n+y^n=z^n, $$ \[x^n+y^n=z^n,\] \begin{displaymath} x^n+y^n=z^n, e^{i\pi} + 1 =0, \end{displaymath} we have... %結束行間公式學習 %開始對行間公式進行標注 $$x_1+y_1>z_1 \eqno{(1)} $$ \begin{equation} x^n+y^n=z^n \end{equation} \begin{equation} x^n+y^n=z^n \end{equation} \begin{equation} x^n+y^n=z^n \end{equation} %結束對行間公式進行標注 %開始對希臘字母進行學習 \[ \alpha\beta\delta\eta\gamma\iota \lambda\kappa\omega\sigma\zeta \] \[\Delta\Gamma\Lambda\Phi\Pi\Psi \Sigma\Theta\Omega\Upsilon\Xi \] %結束對希臘字母進行學習 %開始對黑板體或者花體進行輸出 $$ \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$ %結束對黑板體或者話題的輸出 %開始數學函數學習 \[ \frac{1}{2}+\frac{1}{3}=\frac{5}{6} \] \[ \sqrt{2}\cdot\sqrt[4]{2}=\sqrt[4]{8}\] \[ 2\sin x \cos x = \sin 2x \] \[ \lim_{n\to\infty}\frac{1}{n}=0 \] \[ \int\frac{1}{x} dx=\ln|x|+C \] \[ \int_0^\infty\frac{1}{x} dx=\ln|x|+C \]%結束對數學函數學習 %開始配對括號的學習 \[\lim_{x\to\infty}(1+\frac{1}{x})^x=\mathrm{e}\] \[\lim_{x\to\infty}\left(1+\frac{1}{x}\right)^x=\mathrm{e}\] \[\Bigg< \bigg\{ \Big[ \big( xyz \big) \Big] \bigg\} \Bigg> \] %結束配對括號的學習 %開始多行公式學習\begin{gather}%不對齊 x+y=5\\ 2x+2y=8 \end{gather} \begin{align}%對齊 x + y &= 5 \\ 2x + 3y &= 8 \end{align} \begin{gather*}%不對齊不編號 x+y=5\\ 2x+2y=8 \end{gather*} \begin{align*}%對齊不編號 x + y &= 5 \\ 2x + 3y &= 8 \end{align*} \begin{equation} \begin{split} (2+3)\cdot5 &= 2\cdot5 + 3\cdot5 \\&=25 \end{split} \end{equation} \begin{equation} \left. \begin{aligned} x+y &> 5 \\ y-y &> 11 \end{aligned} \ \right\}\Rightarrow x^2 - y^2 > 55 \end{equation} \begin{eqnarray*} a x + b y &=& u \\ c x + d y &=& v \end{eqnarray*}%結束多行公式學習 %開始對定理環境的學習 \newtheorem{theorem}{Theorem}%一定理加推論 \newtheorem{corollary}{Corollary} \begin{theorem} This is a theorem. \end{theorem} \begin{corollary} This is a corollary. \end{corollary}\newtheorem{thrm}{Theorem} \newtheorem{corl}[thrm]{Corollary} \begin{thrm} This is a theorem. \end{thrm} \begin{corl} This is a corollary1. \end{corl} \begin{corl} This is a corollary2. \end{corl}\newtheorem{thm}{Theorem}[subsection] \newtheorem{cor}[thm]{Corollary} \begin{thm} This is a theorem. \end{thm} \begin{cor} This is a corollary. \end{cor}%結束對定理環境的學習 \end{document}實驗心得
在學習的時候開門和關門的匹配一定要做好,不然結果很難出來。
總結
以上是生活随笔為你收集整理的latex数学公式(行内(间)公式标注/希腊字母/数学函数/配对括号/定理环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: .net 出现的异常
- 下一篇: QListWidget设置自定义行间距