# 画矩阵需要用到特殊的语法

1)画普通矩阵,不带括号的

$$

 \begin{matrix}

   a & b & c & d & e\\

   f & g & h & i & j \\

   k & l & m & n & o \\

   p & q & r & s & t

  \end{matrix} 

$$

```

\begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix}

```

2)画带中括号的矩阵

$$

\left[

 \begin{matrix}

   a & b & c & d & e\\

   f & g & h & i & j \\

   k & l & m & n & o \\

   p & q & r & s & t

  \end{matrix} 

\right]

$$

```

\left[ \begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix} \right]

```

(3) 画带大括号的矩阵

$$

\left\{

 \begin{matrix}

   a & b & c & d & e\\

   f & g & h & i & j \\

   k & l & m & n & o \\

   p & q & r & s & t

  \end{matrix} 

\right\}

$$

```

\left\{ \begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix} \right\}

```

4)矩阵前加个参数

$$A=

\left\{

 \begin{matrix}

   a & b & c & d & e\\

   f & g & h & i & j \\

   k & l & m & n & o \\

   p & q & r & s & t

  \end{matrix} 

\right\}

$$

```

A= \left\{ \begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix} \right\}

```

5)矩阵中间有省略号

//\cdots为水平方向的省略号

//\vdots为竖直方向的省略号

//\ddots为斜线方向的省略号


$$A=

\left\{

 \begin{matrix}

   a & b & \cdots & e\\

   f & g & \cdots & j \\

   \vdots & \vdots & \ddots & \vdots \\

   p & q & \cdots & t

  \end{matrix} 

\right\}

$$

```

A= \left\{ \begin{matrix} a & b & \cdots & e\\ f & g & \cdots & j \\ \vdots & \vdots & \ddots & \vdots \\ p & q & \cdots & t \end{matrix} \right\}

```

6)矩阵中间加根横线

//array必须为array

//{cccc|c}中的c表示矩阵元素,可以控制|的位置

$$A=

\left\{

 \begin{array}{cccc|c}

     a & b & c & d & e\\

     f & g & h & i & j \\

     k & l & m & n & o \\

     p & q & r & s & t

  \end{array} 

\right\}

$$

```

A= \left\{ \begin{array}{cccc|c} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{array} \right\}

```

# 求和的公式表达

内嵌公式,使用```$...$```. 单独展示的一行使用 ```$$...$$```.

渲染的差别,比如

$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$

会显示$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$ (内嵌模式) ,而下面这样

$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$

为独立的一块渲染区域,它是居中展示的,字体也要更大一些


# 符号

__希腊字母__,

 ```\alpha, \beta,, \omega```: $\alpha, \beta, … \omega$.

 

 __大写__, 

```\Gamma, \Delta,, \Omega```: $\Gamma, \Delta,, \Omega$.


__上标和下标__,

 use ^ and _. For example, ```x_i^2```: $x_i^2$, ```\log_2 x```: $\log_2 x$.


__分组__

Superscripts, subscripts, and other operations apply only to the next group. A group is either a single symbol, or any formula surrounded by curly braces {…}.

If you do __10^10__, you will get a surprise: $10^10$. 

But __10^{10}__ gives what you probably wanted: $10^{10}$.

Use curly braces to delimit a formula to which a superscript or subscript applies: x^5^6 is an error;  

{x^y}^z is ${x^y}^z$, and x^{y^z} is $x^{y^z}$. Observe the difference between x_i^2 $x_i^2$ and x_{i^2} $x_{i^2}$.


 __Parentheses(圆括号)__ 

 一般的()[], $(2+3)[4+4]$. Use `\{ and \}` for curly braces $\{\}$.


These do not scale with the formula in between, so if you write `(\frac{\sqrt x}{y^3})` the parentheses will be too small: (x√y3)


. Using `\left(…\right)` will make the sizes adjust automatically to the formula they enclose: $\left(\frac{\sqrt x}{y^3}\right)$ .


`\left` and `\right` apply to all the following sorts of parentheses:

|synbol|means|

|----|----|

| `( and )` | $$\left( x \right)$$ |

| `[ and ]` | $$\left[ x \right]$$ |

| `\{ and \}` | $$ \left\{ x \right\} $$ |

| `\|` |  $$\left\| x \right\|$$ |

| `\vert , \Vert` | $$\|x\|$$ 有问题,可能需要在其他的语境下才生效|

| `\langle and \rangle` | $$\langle x \rangle$$|

|  `\lceil and \rceil` | $$\lceil x \rceil $$ |

| `\lfloor and \rfloor` | $$\lfloor x \rfloor $$|


. \middle can be used to add additional dividers. There are also invisible parentheses, denoted by `.` : 

`\left. \frac12\right\rbrace` is $$\left.\frac12\right\rbrace$$ .


If manual size adjustments are required: ` \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) ` gives $$ \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) $$ .

Sums and integrals `\sum and \int`; the subscript is the lower limit and the superscript is the upper limit, so for example `\sum_1^n` $\sum_1^n$. Don't forget `{…}` if the limits are more than a single symbol. For example, 

``` \sum_{i=0}^\infty i^2``` is $\sum_{i=0}^\infty i^2 $. 

Similarly, 

|symbol|redered as|

|--|--|

|`\prod` | $\prod$ |

| `\int ` | $\int$ |

| `\bigcup ` | $\bigcup$ |

| `\bigcap ` | $\bigcap$ |

| `\iint ` | $\iint$ |

| `\iiint` | $\iiint$ |

| `\idotsint` | $\idotsint$ |

.


__Fractions__ There are three ways to make these. `\frac ab` applies to the next two groups, and produces $\frac ab$ ; 

for more complicated numerators and denominators use `{…}`: `\frac{a+1}{b+1}` is $\frac{a+1}{b+1}$.

If the numerator and denominator are complicated, you may prefer `\over`, which splits up the group that it is in: `{a+1\over b+1}` is ${a+1\over b+1}$ .

Using `\cfrac{a}{b}` command is useful for continued fractions $\cfrac{a}{b}$ , more details for which are given in this sub-article.



Fonts

Use \mathbb or \Bbb for "blackboard bold": ℂℍℕℚℝℤ


|symbols | for| redered as |

|--|--|--|

| `\mathbf` |  boldface | $\mathbf ABCDEFGHIJKLMNOPQRSTUVWXYZ$  |

| `\mathit` | italics| $\mathit ABCDEFGHIJKLMNOPQRSTUVWXYZ$ , $\mathit abcdefghijklmnopqrstuvwxyz$ |

 |`\pmb` | boldfaced italics | $\pmb ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ$ $\pmb abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz$ |

| `\mathtt` | typewriter | $\mathtt ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ$ |

| `\mathrm` | roman | $mathrm abcdefghijklmnopqrstuvwxyz$ |

| `\mathsf` | sans-serif | $\mathsf ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ$ |

| `\mathcal` | calligraphic letters| $\mathcal ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ$|

| `\mathscr` | script letters | $\mathscr ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ$ |

| `\mathfrak` | Fraktur (old German style) letters| $\mathfrak ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ$ |




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

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


* Radical signs Use sqrt, 

which adjusts to the size of its argument:`\sqrt{x^3} x3` means: $\sqrt{x^3} x3$; 

`\sqrt[3]{\frac xy}` means: $\sqrt[3]{\frac xy}$ . 

For complicated expressions, consider using {...}^{1/2} instead.


* Some special functions such as "lim", "sin", "max", "ln", and so on are normally set in roman font instead of italic font.

Use \lim, \sin, etc. to make these: `\sin x`:$\sin x$ , not `sin x` : $sin x$. 

Use subscripts to attach a notation to \lim: `\lim_{x\to 0}`: $\lim_{x\to 0}$


# There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:

| symbols | redered as |

|--|--|

| ` \lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq ` | $\lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq $ |

| You can use \not to put a slash through almost anything: `\not\lt` | $\not\lt$ but it often looks bad |

|`\times \div \pm \mp` | $\times \div \pm \mp$.|

| `\cdot` is a centered dot | $x \cdot y$ |

| `\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing ` | $\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing$ |

| `{n+1 \choose 2k} or \binom{n+1}{2k} (n+12k)` | ${n+1 \choose 2k} or \binom{n+1}{2k} (n+12k)$ |

| `\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto` | $\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto$ |

| `\land \lor \lnot \forall \exists \top \bot \vdash \vDash` | $\land \lor \lnot \forall \exists \top \bot \vdash \vDash$ |

| `\star \ast \oplus \circ \bullet` | $\star \ast \oplus \circ \bullet $ |

| `\approx \sim \simeq \cong \equiv \prec \lhd \therefore` | $\approx \sim \simeq \cong \equiv \prec \lhd \therefore $ |

| `\infty \aleph_0` | $\infty \aleph_0$ |

| ` \nabla \partial` | $\nabla \partial$ |


* For modular equivalence, use \pmod like this: `a\equiv b\pmod n` $$a\equiv b\pmod n$$.


* `\ldots` is the dots in a1,a2,,an

* `\cdots` is the dots in a1+a2++an


* Some Greek letters have variant forms:

`\epsilon \varepsilon `: $\epsilon \varepsilon$, 

`\phi \varphi`: $\phi \varphi$, 

and others. 

Script lowercase l is `\ell` $\ell$ .


Detexify lets you draw a symbol on a web page and then lists the TEX symbols that seem to resemble it. 


__These are not guaranteed to work in MathJax but are a good place to start. To check that a command is supported, note that MathJax.org maintains a list of currently supported LATEX commands, and one can also check Dr. Carol JVF Burns's page of TEX Commands Available in MathJax.__


@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);