Markdown的语法与LaTeX的语法有诸多相似之处,本文使用 $$\begin{matrix}…\end{matrix}$$来写矩阵。

不带括号的矩阵

代码之后的tag实现了后标:

$$
  \begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix} \tag{1}
$$

写出的效果如下:
<mlabeledtr> <mtext> (1) </mtext> <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> </mlabeledtr> \begin{matrix} 1 &amp; 2 &amp; 3 \\ 4 &amp; 5 &amp; 6 \\ 7 &amp; 8 &amp; 9 \end{matrix} \tag{1} 147258369(1)
还是喜欢整整齐齐呢!

括号{}的矩阵

$$
  \begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix} \tag{1}
$$

实现的效果如下:
<mlabeledtr> <mtext> (2) </mtext> { <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> } </mlabeledtr> \left\{ \begin{matrix} 1 &amp; 2 &amp; 3 \\ 4 &amp; 5 &amp; 6 \\ 7 &amp; 8 &amp; 9 \end{matrix} \right\} \tag{2} 147258369(2)

括号[]的矩阵

$$
 \left[
 \begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix}
  \right] \tag{3}
$$

实现的效果如下:
<mlabeledtr> <mtext> (3) </mtext> [ <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> ] </mlabeledtr> \left[ \begin{matrix} 1 &amp; 2 &amp; 3 \\ 4 &amp; 5 &amp; 6 \\ 7 &amp; 8 &amp; 9 \end{matrix} \right] \tag{3} 147258369(3)

不使用left和right关键词

$$
 \begin{bmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{bmatrix} \tag{4}
$$

效果:
<mlabeledtr> <mtext> (4) </mtext> [ <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> ] </mlabeledtr> \begin{bmatrix} 1 &amp; 2 &amp; 3 \\ 4 &amp; 5 &amp; 6 \\ 7 &amp; 8 &amp; 9 \end{bmatrix} \tag{4} 147258369(4)
而对于大括号而言:

$$
 \begin{Bmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{Bmatrix} \tag{5}
$$

得到效果:
<mlabeledtr> <mtext> (5) </mtext> { <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> } </mlabeledtr> \begin{Bmatrix} 1 &amp; 2 &amp; 3 \\ 4 &amp; 5 &amp; 6 \\ 7 &amp; 8 &amp; 9 \end{Bmatrix} \tag{5} 147258369(5)

带省略号的矩阵

数学公式中常见的省略号有两种,\ldots表示与文本底线对齐的省略号,\cdots表示与文本中线对齐的省略号。

$$
\left[
\begin{matrix}
 1      & 2      & \cdots & 4      \\
 7      & 6      & \cdots & 5      \\
 \vdots & \vdots & \ddots & \vdots \\
 8      & 9      & \cdots & 0      \\
\end{matrix}
\right]
$$

可以看到,对应的符号都是使用\cdots ⋯ 等表示的
<mlabeledtr> <mtext> (6) </mtext> [ <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 0 </mstyle> ] </mlabeledtr> \left[ \begin{matrix} 1 &amp; 2 &amp; \cdots &amp; 4 \\ 7 &amp; 6 &amp; \cdots &amp; 5 \\ \vdots &amp; \vdots &amp; \ddots &amp; \vdots \\ 8 &amp; 9 &amp; \cdots &amp; 0 \\ \end{matrix} \right]\tag{6} 178269450(6)

带参数的矩阵

这里笔者希望在矩阵中画出一条分割线,以强调最右侧一列的特殊性。
其中\begin{array}{cc|c}中的c表示居中对齐元素

$$ 
\left[
    \begin{array}{cc|c}
      1 & 2 & 3 \\
      4 & 5 & 6
    \end{array}
\right] \tag{7}
$$

效果如下:
<mlabeledtr> <mtext> (7) </mtext> [ <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> ] </mlabeledtr> \left[ \begin{array}{cc|c} 1 &amp; 2 &amp; 3 \\ 4 &amp; 5 &amp; 6 \end{array} \right] \tag{7} [142536](7)

单线矩阵

$$
\begin{vmatrix}
	1&2&3\\
	4&5&6\\
	7&8&9
\end{vmatrix}
 \tag{8}
$$

实现效果:
<mlabeledtr> <mtext> (8) </mtext> <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> </mlabeledtr> \begin{vmatrix} 1&amp;2&amp;3\\ 4&amp;5&amp;6\\ 7&amp;8&amp;9 \end{vmatrix} \tag{8} 147258369(8)

双线矩阵

$$
\begin{Vmatrix}
1&2&3\\
4&5&6\\
7&8&9
\end{Vmatrix}
 \tag{9}
$$

实现效果:
<mlabeledtr> <mtext> (9) </mtext> <mstyle displaystyle="false" scriptlevel="0"> 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 3 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 4 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 5 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 6 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 7 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 8 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 9 </mstyle> </mlabeledtr> \begin{Vmatrix} 1&amp;2&amp;3\\ 4&amp;5&amp;6\\ 7&amp;8&amp;9 \end{Vmatrix} \tag{9} 147258369(9)

多元方程对齐

$$
\begin{cases} 
		a_{11}x_1&+&a_{12}x_2&+&\cdots&+a_{1n}x_n&=&b_1\\
		&&&&\vdots\\
		a_{n1}x_1&+&a_{n2}x_2&+&\cdots&+a_{nn}x_n&=&b_n&			
\end{cases}
$$

效果如下:
<mlabeledtr> <mtext> (10) </mtext> { <mstyle displaystyle="false" scriptlevel="0"> a 11 x 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> + </mstyle> <mstyle displaystyle="false" scriptlevel="0"> a 12 x 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> + </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> + a 1 n x n </mstyle> <mstyle displaystyle="false" scriptlevel="0"> = </mstyle> <mstyle displaystyle="false" scriptlevel="0"> b 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> a n 1 x 1 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> + </mstyle> <mstyle displaystyle="false" scriptlevel="0"> a n 2 x 2 </mstyle> <mstyle displaystyle="false" scriptlevel="0"> + </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> <mstyle displaystyle="false" scriptlevel="0"> + a n n x n </mstyle> <mstyle displaystyle="false" scriptlevel="0"> = </mstyle> <mstyle displaystyle="false" scriptlevel="0"> b n </mstyle> <mstyle displaystyle="false" scriptlevel="0"> </mstyle> </mlabeledtr> \begin{cases} a_{11}x_1&amp;+&amp;a_{12}x_2&amp;+&amp;\cdots&amp;+a_{1n}x_n&amp;=&amp;b_1\\ &amp;&amp;&amp;&amp;\vdots\\ a_{n1}x_1&amp;+&amp;a_{n2}x_2&amp;+&amp;\cdots&amp;+a_{nn}x_n&amp;=&amp;b_n&amp; \end{cases} \tag{10} a11x1an1x1++a12x2an2x2+++a1nxn+annxn==b1bn(10)

大括号右多行赋值

$$
\left\{\begin{array}{cc} 
		1, & x=f(Pa_{x})\\ 
		0, & other\ values 
\end{array}\right.
$$

实现效果:
<mlabeledtr> <mtext> (11) </mtext> { <mstyle displaystyle="false" scriptlevel="0"> 1 , </mstyle> <mstyle displaystyle="false" scriptlevel="0"> x = f ( P a x ) </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 0 , </mstyle> <mstyle displaystyle="false" scriptlevel="0"> o t h e r <mtext>   </mtext> v a l u e s </mstyle> </mlabeledtr> \left\{\begin{array}{cc} 1, &amp; x=f(Pa_{x})\\ 0, &amp; other\ values \end{array}\right. \tag{11} {1,0,x=f(Pax)other values(11)

用 cases

$$
P(x|Pa_x)=\begin{cases} 
		1, & x=f(Pa_{x})\\ 
		0, & other\ values 
\end{cases}
$$

实现效果:
<mlabeledtr> <mtext> (12) </mtext> P ( x P a x ) = { <mstyle displaystyle="false" scriptlevel="0"> 1 , </mstyle> <mstyle displaystyle="false" scriptlevel="0"> x = f ( P a x ) </mstyle> <mstyle displaystyle="false" scriptlevel="0"> 0 , </mstyle> <mstyle displaystyle="false" scriptlevel="0"> o t h e r <mtext>   </mtext> v a l u e s </mstyle> </mlabeledtr> P(x|Pa_x)=\begin{cases} 1, &amp; x=f(Pa_{x})\\ 0, &amp; other\ values \end{cases} \tag{12} P(xPax)={1,0,x=f(Pax)other values(12)

表格

| 标题 | 标题 | 标题 |
|:-|:-:|-:|
|内容左对齐标题|内容居中对齐标题|内容右对齐标题|

实现效果:

标题 标题 标题
内容左对齐标题 内容居中对齐标题 内容右对齐标题

括号的其他用法

求和符号上下限位置

1、默认情况下:

默认行内公式$\sum_{k=1}^n{x_k}$的上下限标注在右侧: k = 1 n x k \sum_{k=1}^n{x_k} k=1nxk
默认行间公式$$\sum_{k=1}^n{x_k}$$上下限标注在上下: <mlabeledtr> <mtext> (13) </mtext> <munderover> k = 1 n </munderover> x k </mlabeledtr> \sum_{k=1}^n{x_k} \tag{13} k=1nxk(13)
2、可强制修改:
强制行内公式$\sum\limits_{k=1}^n{x_k}$的上下限标注在上下: k = 1 n x k \sum\limits_{k=1}^n{x_k} k=1nxk
强制行间公式$$\sum\nolimits_{k=1}^n{x_k}$$上下限标注在右侧: <mlabeledtr> <mtext> (14) </mtext> k = 1 n x k </mlabeledtr> \sum\nolimits_{k=1}^n{x_k \tag{14}} k=1nxk(14)

数学符号字体

斜体加粗 AA:$\boldsymbol{A}$
效果: A \boldsymbol{A} A

LATEX基本语法

实用LATEX

$ y_k=\varphi(u_k+v_k)$ 
$J\alpha(x) = \sum{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha}$
注意下面的写法:(右对齐)
$$ y_k=\varphi(u_k+v_k)$$

效果如下:
y k = φ ( u k + v k ) y_k=\varphi(u_k+v_k) yk=φ(uk+vk)
J α ( x ) = m = 0 ( 1 ) m m ! Γ ( m + α + 1 ) ( x 2 ) 2 m + α J\alpha(x) = \sum{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha} Jα(x)=m=0m!Γ(m+α+1)(1)m(2x)2m+α
注意下面的写法:(右对齐)
<mlabeledtr> <mtext> (16) </mtext> y k = φ ( u k + v k ) </mlabeledtr> y_k=\varphi(u_k+v_k) \tag{16} yk=φ(uk+vk)(16)

输入上下标

^表示上标, _表示下标。如果上下标的内容多于一个字符,要用{}把这些内容括起来当成一个整体。上下标是可以嵌套的,也可以同时使用。例如:

$x^{y^z}=(1+{\rm e}^x)^{-2xy^w}$
$f(x)=x_2^3+1$
如果要在左右两边都有上下标,可以用\sideset命令...

实现效果:
<mlabeledtr> <mtext> (17) </mtext> x y z = ( 1 + e x ) 2 x y w , f ( x ) = x 2 3 + 1 </mlabeledtr> {x^{y^z}=(1+{\rm e}^x)^{-2xy^w} ,f(x)=x_2^3+1} \tag{17} xyz=(1+ex)2xyw,f(x)=x23+1(17)

微分方程

$$\frac{du}{dt} and \frac{d^2 u}{dx^2}$$

效果如下:
<mlabeledtr> <mtext> (18) </mtext> d u d t a n d d 2 u d x 2 </mlabeledtr> \frac{du}{dt} and \frac{d^2 u}{dx^2} \tag{18} dtduanddx2d2u(18)

偏微分方程

$$\frac{\partial u}{\partial t}= h^2 \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}  + \frac{\partial^2 u}{\partial z^2}\right)$$

效果如下:
<mlabeledtr> <mtext> (19) </mtext> u t = h 2 ( 2 u x 2 + 2 u y 2 + 2 u z 2 ) </mlabeledtr> \frac{\partial u}{\partial t}= h^2 \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2}\right) \tag{19} tu=h2(x22u+y22u+z22u)(19)

分数

$\frac{1}{3}$
$P(v)=\frac{1}{1+exp(-v/T)}$

效果如下:
<mlabeledtr> <mtext> (20) </mtext> 1 3 , P ( v ) = 1 1 + e x p ( v / T ) </mlabeledtr> \frac{1}{3},P(v)=\frac{1}{1+exp(-v/T)} \tag{20} 31,P(v)=1+exp(v/T)1(20)

开n次方根

$$\sqrt{2},\sqrt[n]{3}$$

效果如下:
<mlabeledtr> <mtext> (21) </mtext> 2 , 3 n </mlabeledtr> \sqrt{2},\sqrt[n]{3} \tag{21} 2 ,n3 (21)

向量

$\vec{a} \cdot \vec{b}=0$

实现效果:
<mlabeledtr> <mtext> (22) </mtext> <mover accent="true"> a </mover> <mover accent="true"> b </mover> = 0 </mlabeledtr> \vec{a} \cdot \vec{b}=0 \tag{22} a b =0(22)

积分

$\int_0^1 x^2 {\rm d}x$

实现效果:
<mlabeledtr> <mtext> (23) </mtext> 0 1 x 2 d x </mlabeledtr> \int_0^1 x^2 {\rm d}x\tag{23} 01x2dx(23)

极限运算

$\lim_{n \rightarrow +\infty} \frac{1}{n(n+1)}$
$\frac{1}{\lim_{u \rightarrow \infty}}, \frac{1}{\lim\limits_{u \rightarrow \infty}}$

实现效果:
<mlabeledtr> <mtext> (24) </mtext> <munder> lim n + </munder> 1 n ( n + 1 ) , 1 <munder> lim u </munder> , 1 <munder> lim u </munder> </mlabeledtr> \lim_{n \rightarrow +\infty} \frac{1}{n(n+1)},\frac{1}{\lim_{u \rightarrow \infty}}, \frac{1}{\lim\limits_{u \rightarrow \infty}}\tag{24} n+limn(n+1)1,limu1,ulim1(24)

累加、累乘运算

$\sum_{i=0}^n \frac{1}{i^2}$
$\prod_{i=0}^n \frac{1}{i^2}$

实现效果:
<mlabeledtr> <mtext> (25) </mtext> <munderover> i = 0 n </munderover> 1 i 2 , <munderover> i = 0 n </munderover> 1 i 2 </mlabeledtr> \sum_{i=0}^n \frac{1}{i^2},\prod_{i=0}^n \frac{1}{i^2}\tag{25} i=0ni21,i=0ni21(25)

希腊字母

三角函数与逻辑数学字符

感谢你花时间看我的总结,我是nuoyanli,我是热衷于ACM和大数据的技术宅,谢谢大家!