User Tools

Site Tools


wiki:latex_mathematics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:latex_mathematics [2019/03/30 05:00]
zhwiki [数学符号列表]
wiki:latex_mathematics [2022/06/16 05:18] (current)
zhwiki [数学环境]
Line 1: Line 1:
 ====== LaTeX/​数学公式 ====== ====== LaTeX/​数学公式 ======
  
-本页参考:https://​en.wikibooks.org/​wiki/​LaTeX/​Mathematics,为使用方便在此重新编辑。+本页参考了wikibooks的内容((https://​en.wikibooks.org/​wiki/​LaTeX/​Mathematics)),为使用方便在此重新编辑。
  
 如果文档仅需要一些简单的数学公式,LaTeX 就可以满足需求;如果一个科技文档包含大量复杂公式, [[amsmath]]包引入一些新命令,比基础的LaTeX更强大和灵活;[[mathtools]]包修正了[[amsmath]]包的一些怪诞的地方,并增加了一些有用的设置、符号和环境。要使用这些包,需要在文档的导言中添加以下命令。 如果文档仅需要一些简单的数学公式,LaTeX 就可以满足需求;如果一个科技文档包含大量复杂公式, [[amsmath]]包引入一些新命令,比基础的LaTeX更强大和灵活;[[mathtools]]包修正了[[amsmath]]包的一些怪诞的地方,并增加了一些有用的设置、符号和环境。要使用这些包,需要在文档的导言中添加以下命令。
Line 32: Line 32:
   - 所有空格与换行都会失去作用,要在数学模式里使用空格,​ 使用 \quad 输入一个标准宽度的空格,或者使用 \ 或 \; 或 \, 等输入宽度不同的空格;   - 所有空格与换行都会失去作用,要在数学模式里使用空格,​ 使用 \quad 输入一个标准宽度的空格,或者使用 \ 或 \; 或 \, 等输入宽度不同的空格;
   - 不允许出现空行,​ 每个公式占一行;   - 不允许出现空行,​ 每个公式占一行;
-  - 所有字母都会按变量(var)格式排版,​ 如果需要排版普通文本,​ 请使用特定的命令+  - 所有字母都会按变量(var)格式排版,​ 如果需要排版普通文本,​ 请使用特定的命令; 
 +  - 百分号 % 后面的内容都表示注释,如果要输入百分号,使用''​\%''​
  
 +多行的数学公式使用环境''​align''​,需要换行的地方使用''​\\''​,在需要对齐的地方使用''&''​,如需要对齐等号,在等号前加''&''​;''​align''​环境每行公式使用一个编号,如果多行公式使用一个编号,使用环境''​split''​。
 +
 +<​code>​
 +\begin{align}
 +......
 +\end{align}
 +</​code>​
 ==== 在行内插入显示公式样式 ==== ==== 在行内插入显示公式样式 ====
  
Line 46: Line 54:
 公式''​\forall x \in X, \quad \exists y \leq \epsilon''​ 输出: 公式''​\forall x \in X, \quad \exists y \leq \epsilon''​ 输出:
 $$ \forall x \in X, \quad \exists y \leq \epsilon $$ $$ \forall x \in X, \quad \exists y \leq \epsilon $$
 +
 +==== 特殊符号 ====
 +
 +一些符号,如''#​, %, &, {, }, ~, \, _, ^''​,在Tex中有特殊的用途,需要使用反斜杠转义。其中 ''​$''​作为数学公式的界定符,在公式中使用还不能处理。
 +
 +^ 符号 ^ 命令 ^ 符号 ^ 命令 ^ 符号 ^ 命令 ^ 符号 ^ 命令 ^ 符号 ^ 命令 ^
 +| $ \%\, $ | ''​ \% ''​ | $ \#\, $ | ''​ \# ''​ | $ \^{}\, $ | ''​ \^{} ''​ | $ \&\, $ | ''​ \& ''​ | $ \backslash\,​ $ | ''​ \backslash ''​ |
 +| $ \{\, $ | ''​ \{ ''​ | $ \}\, $ | ''​ \} ''​ | $ \~{}\, $ | ''​ \~{} ''​ | $ \_\, $ | ''​ \_ ''​ |  |  |
  
 ===== 希腊字母 ===== ===== 希腊字母 =====
Line 96: Line 112:
 $$ \frac{\frac{1}{x}+\frac{1}{y}}{y-z} $$ $$ \frac{\frac{1}{x}+\frac{1}{y}}{y-z} $$
  
-注意:嵌套分数或行内分数 $ \tfrac{a}{b} $会明显比行间分数小,''​\tfrac}}''​ 和 ''​\dfrac''​ 命令会强制使用 ''​\textstyle''​ 和 ''​\displaystyle''​,同样二项式也有''​\tbinom''​ 和 ''​\dbinom''​命令。+**注意** 
 +  - 嵌套分数或行内分数 $ \tfrac{a}{b} $会明显比行间分数小,''​\tfrac}}''​ 和 ''​\dfrac''​ 命令会强制使用 ''​\textstyle''​ 和 ''​\displaystyle''​,同样二项式也有''​\tbinom''​ 和 ''​\dbinom''​命令。 
 +  - 命令 ''​\over''​ 是一个 TeX 和 LaTeX 中的原始命令,而 ''​\frac''​ 是 LaTeX 中独有的命令,这个命令建立在 ''​\over''​ 宏之上,提供了较高的容错能力。所以推荐使用 ''​\frac''​ 而非 ''​\over''​
  
 对于简单公式,使用指数下标或许更美观,例如 ''​^3/​_7''​,显示为 $ ^3/_7 $。 对于简单公式,使用指数下标或许更美观,例如 ''​^3/​_7''​,显示为 $ ^3/_7 $。
Line 118: Line 136:
            + \cfrac{1}{a_3 + \cfrac{1}{a_4}}}}            + \cfrac{1}{a_3 + \cfrac{1}{a_4}}}}
 $$ $$
 +
 +
 +用''/​frac,​ /tfrac, /dfrac/, /​cfrac''​表示分数的区别:
 +
 +  * ''​\tfrac''​ 设置分数为 textstyle
 +  * ''​\dfrac''​ 设置分数为 displaystyle
 +  * ''​\frac''​ 根据上下文决定使用 ''​\tfrac''​ 还是 ''​\dfrac''​
 +  * ''​\cfrac''​ 用于表示连续分数
  
 ===== 根 ===== ===== 根 =====
Line 648: Line 674:
 | $ \cot\, $  | ''​ \cot ''​ | $ \arccot\, $  | ''​ \arccot ''​ | $ \coth\, $  | ''​ \coth ''​ | | | | $ \cot\, $  | ''​ \cot ''​ | $ \arccot\, $  | ''​ \arccot ''​ | $ \coth\, $  | ''​ \coth ''​ | | |
  
-===== 总结 ===== 
- 
-As you begin to see, typesetting math can be tricky at times. However, because LaTeX provides so much control, you can get professional quality mathematics typesetting with relatively little effort (once you've had a bit of practice, of course!). It would be possible to keep going and going with math topics because it seems potentially limitless. However, with this tutorial, you should be able to get along sufficiently. 
- 
-{{TODO| 
-* introduce symbols from [http://​www.andy-roberts.net/​res/​writing/​latex/​symbols.pdf] 
-* add symbols from [http://​www.ctan.org/​tex-archive/​macros/​latex/​contrib/​wasysym/​wasysym.pdf] 
-* consider adding symbols from [http://​www.ctan.org/​tex-archive/​info/​symbols/​comprehensive/​symbols-letter.pdf] -- the list of nearly all symbols available for LaTeX 
-* Consider, instead of using the symbols from the above mentioned, using what has already been introduced in [http://​en.wikipedia.org/​wiki/​Math_markup] instead of retyping the tables 
-* How to box an equation within an align environment 
-* Color in equations 
-}} 
- 
-===== Notes ===== 
-<​references/>​ 
- 
-==Further reading== 
-* [[meta:​Help:​Displaying a formula]]: Wikimedia uses a subset of LaTeX commands. 
- 
-==External links== 
- 
-* [http://​detexify.kirelabs.org detexify]: applet for looking up LaTeX symbols by drawing them 
-* [http://​mirrors.ctan.org/​macros/​latex/​required/​amsmath/​amsmath.pdf <​tt>​amsmath</​tt>​ documentation] 
-* [http://​www.thestudentroom.co.uk/​wiki/​LaTeX LaTeX - The Student Room] 
-* [http://​www.ctan.org/​tex-archive/​info/​symbols/​comprehensive The Comprehensive LaTeX Symbol List] 
-* [http://​mathlex.org/​latex MathLex - LaTeX math translator and equation builder] 
- 
-<​noinclude>​ 
-{{LaTeX/​Bottom|Rules and Struts|Advanced Mathematics}} 
-</​noinclude>​ 
- 
-[[pl:​LaTeX/​Matematyka]] 
  
wiki/latex_mathematics.1553936446.txt.gz · Last modified: 2019/03/30 05:00 by zhwiki