### 伪代码格式
-伪码具体格式没有严格要求,请参考算法导论或学术论文。注意不要写成 Python,赋值使用 `$\gets$` 表示。
-
-在 Wiki 中,使用 Markdown 引用来书写伪代码。
-
-不缩进: `> $\,$ your codes` 。
-
-两层缩进: `> $\,\qquad\qquad$ $x\gets 0$` 。
-
-例如:
-
-> **Input.** The edges of the graph $e$ , where each element in $e$ is $(u, v, w)$ denoting that there is an edge between $u$ and $v$ weighted $w$ .
->
-> **Output.** The edges of the MST of the input graph.
->
-> **Method.**
->
-> $\,$ $result \gets \varnothing$
->
-> $\,$ sort $e$ into nondecreasing order by weight $w$
->
-> $\,$ **for** each $(u, v, w)$ in the sorted $e$
->
-> $\,\qquad$ **if** $u$ and $v$ are not connected in the union-find set
->
-> $\,\qquad\qquad$ connect $u$ and $v$ in the union-find set
->
-> $\,\qquad\qquad$ $result \gets result\ \bigcup\ \{(u, v, w)\}$
->
-> $\,$ **return** $result$
-
-```markdown
-> **Input.** The edges of the graph $e$ , where each element in $e$ is $(u, v, w)$ denoting that there is an edge between $u$ and $v$ weighted $w$ .
->
-> **Output.** The edges of the MST of the input graph.
->
-> **Method.**
->
-> $\,$ $result \gets \varnothing$
->
-> $\,$ sort $e$ into nondecreasing order by weight $w$
->
-> $\,$ **for** each $(u, v, w)$ in the sorted $e$
->
-> $\,\qquad$ **if** $u$ and $v$ are not connected in the union-find set
->
-> $\,\qquad\qquad$ connect $u$ and $v$ in the union-find set
->
-> $\,\qquad\qquad$ $result \gets result\ \bigcup\ \{(u, v, w)\}$
->
-> $\,$ **return** $result$
+伪码具体格式没有严格要求,请参考算法导论或学术论文,注意不要写成 Python。
+
+Wiki 内使用 LaTeX 书写伪码,缩进使用 `$\qquad$`,文字描述使用 `$\text$`,关键字使用 `$\textbf$`,赋值使用 `$\gets$`。
+
+$\begin{aligned}\textbf{Input.}&\text{ The edges of the graph }e,\text{ where each element in }e\text{ is }(u, v, w)\\&\text{ denoting that there is an edge between }u\text{ and }v\text{ weighted }w\end{aligned}$
+
+$\textbf{Output.}\text{ The edges of the MST of the input graph.}$
+
+$\textbf{Method.}$
+
+$result \gets \varnothing$
+
+$\text{sort }e\text{ into nondecreasing order by weight }w$
+
+$\textbf{for}\text{ each }(u, v, w)\text{ in the sorted }e$
+
+$\qquad\textbf{if }u\text{ and }v\text{ are not connected in the union-find set}$
+
+$\qquad\qquad\text{connect }u\text{ and }v\text{ in the union-find set}$
+
+$\qquad\qquad result \gets result\ \bigcup\ \{(u, v, w)\}$
+
+$\textbf{return }result$
+
+```latex
+$\begin{aligned}\textbf{Input.}&\text{ The edges of the graph }e,\text{ where each element in }e\text{ is }(u, v, w)\\&\text{ denoting that there is an edge between }u\text{ and }v\text{ weighted }w\end{aligned}$
+
+$\textbf{Output.}\text{ The edges of the MST of the input graph.}$
+
+$\textbf{Method.}$
+
+$result \gets \varnothing$
+
+$\text{sort }e\text{ into nondecreasing order by weight }w$
+
+$\textbf{for}\text{ each }(u, v, w)\text{ in the sorted }e$
+
+$\qquad\textbf{if }u\text{ and }v\text{ are not connected in the union-find set}$
+
+$\qquad\qquad\text{connect }u\text{ and }v\text{ in the union-find set}$
+
+$\qquad\qquad result \gets result\ \bigcup\ \{(u, v, w)\}$
+
+$\textbf{return }result$
```
## 图解