Markdown formula guide
Markdown formula guide
Article from https://www.zybuluo.com/codeep/note/163962#4如何输入分数
#Cmd Markdown Formula Guide
Tags: Tutorial
2018-03-20 Supplement: I have received many requests from friends for reprinting the source document of this article, so I have sent an md file. Please [download] (http://file.ericp.cn/work/mathjax_cmdeditor.md) as needed. Permanent link to this article: https://www.zybuluo.com/codeep/note/163962
Click to jump to [Cmd Markdown Concise Grammar Manual] (https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown) and start the recording and writing journey of Cmd Markdown editing reader immediately!
This article is a syntax guide for MathJax in the Cmd Markdown environment.
Cmd Markdown editing reader supports $\LaTeX$ editing display support, for example: $\sum_{i=1}^n a_i=0$, visit MathJax for more usage methods.
Right-click on each formula and select [Show Math As] → [TeX Commands] to view the command details of the formula.
[TOC]
1. Reference for formula usage
1. How to insert a formula
There are two types of mathematical formulas in $\LaTeX$: in-line formulas and independent formulas. In-line formulas are placed in the text mixed with other text, and independent formulas are placed on separate lines.
The formula in the row can be expressed as follows:
: $ mathematical formula $
The independent formula can be expressed as follows:
: $$ Math formula $$
The automatic numbering formula can be expressed as follows: : If manual numbering is required, see [Use of Braces and Line Markers](#14 Use of Braces and Line Markers).
: \begin{equation} mathematical formula \label{eq: current formula name} \end{equation}
**The automatically numbered formula can be referenced anywhere in the text using the \eqref{eq:公式名} statement. **
- Example:
$ J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha} \text {,行内公式示例} $
-
Display: $ J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha} \text {, inline formula example} $
-
Example:
$$ J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha} \text {,独立公式示例} $$
-
Display: $$ J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha} \text {, independent formula example} $$
-
Example:
在公式 \eqref{eq:sample} 中,我们看到了这个被自动编号的公式。
\begin{equation}
E=mc^2 \text{,自动编号公式示例}
\label{eq:Sample}
\end{equation}
- Display:
$$In the formula \eqref{eq:sample}, we see this automatically numbered formula. $$
\begin{equation} E=mc^2 \text{, example of automatic numbering formula} \label{eq:sample} \end{equation}
##2. How to enter superscript and subscript
^ represents superscript, _ represents subscript. If the content of the superscript and subscript is more than one character, you need to use {} to enclose the content as a whole. Superscripts and subscripts can be nested or used at the same time.
- Example:
$$ x^{y^z}=(1+{\rm e}^x)^{-2xy^w} $$
- Display: $$ x^{y^z}=(1+{\rm e}^x)^{-2xy^w} $$
In addition, if you want to have superscripts and subscripts on the left and right sides, you can use the \sideset command.
- Example:
$$ \sideset{^1_2}{^3_4}\bigotimes $$
- Display: $$\sideset{^1_2}{^3_4}\bigotimes$$
##3. How to enter brackets and delimiters
(), [] and | represent the symbols themselves, use \{\} to represent {}. When you want to display large brackets or delimiters, use the \left and \right commands.
Some special brackets:
| Input | Display | Input | Display |
|---|---|---|---|
| \langle | $\langle$ | \rangle | $\rangle$ |
| \lceil | $\lceil$ | \rceil | $\rceil$ |
| \lfloor | $\lfloor$ | \rfloor | $\rfloor$ |
| \lbrace | $\lbrace$ | \rbrace | $\rbrace$ |
- Example:
$$ f(x,y,z) = 3y^2z \left( 3+\frac{7x+5}{1+y^2} \right) $$
- Display: $$ f(x,y,z) = 3y^2z \left( 3+\frac{7x+5}{1+y^2} \right) $$
Sometimes it is necessary to use \left. or \right. to match without displaying itself.
- Example:
$$ \left. \frac{\{\rm d}u}{\{\rm d}x} \right| _{x=0} $$
- Display: $$ \left. \frac{{\rm d}u}{{\rm d}x} \right| _{x=0} $$
##4. How to enter fractions
Usually the \frac {分子} {分母} command is used to generate a score, and scores can be nested.
For convenience, you can directly enter \frac ab to quickly generate a $\frac ab$.
If the fraction is very complex, you can also use the 分子 \over 分母 command, in which case there is only one level of fraction.
- Example:
$$\frac{a-1}{b-1} \quad and \quad {a+1\over b+1}$$
- Display: $$\frac{a-1}{b-1} \quad and \quad {a+1\over b+1}$$
##5. How to enter the square root
Use the \sqrt [根指数,省略时为2] {被开方数} command to enter the square root.
- Example:
$$\sqrt{2} \quad and \quad \sqrt[n]{3}$$
- Display: $$\sqrt{2} \quad and \quad \sqrt[n]{3}$$
##6. How to enter an ellipsis
There are two common ellipses in mathematical formulas. \ldots represents an ellipsis aligned with the bottom line of the text, and \cdots represents an ellipsis aligned with the center line of the text.
- Example:
$$f(x_1,x_2,\underbrace{\ldots}_{\rm ldots} ,x_n) = x_1^2 + x_2^2 + \underbrace{\cdots}_{\rm cdots} + x_n^2$$
- Display: $$f(x_1,x_2,\underbrace{\ldots}{\rm ldots} ,x_n) = x_1^2 + x_2^2 + \underbrace{\cdots}{\rm cdots} + x_n^2$$
##7. How to enter vectors
Use \vec{矢量} to automatically generate a vector. You can also customize the symbols above the letters using commands such as \overrightarrow.
- Example:
$$\vec{a} \cdot \vec{b}=0$$
-
Display: $$\vec{a} \cdot \vec{b}=0$$
-
Example:
$$\overleftarrow{xy} \quad and \quad \overleftrightarrow{xy} \quad and \quad \overrightarrow{xy}$$
- Display: $$\overleftarrow{xy} \quad and \quad \overleftrightarrow{xy} \quad and \quad \overrightarrow{xy}$$
##8. How to enter points
Use \int_积分下限^积分上限 {被积表达式} to enter a point.
Example:
$$\int_0^1 {x^2} \,{\rm d}x$$
Display: $$\int_0^1 {x^2} ,{\rm d}x$$
In this example, the \, and {\rm d} parts can be omitted, but it is recommended to add them to make the formula more beautiful.
##9. How to enter extreme operations
Use \lim_{变量 \to 表达式} 表达式 to enter a limit. If necessary, you can change the \to symbol to any symbol.
Example:
$$ \lim_{n \to +\infty} \frac{1}{n(n+1)} \quad and \quad \lim_{x\leftarrow{示例}} \frac{1}{n(n+1)} $$
Display: $$\lim_{n \to +\infty} \frac{1}{n(n+1)} \quad and \quad \lim_{x\leftarrow{example}} \frac{1}{n(n+1)}$$
##10. How to enter accumulation and accumulation operations
Use \sum_{下标表达式}^{上标表达式} {累加表达式} to enter a total.
Similarly, use \prod \bigcup \bigcap to enter the multiplication, union, and intersection respectively.
When such symbols are displayed inline, superscript and subscript expressions will be moved to the upper and lower right corners.
- Example:
$$\sum_{i=1}^n \frac{1}{i^2} \quad and \quad \prod_{i=1}^n \frac{1}{i^2} \quad and \quad \bigcup_{i=1}^{2} R$$
- Display: $$\sum_{i=1}^n \frac{1}{i^2} \quad and \quad \prod_{i=1}^n \frac{1}{i^2} \quad and \quad \bigcup_{i=1}^{2} R$$
##11. How to type Greek letters
Enter \小写希腊字母英文全称 and \首字母大写希腊字母英文全称 to enter lowercase and uppercase Greek letters respectively.
**For uppercase Greek letters that are the same as existing letters, just enter the uppercase letters directly. **
| input | display | input | display | input | display | input | display |
|---|---|---|---|---|---|---|---|
| \alpha | $\alpha$ | A | $A$ | \beta | $\beta$ | B | $B$ |
| \gamma | $\gamma$ | \Gamma | $\Gamma$ | \delta | $\delta$ | \Delta | $\Delta$ |
| \epsilon | $\epsilon$ | E | $E$ | \zeta | $\zeta$ | Z | $Z$ |
| \eta | $\eta$ | H | $H$ | \theta | $\theta$ | \Theta | $\Theta$ |
| \iota | $\iota$ | I | $I$ | \kappa | $\kappa$ | K | $K$ |
| \lambda | $\lambda$ | \Lambda | $\Lambda$ | \mu | $\mu$ | M | $M$ |
| \nu | $\nu$ | N | $N$ | \xi | $\xi$ | \Xi | $\Xi$ |
| o | $o$ | O | $O$ | \pi | $\pi$ | \Pi | $\Pi$ |
| \rho | $\rho$ | P | $P$ | \sigma | $\sigma$ | \Sigma | $\Sigma$ |
| \tau | $\tau$ | T | $T$ | \upsilon | $\upsilon$ | \Upsilon | $\Upsilon$ |
| \phi | $\phi$ | \Phi | $\Phi$ | \chi | $\chi$ | X | $X$ |
| \psi | $\psi$ | \Psi | $\Psi$ | \omega | $\omega$ | \Omega | $\Omega$ |
| lowercase form | uppercase form | variable form | display |
|---|---|---|---|
| \epsilon | E | \varepsilon | $\epsilon \mid E \mid \varepsilon$ |
| \theta | \Theta | \vartheta | $\theta \mid \Theta \mid \vartheta$ |
| \rho | P | \varrho | $\rho \mid P \mid \varrho$ |
| \sigma | \Sigma | \varsigma | $\sigma \mid \Sigma \mid \varsigma$ |
| \phi | \Phi | \varphi | $\phi \mid \Phi \mid \varphi$ |
##12. How to enter other special characters
**If you need to display larger or smaller characters, insert the
\largeor\smallcommand before the symbol. **
If you cannot find the desired symbol, use $\rm{Detexify^2}$ to draw the desired symbol.
###(1). Relational operators
| input | display | input | display | input | display | input | display |
|---|---|---|---|---|---|---|---|
| \pm | $\pm$ | \times | $\times$ | \div | $\div$ | \mid | $\mid$ |
| \nmid | $\nmid$ | \cdot | $\cdot$ | \circ | $\circ$ | \ast | $\ast$ |
| \bigodot | $\bigodot$ | \bigotimes | $\bigotimes$ | \bigoplus | $\bigoplus$ | \leq | $\leq$ |
| \geq | $\geq$ | \neq | $\neq$ | \approx | $\approx$ | \equiv | $\equiv$ |
| \sum | $\sum$ | \prod | $\prod$ | \coprod | $\coprod$ | \backslash | $\backslash$ |
###(2). set operator
| input | display | input | display | input | display |
|---|---|---|---|---|---|
| \emptyset | $\emptyset$ | \in | $\in$ | \notin | $\notin$ |
| \subset | $\subset$ | \supset | $\supset$ | \subseteq | $\subseteq$ |
| \supseteq | $\supseteq$ | \bigcap | $\bigcap$ | \bigcup | $\bigcup$ |
| \bigvee | $\bigvee$ | \bigwedge | $\bigwedge$ | \biguplus | $\biguplus$ |
###(3). logarithmic operator
| input | display | input | display | input | display |
|---|---|---|---|---|---|
| \log | $\log$ | \lg | $\lg$ | \ln | $\ln$ |
###(4). Trigonometric operators
| input | display | input | display | input | display |
|---|---|---|---|---|---|
| 30^\circ | $30^\circ$ | \bot | $\bot$ | \angle A | $\angle A$ |
| \sin | $\sin$ | \cos | $\cos$ | \tan | $\tan$ |
| \csc | $\csc$ | \sec | $\sec$ | \cot | $\cot$ |
###(5). calculus operators
| input | display | input | display | input | display |
|---|---|---|---|---|---|
| \int | $\int$ | \iint | $\iint$ | \iiint | $\iiint$ |
| \iiiint | $\iiiint$ | \oint | $\oint$ | \prime | $\prime$ |
| \lim | $\lim$ | \infty | $\infty$ | \nabla | $\nabla$ |
###(6). Logical operators
| input | display | input | display | input | display |
|---|---|---|---|---|---|
| \because | $\because$ | \therefore | $\therefore$ | ||
| \forall | $\forall$ | \exists | $\exists$ | \not\subset | $\not\subset$ |
| \not< | $\not<$ | \not> | $\not>$ | \not= | $\not=$ |
###(7). hat symbol
| Input | Display | Input | Display |
|---|---|---|---|
| \hat{xy} | $\hat{xy}$ | \widehat{xyz} | $\widehat{xyz}$ |
| \tilde{xy} | $\tilde{xy}$ | \widetilde{xyz} | $\widetilde{xyz}$ |
| \check{x} | $\check{x}$ | \breve{y} | $\breve{y}$ |
| \grave{x} | $\grave{x}$ | \acute{y} | $\acute{y}$ |
###(8). slur
| Input | Display |
|---|---|
| \fbox{a+b+c+d} | $\fbox{a+b+c+d}$ |
| \overleftarrow{a+b+c+d} | $\overleftarrow{a+b+c+d}$ |
| \overrightarrow{a+b+c+d} | $\overrightarrow{a+b+c+d}$ |
| \overleftrightarrow{a+b+c+d} | $\overleftrightarrow{a+b+c+d}$ |
| \underleftarrow{a+b+c+d} | $\underleftarrow{a+b+c+d}$ |
| \underrightarrow{a+b+c+d} | $\underrightarrow{a+b+c+d}$ |
| \underleftrightarrow{a+b+c+d} | $\underleftrightarrow{a+b+c+d}$ |
| \overline{a+b+c+d} | $\overline{a+b+c+d}$ |
| \underline{a+b+c+d} | $\underline{a+b+c+d}$ |
| \overbrace{a+b+c+d}^{Sample} | $\overbrace{a+b+c+d}^{Sample}$ |
| \underbrace{a+b+c+d}_{Sample} | $\underbrace{a+b+c+d}_{Sample}$ |
| \overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0} | $\overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0}$ |
| \underbrace{a\cdot a\cdots a}_{b\text{ times}} | $\underbrace{a\cdot a\cdots a}_{b\text{ times}}$ |
###(9). arrow symbol
-
Recommended symbols: |input|display|input|display|input|display| |:–:|:–:|:–:|:–:|:–:|:–:| |\to|$\to$|\mapsto|$\mapsto$| |\implies|$\implies$|\iff|$\iff$|\impliedby|$\impliedby$|
-
Other available symbols: |Input|Display|Input|Display| |:–:|:–:|:–:|:–:| |\uparrow|$\uparrow$|\Uparrow|$\Uparrow$| |\downarrow|$\downarrow$|\Downarrow|$\Downarrow$| |\leftarrow|$\leftarrow$|\Leftarrow|$\Leftarrow$| |\rightarrow|$\rightarrow$|\Rightarrow|$\Rightarrow$| |\leftrightarrow|$\leftrightarrow$|\Leftrightarrow|$\Leftrightarrow$| |\longleftarrow|$\longleftarrow$|\Longleftarrow|$\Longleftarrow$| |\longrightarrow|$\longrightarrow$|\Longrightarrow|$\Longrightarrow$| |\longleftrightarrow|$\longleftrightarrow$|\Longleftrightarrow|$\Longleftright$|
##13. How to perform font conversion
If you want to convert the font of a certain part of the characters in the formula, you can use the {\字体 {需转换的部分字符}} command. For the \字体 part, you can refer to the following table to select the appropriate font. Normally, formulas default to Italian $italic$ .
The font in the example ALL CAPS is only available in uppercase.
|Input|Description|Show|Input|Description|Show| |:–:|:–:|:–:|:–:|:–:|:–:|:–:| |\rm|Roman font|$\rm{Sample}$|\cal|Flower font|$\cal{SAMPLE}$| |\it|Italian|$\it{Sample}$|\Bbb|Blackboard Bold|$\Bbb{SAMPLE}$| |\bf|Bold|$\bf{Sample}$|\mit|Math italic|$\mit{SAMPLE}$| |\sf|Isoline|$\sf{Sample}$|\scr|Handwritten|$\scr{SAMPLE}$| |\tt|Typewriter body|$\tt{Sample}$| |\frak|Old German font|$\frak{Sample}$|
Converting fonts is very common, for example in integrals:
- Example:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\int_0^1 x^2 dx & \int_0^1 x^2 \,{\rm d}x
\end{array}
```- Display:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\int_0^1 x^2 dx & \int_0^1 x^2 \,{\rm d}x
\end{array}
Pay attention to comparing the difference between $dx$ and ${\rm d} x$ between the two expressions.
The same effect can also be achieved using the `\operatorname` command. For details, see [Define a new symbol \operatorname](#1Define a new symbol-operatorname).
##14. Use of braces and line subscripts
Use `\left` and `\right` to create auto-matching heights of (round brackets), [square brackets] and {curly brackets}.
Use `\tag{行标}` before the end of each formula to implement row labels.
- Example:
$$ f\left( \left[ \frac{ 1+\left{x,y\right} }{ \left( \frac{x}{y}+\frac{y}{x} \right) \left(u+1\right) }+a \right]^{3/2} \right) \tag{行标} $$
- Display:
$$
f\left(
\left[
\frac{
1+\left\{x,y\right\}
}{
\left(
\frac{x}{y}+\frac{y}{x}
\right)
\left(u+1\right)
}+a
\right]^{3/2}
\right)
\tag{line tag}
$$
If you need to display corresponding brackets on different lines, you can use `\left.` or `\right.` to place a "shadow" bracket on each line:
- Example:
$$ \begin{aligned} a=&\left(1+2+3+ \cdots \right. \ & \cdots+ \left. \infty-2+\infty-1+\infty\right) \end{aligned} $$
- Display:
$$
\begin{aligned}
a=&\left(1+2+3+ \cdots \right. \\
& \cdots+ \left. \infty-2+\infty-1+\infty\right)
\end{aligned}
$$
If you need to make the delimiter displayed in the line larger, you can use the `\middle` command:
- Example:
$$
\left\langle
q
\middle|
\frac{\frac{x}{y}}{\frac{u}{v}}
\middle|
p
\right\rangle
$$
- Display:
$$
\left\langle
q
\middle\|
\frac{\frac{x}{y}}{\frac{u}{v}}
\middle|
p
\right\rangle
$$
##15. Other commands
###(1). Define new symbol \operatorname
Check [Definition of this command](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference/15077#15077) and [Discussion of this command](http://meta.math.stackexchange.com/search?q=operatorname) to learn more about this command.
- Example:
$$ \operatorname{Symbol} A $$
- Display: $$\operatorname{Symbol} A$$
###(2). Add comment text \text
You can still use `$公式$` to insert other formulas in `\text {文字}`.
- Example:
$$ f(n)= \begin{cases} n/2, & \text {if $n$ is even} \ 3n+1, & \text{if $n$ is odd} \end{cases} $$
- Display:
$$ f(n)= \begin{cases} n/2, & \text {if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases} $$
###(3). Add spaces between characters
Four widths of spaces are available: `\,`, `\;`, `\quad` and `\qquad`.
- Example:
$$ a , b \mid a ; b \mid a \quad b \mid a \qquad b $$
- Display: $$ a \, b \mid a \; b \mid a \quad b \mid a \qquad b $$
Of course, the same effect can be achieved using `\text {n个空格}`.
###(4). Change text color
Use `\color{颜色}{文字}` to change specific text colors.
Changing text color **requires browser support**, if the browser does not know the color you require, then the text will be rendered as black.
For older browsers (HTML4 and CSS2), the following colors are supported:
|Input|Display|Input|Display|
|:--:|:--:|:--:|:--:|
|black|$\color{black}{text}$|grey|$\color{grey}{text}$|
|silver|$\color{silver}{text}$|white|$\color{white}{text}$|
|maroon|$\color{maroon}{text}$|red|$\color{red}{text}$|
|yellow|$\color{yellow}{text}$|lime|$\color{lime}{text}$|
|olive|$\color{olive}{text}$|green|$\color{green}{text}$|
|teal|$\color{teal}{text}$|auqa|$\color{auqa}{text}$|
|blue|$\color{blue}{text}$|navy|$\color{navy}{text}$|
|purple|$\color{purple}{text}$|fuchsia|$\color{fuchsia}{text}$|
For newer browsers (HTML5 with CSS3), an additional 124 colors will be supported:
Enter `\color {#rgb} {text}` to customize more colors, among which `r` `g` `b` of `#rgb` can enter `0-9` and `a-f` to represent the purity (saturation) of red, green and blue.
- Example:
\begin{array}{|rrrrrrrr|}\hline \verb+#000+ & \color{#000}{text} & & & \verb+#00F+ & \color{#00F}{text} & & \ & & \verb+#0F0+ & \color{#0F0}{text} & & & \verb+#0FF+ & \color{#0FF}{text}\ \verb+#F00+ & \color{#F00}{text} & & & \verb+#F0F+ & \color{#F0F}{text} & & \ & & \verb+#FF0+ & \color{#FF0}{text} & & & \verb+#FFF+ & \color{#FFF}{text}\ \hline \end{array}
- Display:
\begin{array}{|rrrrrrrr|}\hline
\verb+#000+ & \color{#000}{text} & & &
\verb+#00F+ & \color{#00F}{text} & & \\
& & \verb+#0F0+ & \color{#0F0}{text} &
& & \verb+#0FF+ & \color{#0FF}{text}\\
\verb+#F00+ & \color{#F00}{text} & & &
\verb+#F0F+ & \color{#F0F}{text} & & \\
& & \verb+#FF0+ & \color{#FF0}{text} &
& & \verb+#FFF+ & \color{#FFF}{text}\\
\hline
\end{array}
- Example:
\begin{array}{|rrrrrrrr|} \hline \verb+#000+ & \color{#000}{text} & \verb+#005+ & \color{#005}{text} & \verb+#00A+ & \color{#00A}{text} & \verb+#00F+ & \color{#00F}{text} \ \verb+#500+ & \color{#500}{text} & \verb+#505+ & \color{#505}{text} & \verb+#50A+ & \color{#50A}{text} & \verb+#50F+ & \color{#50F}{text} \ \verb+#A00+ & \color{#A00}{text} & \verb+#A05+ & \color{#A05}{text} & \verb+#A0A+ & \color{#A0A}{text} & \verb+#A0F+ & \color{#A0F}{text} \ \verb+#F00+ & \color{#F00}{text} & \verb+#F05+ & \color{#F05}{text} & \verb+#F0A+ & \color{#F0A}{text} & \verb+#F0F+ & \color{#F0F}{text} \ \hline \verb+#080+ & \color{#080}{text} & \verb+#085+ & \color{#085}{text} & \verb+#08A+ & \color{#08A}{text} & \verb+#08F+ & \color{#08F}{text} \ \verb+#580+ & \color{#580}{text} & \verb+#585+ & \color{#585}{text} & \verb+#58A+ & \color{#58A}{text} & \verb+#58F+ & \color{#58F}{text} \ \verb+#A80+ & \color{#A80}{text} & \verb+#A85+ & \color{#A85}{text} & \verb+#A8A+ & \color{#A8A}{text} & \verb+#A8F+ & \color{#A8F}{text} \ \verb+#F80+ & \color{#F80}{text} & \verb+#F85+ & \color{#F85}{text} & \verb+#F8A+ & \color{#F8A}{text} & \verb+#F8F+ & \color{#F8F}{text} \ \hline \verb+#0F0+ & \color{#0F0}{text} & \verb+#0F5+ & \color{#0F5}{text} & \verb+#0FA+ & \color{#0FA}{text} & \verb+#0FF+ & \color{#0FF}{text} \ \verb+#5F0+ & \color{#5F0}{text} & \verb+#5F5+ & \color{#5F5}{text} & \verb+#5FA+ & \color{#5FA}{text} & \verb+#5FF+ & \color{#5FF}{text} \ \verb+#AF0+ & \color{#AF0}{text} & \verb+#AF5+ & \color{#AF5}{text} & \verb+#AFA+ & \color{#AFA}{text} & \verb+#AFF+ & \color{#AFF}{text} \ \verb+#FF0+ & \color{#FF0}{text} & \verb+#FF5+ & \color{#FF5}{text} & \verb+#FFA+ & \color{#FFA}{text} & \verb+#FFF+ & \color{#FFF}{text} \ \hline \end{array}
\begin{array}{|rrrrrrrr|}
\hline
\verb+#000+ & \color{#000}{text} & \verb+#005+ & \color{#005}{text} & \verb+#00A+ & \color{#00A}{text} & \verb+#00F+ & \color{#00F}{text} \\
\verb+#500+ & \color{#500}{text} & \verb+#505+ & \color{#505}{text} & \verb+#50A+ & \color{#50A}{text} & \verb+#50F+ & \color{#50F}{text} \\
\verb+#A00+ & \color{#A00}{text} & \verb+#A05+ & \color{#A05}{text} & \verb+#A0A+ & \color{#A0A}{text} & \verb+#A0F+ & \color{#A0F}{text} \\
\verb+#F00+ & \color{#F00}{text} & \verb+#F05+ & \color{#F05}{text} & \verb+#F0A+ & \color{#F0A}{text} & \verb+#F0F+ & \color{#F0F}{text} \\
\hline
\verb+#080+ & \color{#080}{text} & \verb+#085+ & \color{#085}{text} & \verb+#08A+ & \color{#08A}{text} & \verb+#08F+ & \color{#08F}{text} \\
\verb+#580+ & \color{#580}{text} & \verb+#585+ & \color{#585}{text} & \verb+#58A+ & \color{#58A}{text} & \verb+#58F+ & \color{#58F}{text} \\
\verb+#A80+ & \color{#A80}{text} & \verb+#A85+ & \color{#A85}{text} & \verb+#A8A+ & \color{#A8A}{text} & \verb+#A8F+ & \color{#A8F}{text} \\
\verb+#F80+ & \color{#F80}{text} & \verb+#F85+ & \color{#F85}{text} & \verb+#F8A+ & \color{#F8A}{text} & \verb+#F8F+ & \color{#F8F}{text} \\
\hline
\verb+#0F0+ & \color{#0F0}{text} & \verb+#0F5+ & \color{#0F5}{text} & \verb+#0FA+ & \color{#0FA}{text} & \verb+#0FF+ & \color{#0FF}{text} \\
\verb+#5F0+ & \color{#5F0}{text} & \verb+#5F5+ & \color{#5F5}{text} & \verb+#5FA+ & \color{#5FA}{text} & \verb+#5FF+ & \color{#5FF}{text} \\
\verb+#AF0+ & \color{#AF0}{text} & \verb+#AF5+ & \color{#AF5}{text} & \verb+#AFA+ & \color{#AFA}{text} & \verb+#AFF+ & \color{#AFF}{text} \\
\verb+#FF0+ & \color{#FF0}{text} & \verb+#FF5+ & \color{#FF5}{text} & \verb+#FFA+ & \color{#FFA}{text} & \verb+#FFF+ & \color{#FFF}{text} \\
\hline
\end{array}
###(5).添加删除线
使用删除线功能必须声明 `$$` 符号。
在公式内使用 `\require{cancel}` 来允许 **片段删除线** 的显示。
声明片段删除线后,使用 `\cancel{字符}`、`\bcancel{字符}`、`\xcancel{字符}` 和 `\cancelto{字符}` 来实现各种片段删除线效果。
- 例子:
$$ \require{cancel}\begin{array}{rl} \verb|y+\cancel{x}| & y+\cancel{x}\ \verb|\cancel{y+x}| & \cancel{y+x}\ \verb|y+\bcancel{x}| & y+\bcancel{x}\ \verb|y+\xcancel{x}| & y+\xcancel{x}\ \verb|y+\cancelto{0}{x}| & y+\cancelto{0}{x}\ \verb+\frac{1\cancel9}{\cancel95} = \frac15+& \frac{1\cancel9}{\cancel95} = \frac15 \ \end{array} $$
- 显示:
$$
\require{cancel}
\begin{array}{rl}
\verb|y+\cancel{x}| & y+\cancel{x}\\
\verb|\cancel{y+x}| & \cancel{y+x}\\
\verb|y+\bcancel{x}| & y+\bcancel{x}\\
\verb|y+\xcancel{x}| & y+\xcancel{x}\\
\verb|y+\cancelto{0}{x}| & y+\cancelto{0}{x}\\
\verb+\frac{1\cancel9}{\cancel95} = \frac15+& \frac{1\cancel9}{\cancel95} = \frac15 \\
\end{array}
$$
使用 `\require{enclose}` 来允许 **整段删除线** 的显示。
声明整段删除线后,使用 `\enclose{删除线效果}{字符}` 来实现各种整段删除线效果。
其中,删除线效果有 `horizontalstrike`、`verticalstrike`、`updiagonalstrike` 和 `downdiagonalstrike`,可叠加使用。
- 例子:
$$ \require{enclose}\begin{array}{rl} \verb|\enclose{horizontalstrike}{x+y}| & \enclose{horizontalstrike}{x+y}\ \verb|\enclose{verticalstrike}{\frac xy}| & \enclose{verticalstrike}{\frac xy}\ \verb|\enclose{updiagonalstrike}{x+y}| & \enclose{updiagonalstrike}{x+y}\ \verb|\enclose{downdiagonalstrike}{x+y}| & \enclose{downdiagonalstrike}{x+y}\ \verb|\enclose{horizontalstrike,updiagonalstrike}{x+y}| & \enclose{horizontalstrike,updiagonalstrike}{x+y}\ \end{array} $$
- 显示:
$$
\require{enclose}\begin{array}{rl}
\verb|\enclose{horizontalstrike}{x+y}| & \enclose{horizontalstrike}{x+y}\\
\verb|\enclose{verticalstrike}{\frac xy}| & \enclose{verticalstrike}{\frac xy}\\
\verb|\enclose{updiagonalstrike}{x+y}| & \enclose{updiagonalstrike}{x+y}\\
\verb|\enclose{downdiagonalstrike}{x+y}| & \enclose{downdiagonalstrike}{x+y}\\
\verb|\enclose{horizontalstrike,updiagonalstrike}{x+y}| & \enclose{horizontalstrike,updiagonalstrike}{x+y}\\
\end{array}
$$
此外, `\enclose` 命令还可以产生包围的边框和圆等,参见 [MathML Menclose Documentation](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose) 以查看更多效果。
#二、矩阵使用参考
##1.如何输入无框矩阵
在开头使用 `begin{matrix}`,在结尾使用 `end{matrix}`,在中间插入矩阵元素,每个元素之间插入 `&` ,并在每行结尾处使用 `\\` 。
使用矩阵时必须声明 `$` 或 `$$` 符号。
- 例子:
$$ \begin{matrix} 1 & x & x^2 \ 1 & y & y^2 \ 1 & z & z^2 \ \end{matrix} $$
- 显示:
$$
\begin{matrix}
1 & x & x^2 \\
1 & y & y^2 \\
1 & z & z^2 \\
\end{matrix}
$$
##2.如何输入边框矩阵
在开头将 `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} $
- 显示:
|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} $|
##3.如何输入带省略符号的矩阵
使用 `\cdots` $\cdots$ , `\ddots` $\ddots$ , `\vdots` $\vdots$ 来输入省略符号。
- 例子:
$$ \begin{pmatrix} 1 & a_1 & a_1^2 & \cdots & a_1^n \ 1 & a_2 & a_2^2 & \cdots & a_2^n \ \vdots & \vdots & \vdots & \ddots & \vdots \ 1 & a_m & a_m^2 & \cdots & a_m^n \ \end{pmatrix} $$
$$
\begin{pmatrix}
1 & a_1 & a_1^2 & \cdots & a_1^n \\
1 & a_2 & a_2^2 & \cdots & a_2^n \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
1 & a_m & a_m^2 & \cdots & a_m^n \\
\end{pmatrix}
$$
##4. How to enter a matrix with delimiters
For details, see "[Array Usage Reference](#五array and table usage reference)".
- Example:
$$ \left[ \begin{array}{cc|c} 1&2&3\ 4&5&6 \end{array} \right] $$
- Display:
$$
\left[
\begin{array}{cc|c}
1&2&3\\
4&5&6
\end{array}
\right]
$$
Among them, `cc|c` represents inserting a dividing line between the second and third columns in a three-column matrix.
##5. How to enter a matrix in rows
If you want to display the matrix in one row,
Use `\bigl(\begin{smallmatrix} ... \end{smallmatrix}\bigr)`.
- Example:
这是一个行中矩阵的示例 $\bigl( \begin{smallmatrix} a & b \ c & d \end{smallmatrix} \bigr)$ 。
- Show: This is an example of a matrix in rows $\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)$ .
#3. Reference for using equation sequence
##1. How to enter a sequence of equations
People often want a neat and centered sequence of equations. Use `\begin{align}…\end{align}` to create a column of equations using `\\` at the end of each line.
There is no need to declare the formula symbols `$` or `$$` when using equation sequences.
Please note that the `{align}` statement is **auto-numbered**.
- Example:
\begin{align} \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \ & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \ & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right) \end{align}
- Display:
\begin{align}
\sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\
& = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\
& = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\
& = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\
& \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right)
\end{align}
The numbering of each row of formulas in this example continues from the automatic numbering formula \eqref{eq:sample} in [How to insert formulas](#1How to insert formulas).
##2. Write a reason in each line of a sequence of equations
Flexibly combine `\text` and `\tag` statements in `{align}`. `\tag` Statement numbering has higher priority than automatic numbering.
- Example:
\begin{align} v + w & = 0 &\text{Given} \tag 1\ -w & = -w + 0 & \text{additive identity} \tag 2\ -w + 0 & = -w + (v + w) & \text{equations $(1)$ and $(2)$} \end{align}
- Display:
\begin{align}
v + w & = 0 &\text{Given} \tag 1\\
-w & = -w + 0 & \text{additive identity} \tag 2\\
-w + 0 & = -w + (v + w) & \text{equations $(1)$ and $(2)$}
\end{align}
In this example, the automatic numbering in the first and second lines is overwritten by the `\tag` statement, and the numbering in the third line is automatic numbering.
#4. Reference for using conditional expressions
##1. How to enter a conditional expression
Use `begin{cases}` to create a set of conditional expressions, insert `&` in each line of conditions to specify what needs to be aligned, and use `\\` at the end of each line, ending with `end{cases}`.
The conditional expression does not need to declare the `$` or `$$` symbols.
- Example:
$$ f(n) = \begin{cases} n/2, & \text{if $n$ is even} \ 3n+1, & \text{if $n$ is odd} \end{cases} $$
- Display:
$$
f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
$$
##2. How to enter a left-aligned conditional expression
If you want the text to be displayed aligned on the left, you can do the following:
- Example:
$$ \left. \begin{array}{l} \text{if $n$ is even:}&n/2\ \text{if $n$ is odd:}&3n+1 \end{array} \right} =f(n) $$
- Display:
$$
\left.
\begin{array}{l}
\text{if $n$ is even:}&n/2\\
\text{if $n$ is odd:}&3n+1
\end{array}
\right\}
=f(n)
$$
##3. How to adapt conditional expression to row height
In some cases, the line height of some lines in the conditional expression is non-standard height. In this case, use the `\\[2ex]` statement to replace the `\\` at the end of the line to allow the editor to adapt.
- Example:
|Not suitable[2ex]|
|:--:|
|
$$ f(n) = \begin{cases} \frac{n}{2}, & \text{if $n$ is even} \ 3n+1, & \text{if $n$ is odd} \end{cases} $$
|Adaptation[2ex]|
|:--:|
|
$$ f(n) = \begin{cases} \frac{n}{2}, & \text{if $n$ is even} \[2ex] 3n+1, & \text{if $n$ is odd} \end{cases} $$
- Display:
|Not suitable[2ex]|
|:--:|
|$$
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
$$|
|Adaptation[2ex]|
|:--:|
|$$
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \\[2ex]
3n+1, & \text{if $n$ is odd}
\end{cases}
$$|
**A `[ex]` refers to an "X-Height", which is the height of the x letter. Multiple `[ex]` can be specified according to the situation, such as `[3ex]`, `[4ex]`, etc. **
In fact, you can use the `\\[2ex]` statement anywhere as you see fit.
#5. Reference for using arrays and tables
##1. How to enter an array or table
Usually, a formatted table is more readable than plain text or typeset text. Both the array and the table start with `begin{array}`, and then define the number of columns and the text alignment properties of each column. `c` `l` `r` represents center, left alignment and right alignment respectively. If you need to insert a vertical dividing line, insert `|` in the definition. If you want to insert a horizontal dividing line, insert `\hline` before the next line of input. Similar to the matrix, `&` needs to be inserted between the elements in each row, the elements in each row end with `\\`, and finally the array ends with `end{array}`.
There is no need to declare the `$` or `$$` symbols when using a single array or table.
- Example:
\begin{array}{c|lcr} n & \text{左对齐} & \text{居中对齐} & \text{右对齐} \ \hline 1 & 0.24 & 1 & 125 \ 2 & -1 & 189 & -8 \ 3 & -20 & 2000 & 1+10i \end{array}
- Display:
\begin{array}{c|lcr}
n & \text{left-aligned} & \text{center-aligned} & \text{right-aligned} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i
\end{array}
##2. How to enter a nested array or table
Multiple arrays/tables can be nested within each other and form a set of arrays/tables.
The `$$` symbol must be declared before using nesting.
- Example:
$$ % outer vertical array of arrays 外层垂直表格 \begin{array}{c} % inner horizontal array of arrays 内层水平表格 \begin{array}{cc} % inner array of minimum values 内层"最小值"数组 \begin{array}{c|cccc} \text{min} & 0 & 1 & 2 & 3\ \hline 0 & 0 & 0 & 0 & 0\ 1 & 0 & 1 & 1 & 1\ 2 & 0 & 1 & 2 & 2\ 3 & 0 & 1 & 2 & 3 \end{array} & % inner array of maximum values 内层"最大值"数组 \begin{array}{c|cccc} \text{max}&0&1&2&3\ \hline 0 & 0 & 1 & 2 & 3\ 1 & 1 & 1 & 2 & 3\ 2 & 2 & 2 & 2 & 3\ 3 & 3 & 3 & 3 & 3 \end{array} \end{array} % 内层第一行表格组结束 \ % inner array of delta values 内层第二行Delta值数组 \begin{array}{c|cccc} \Delta&0&1&2&3\ \hline 0 & 0 & 1 & 2 & 3\ 1 & 1 & 0 & 1 & 2\ 2 & 2 & 1 & 0 & 1\ 3 & 3 & 2 & 1 & 0 \end{array} % 内层第二行表格组结束 \end{array} $$
$$
% outer vertical array of arrays outer vertical table
\begin{array}{c}
% inner horizontal array of arrays inner horizontal table
\begin{array}{cc}
% inner array of minimum values inner "minimum value" array
\begin{array}{c|cccc}
\text{min} & 0 & 1 & 2 & 3\\
\hline
0 & 0 & 0 & 0 & 0\\
1 & 0 & 1 & 1 & 1\\
2 & 0 & 1 & 2 & 2\\
3 & 0 & 1 & 2 & 3
\end{array}
&
% inner array of maximum values inner "maximum value" array
\begin{array}{c|cccc}
\text{max}&0&1&2&3\\
\hline
0 & 0 & 1 & 2 & 3\\
1 & 1 & 1 & 2 & 3\\
2 & 2 & 2 & 2 & 3\\
3 & 3 & 3 & 3 & 3
\end{array}
\end{array}
% The end of the first row of the inner table group
\\
% inner array of delta values Delta value array in the second row of the inner layer
\begin{array}{c|cccc}
\Delta&0&1&2&3\\
\hline
0 & 0 & 1 & 2 & 3\\
1 & 1 & 0 & 1 & 2\\
2 & 2 & 1 & 0 & 1\\
3 & 3 & 2 & 1 & 0
\end{array}
% The end of the second row of the inner table group
\end{array}
$$
##3. How to enter a system of equations
Use `\begin{array}…\end{array}` and `\left\{…\right.` to create a system of equations.
- Example:
$$ \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. $$
- Display:
$$
\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.
$$
Or use the conditional expression group `\begin{cases}…\end{cases}` to achieve the same effect:
- Example:
\begin{cases} 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{cases}
- Display:
\begin{cases}
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{cases}
#6. Reference for using continued fractions
##1. How to enter a continued fraction
Just like you would use `\frac` when entering a fraction, use `\cfrac` to create a continued fraction.
- Example:
$$ x = a_0 + \cfrac{1^2}{a_1 + \cfrac{2^2}{a_2 + \cfrac{3^2}{a_3 + \cfrac{4^4}{a_4 + \cdots}}}} $$
- Display:
$$
x = a_0 + \cfrac{1^2}{a_1
+ \cfrac{2^2}{a_2
+ \cfrac{3^2}{a_3 + \cfrac{4^4}{a_4 + \cdots}}}}
$$
Don't create with plain `\frac` or `\over`, otherwise it will look **disgusting**.
- Counterexample:
$$ x = a_0 + \frac{1^2}{a_1 + \frac{2^2}{a_2 + \frac{3^2}{a_3 + \frac{4^4}{a_4 + \cdots}}}} $$
- Display:
$$
x = a_0 + \frac{1^2}{a_1
+ \frac{2^2}{a_2
+ \frac{3^2}{a_3 + \frac{4^4}{a_4 + \cdots}}}}
$$
Of course, you can use `\frac` to express the **condensed notation** of continued fractions.
- Example:
$$ x = a_0 + \frac{1^2}{a_1+} \frac{2^2}{a_2+} \frac{3^2}{a_3 +} \frac{4^4}{a_4 +} \cdots $$
- Display:
$$
x = a_0 + \frac{1^2}{a_1+}
\frac{2^2}{a_2+}
\frac{3^2}{a_3 +} \frac{4^4}{a_4 +} \cdots
$$
Continued fractions are usually too large to be typed easily, so it is recommended to declare the `$$` symbols before and after the continued fraction, or to use a compact notation like `[a0;a1,a2,a3,…]`.
#7. Reference for using exchange charts
##1. How to enter an exchange chart
Use the `$ \require{AMScd} $` line to allow the display of the chart to be swapped.
After declaring a swap chart, the syntax is similar to a matrix, using `begin{CD}` at the beginning, `end{CD}` at the end, inserting chart elements in the middle, `&` between each element, and `\\` at the end of each row.
- Example:
$\require{AMScd}$ \begin{CD} A @>a>> B\ @V b V V# @VV c V\ C @>>d> D \end{CD}
- Display:
$\require{AMScd}$
\begin{CD}
A @>a>> B\\
@V b V V\# @VV c V\\
C @>>d> D
\end{CD}
Among them, `@>>>` represents the right arrow, `@<<<` represents the left arrow, `@VVV` represents the down arrow, `@AAA` represents the up arrow, `@=` represents the horizontal double solid line, `@|` represents the vertical double solid line, and `@.` represents no arrow.
Insert any text between `@>>>` and `>>>` to represent the comment text of the arrow.
- Example:
\begin{CD} A @>>> B @>{\text{very long label}}>> C \ @. @AAA @| \ D @= E @<<< F \end{CD}
- Display:
\begin{CD}
A @>>> B @>{\text{very long label}}>> C \\
@. @AAA @| \\
D @= E @<<< F
\end{CD}
In this example, the "very long label" automatically extends the length of the arrow it is located on and the corresponding arrow.
#8. Some special precautions
|**!! This paragraph is a personal translation and may contain inaccuracies!!**|
|:--:|
These are issues that won't affect the correctness of formulas, but might make them look significantly better or worse. Beginners should feel free to ignore this advice; someone else will correct it for them, or more likely nobody will care.
The minor issues pointed out now do not affect the correct display of equations, formulas, etc., but make them look noticeably better. Beginners can ignore these suggestions and someone with OCD will fix it for you, or, more likely, no one will notice the problem at all.
Don't use `\frac` in exponents or limits of integrals; it looks bad and can be confusing, which is why it is rarely done in professional mathematical typesetting. Write the fraction horizontally, with a slash:
Try not to use the `\frac` notation in base e exponential functions, limits, and integrals: it makes the entire function look weird and may cause ambiguity. This is why it almost never appears in professional mathematical typesetting.
Write these fractions sideways, separated by slashes `/` (use slashes instead of fraction lines).
- Example:
\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \ \hline \ e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \ \int_{-\frac\pi2}^\frac\pi2 \sin x,dx & \int_{-\pi/2}^{\pi/2}\sin x,dx \ \end{array}
- Display:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\
\int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\
\end{array}
The `|` symbol has the wrong spacing when it is used as a divider, for example in set comprehensions. Use `\mid` instead:
The `|` symbol produces incorrect spacing when used as a separator, so it is best to use `\mid` instead when separation is required.
- Example:
\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \ \hline \ {x|x^2\in\Bbb Z} & {x\mid x^2\in\Bbb Z} \ \end{array}
- Display:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\{x|x^2\in\Bbb Z\} & \{x\mid x^2\in\Bbb Z\} \\
\end{array}
For double and triple integrals, don't use `\int\int` or `\int\int\int`. Instead use the special forms `\iint` and `\iiint`:When using multiple integral symbols, do not use `\int` to declare multiple times. Use `\iint` directly to represent **double integral**, use `\iiint` to represent **triple integral**, etc. For infinite points, it can be represented by `\int \cdots \int`.
- Example:
\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \ \hline \ \int\int_S f(x),dy,dx & \iint_S f(x),dy,dx \ \int\int\int_V f(x),dz,dy,dx & \iiint_V f(x),dz,dy,dx \end{array}
- Display:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\int\int_S f(x)\,dy\,dx & \iint_S f(x)\,dy\,dx \\
\int\int\int_V f(x)\,dz\,dy\,dx & \iiint_V f(x)\,dz\,dy\,dx
\end{array}
$$Unlimited points: \int \cdots \int$$
Use `\,`, to insert a thin space before differentials; without this $\TeX$ will mash them together:
Add `\,` before the differential symbol to insert a small gap; without the `\,` symbol, $\TeX$ will stack different differential symbols together.
- Example:
\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \ \hline \ \iiint_V f(x){\rm d}z {\rm d}y {\rm d}x & \iiint_V f(x),{\rm d}z,{\rm d}y,{\rm d}x \end{array}
- Display:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\iiint_V f(x){\rm d}z {\rm d}y {\rm d}x & \iiint_V f(x)\,{\rm d}z\,{\rm d}y\,{\rm d}x
\end{array}
---
Thank you for taking the time to read this instruction manual. There may be omissions in the contents of this manual. We welcome corrections and corrections.
For more syntax, please see: [Cmd Markdown Concise Syntax Manual] (https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown), [Cmd Markdown Advanced Syntax Manual] (https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown#cmd-markdown-高阶语法手册).
I wish you a happy recording, reading and sharing!
Drafted & Translated by [Eric P.](https://ericp.cn/)
2015-10-02
读完之后,下一步看什么
如果还想继续了解,可以从下面几个方向接着读。
