LaTeX 与 Markdown

· · 科技·工程

\operatorname{\LaTeX}$ 与 $\text {Markdown}$ 公式大全 $\text{ -- Version 2025/6/16}

0 食用前须知

最佳食用方式: \\

本文只是一个\operatorname{\LaTeX}基础公式大大滴不全,请勿当成luogu的\TeX渲染机制索引,因为luogu用的是\KaTeX\\ 若有遗漏不要在下方评论区说,私信给我说,我的私信是公开的(除非拉黑了,那真没办法)

本文引用了部分这篇文章的\operatorname{\LaTeX}详解(我给ta说了颜色不齐,ta 1. 反应没得,只好自己做),除此都来源于无聊自己摸索或百度百科或个人认为超好用的\operatorname{\LaTeX}在线编辑器打个广告(\gets这个网址准备好,有些luogu不支持的及时送到ICU此网址试验 %[如上图]% !!!),\text{Markdown}部分无借鉴!

这玩意写了我NaN小时,有问题求指出。。。

\\

可以喷,轻点儿QwQ

我决定了!!luogu不支持的我要用图片或相同效果的符号展现!!! 2025/1/26 注 你才知道可以这样吗

0.0 Reference

  • 关于\operatorname{\LaTeX}的这篇文章 (author: @Iowa_BattleShip) (https://www.luogu.com.cn/article/1gxob6zc)
  • 关于\operatorname{\LaTeX}的百度百科 (https://baike.baidu.com/item/LaTeX/1212106?fromtitle=LaTeX)
  • \operatorname{\LaTeX}在线编辑器 (https://www.latexlive.com)

1 \operatorname{\LaTeX}

1.0 简介

1.0.0 介绍

以下来自百度百科

\operatorname{\LaTeX}$ 读作 `/'lɑ:tεx/`(不是`/'lɑ:tεk/` 、`/'lɑ:tεks/`、`/'leɪtεks/`、`/'leɪtεks/`) ,在 $\text{ASCII}$ 中写作 `LaTeX`。$\\

是一种基于\operatorname{\TeX}的排版系统。由美国计算机学家莱斯利·兰伯特(Leslie Lamport)在20世纪80年代初期开发,利用这种格式,即使使用者没有排版和程序设计的知识也可以充分发挥由\TeX所提供的强大功能,能在几天、甚至几小时内生成很多具有书籍质量的印刷品。对于生成复杂表格和数学公式,这一点表现得尤为突出。因此它非常适用于生成高印刷质量的科技和数学类文档。这个系统同样适用于生成从简单的信件到完整书籍的所有其他种类的文档。\\

1.0.1 插入一个数学公式

将数学公式写在 $ $ 之间,代表的是插入行内公式(本文多使用此模式)。

\\

将数学公式写在 $$ $$ 之间,代表的是插入独立公式(会强制居中)。

1.1 注释

%在前面加一个 % 即是注释
%相当于C++的`//`、python的`#`
%想打出%,输入\%即可

1.2 字母记号

\bar{a} \acute{a} \check{a} \grave{a}
\quad \bar{a} \quad \acute{a} \quad \check{a} \quad \grave{a}
\dot{a} \ddot{a} \breve{a}
\quad \dot{a} \quad \ddot{a} \quad \mathring{a} \quad \breve{a}
\widehat{a} \vec{a} \not{a} \overgroup{a}
\quad \widehat{a} \quad \vec{a} \ \: \not{a} \ \ \; \overgroup{a}
\hat{a} = \^{a}
\tilde{a} = \~{a}
\quad \hat{a} = \^{a} \\ \quad \tilde{a} = \~{a}

1.3 函数

\exp_a\!b=a^b \exp b=e^b 3 \times 10^5
\quad \exp_a\!b=a^b \quad \exp b=e^b \quad 3 \times 10^5
\sin\alpha \cos\alpha \tan\alpha \sec\alpha \csc\alpha \cot\alpha \\
\arcsin\alpha \arccos\alpha \arctan\alpha \operatorname{arcsec}\alpha \operatorname{arccsc}\alpha \operatorname{arccot}\alpha \\
\sinh\alpha \cosh\alpha \tanh\alpha \operatorname{sech}\alpha \operatorname{csch}\alpha \coth\alpha
\quad \sin\alpha \quad \cos\alpha \quad \tan\alpha \quad \sec \alpha \quad \csc\alpha \quad \cot\alpha \\ \quad \arcsin\alpha \quad \arccos\alpha \quad \arctan\alpha \quad \operatorname{arcsec}\alpha \quad \operatorname{arccsc}\alpha \quad \operatorname{arccot}\alpha \\ \quad \sinh\alpha \quad \cosh\alpha \quad \tanh\alpha \quad \operatorname{sech}\alpha \quad \operatorname{csch}\alpha \quad \coth\alpha
\left\vert a\right\vert \\
\min \left( \cfrac{3}{5} ,4 \right) \\
\max(x,y) \\
\operatorname{lcm} \left( a,b \right) \\
\gcd(a,b) \\
\operatorname{BuZhiDaoShenMeHanShu} \left( \texttt{luogu},\texttt{yyds} \right)
%\operatorname{} 可以将任何字符串转换成标准函数的形式(如例6)。
\quad \left\vert a\right\vert \\ \quad \min \left( \cfrac{3}{5} ,4 \right) \\ \quad \max(x,y) \\ \quad \operatorname{lcm} \left( a,b \right) \\ \quad \gcd(a,b) \\ \quad \operatorname{BuZhiDaoShenMeHanShu} \left( \texttt{luogu},\texttt{yyds} \right)

1.4 界限 & 极限 & 对数

1.4.1 界限

\min x \max x \inf x \sup x
\quad \min x \quad \max x \quad \inf x \quad \sup x
\lim x \liminf x \limsup x
\quad \lim x \quad \liminf x \quad \limsup x
\dim x \deg x \det x \ker\phi
\quad \dim x \quad \deg x \quad \det x \quad \ker\phi

1.4.2 极限

\lim a \lim\limits_{x \to 0} \lim\limits_{x \to \infty} \textstyle\lim_{x \to 0}
\quad \lim a \quad \lim\limits_{x \to 0} \quad \lim\limits_{x \to \infty} \quad \textstyle\lim_{x \to 0}
\max\limits_{lim}x \min\limits_{lim}x
\quad \max\limits_{lim}x \quad \min\limits_{lim}x

1.4.3 对数

\log_2 x \lg x \ln x \exp a
\quad \log_2 x \quad \lg x \quad \ln x \quad \exp a
\log_a ({xy}) = \log_a x + \log_a y \\
\log_a \left({\cfrac{x}{y}}\right) = \log_a x - \log_a y \ ( y \neq 0 ) \\
\log_a \left({\cfrac{1}{x}}\right) = \log_a 1 - \log_a x = - \log_a x \ ( x \neq 0 ) \\
\log_a \left( x^n \right) = n \log_a x \\
\log_{\frac{1}{a}} x = - \log_a x
\quad \log_a ({xy}) = \log_a x + \log_a y \\ \quad \log_a \left({\cfrac{x}{y}}\right) = \log_a x - \log_a y \ ( y \neq 0 ) \\ \quad \log_a \left({\cfrac{1}{x}}\right) = \log_a 1 - \log_a x = - \log_a x \ ( x \neq 0 ) \\ \quad \log_a \left( x^n \right) = n \log_a x \\ \quad \log_{\frac{1}{a}} x = - \log_a x

1.5 映射

\Pr x \hom x \lVert x \rVert \arg x
%\lVert、\rVert 与 \Vert 和 \| 没什么太大区别。
\quad \Pr x \quad \hom x \quad \lVert x \rVert \quad \arg x

1.6 微积分及导数

1.6.1 微分

%分数\frac在1.14
\mathrm{d}t \cfrac{\mathrm{d} y}{\mathrm{d} x}
\partial t \cfrac{\partial y}{\partial x} \nabla\psi 
\quad \mathrm{d}t \quad \cfrac{\mathrm{d} y}{\mathrm{d} x} \\ \quad \partial t \quad \cfrac{\partial y}{\partial x} \quad \nabla\psi
\cfrac{\partial^2}{\partial x_1\partial x_2}y
\quad \cfrac{\partial^2}{\partial x_1\partial x_2}y

1.6.2 积分

1.6.2.1 常规
\int \iint \iiint \oint \\
\int_{a}^{b} \iint_{a}^{b} \iiint_{a}^{b} \oint_{C} \\
\int\limits_{a}^{b} \iint\limits_{a}^{b} \iiint\limits_{a}^{b}
\quad \int \quad \iint \quad \iiint \quad \oint \\ \quad \int_{a}^{b} \quad \iint_{a}^{b} \quad \iiint_{a}^{b} \quad \oint_{C} \\ \quad \int\limits_{a}^{b} \quad \iint\limits_{a}^{b} \quad \iiint\limits_{a}^{b}
1.6.2.?
\int_{\int_{\int}^{\int_{\int_{\int}^{\int_{\int_{\int}^{\int} }^{\int_{\int}^{\int}}} }^{\int_{\int}^{\int}}} }^{\int_{\int}^{\int_{\int_{\int}^{\int_{\int_{\int}^{\int} }^{\int_{\int}^{\int}}} }^{\int_{\int}^{\int}}}}
\quad \int_{\int_{\int}^{\int_{\int_{\int}^{\int_{\int_{\int}^{\int} }^{\int_{\int}^{\int}}} }^{\int_{\int}^{\int}}} }^{\int_{\int}^{\int_{\int_{\int}^{\int_{\int_{\int}^{\int} }^{\int_{\int}^{\int}}} }^{\int_{\int}^{\int}}}}

1.6.3 导数

\prime \backprime f^\prime f' f'' f^{(3)} \dot{y} \ddot{y}
\quad \prime \quad \backprime \quad f^\prime \quad f' \quad f'' \quad f^{(3)} \quad \dot{y} \quad \ddot{y}

1.7 模算

a \equiv 1 \pmod{m}
\quad a \equiv 1 \pmod{m}
\quad a \bmod b
\quad a \bmod b
\gcd(m,n) \operatorname{lcm}(m,n)
\quad \gcd(m,n) \quad \operatorname{lcm}(m,n)
\mid \nmid \shortmid \nshortmid
%\mid 可以用 \mathrel{|} 代替。
\quad \mid \quad \nmid \quad \shortmid \quad \nshortmid

1.8 集合

\{ \} \cap \cup
\quad \{ \quad \} \quad \cap \quad \cup
\quad A = \{ 1,2,3,4,5 \}; \\
\quad B = \{ 3,4,5,6,8 \}; \\
\quad A \cap B = \{ 3,4,5 \}; \\
\quad A \cup B = \{ 1,2,3,4,5,6,8 \}; \\
\quad \therefore | A \cup B | = | A | + | B | - | A \cap B |
\quad A = \{ 1,2,3,4,5 \}; \\ \quad B = \{ 3,4,5,6,8 \}; \\ \quad A \cap B = \{ 3,4,5 \}; \\ \quad A \cup B = \{ 1,2,3,4,5,6,8 \}; \\ \quad \therefore | A \cup B | = | A | + | B | - | A \cap B |
A = \{ 1,2,3,4,5 \}; \\
B = \{ 3,4,5,6,8 \}; \\
C = \{ 4,5,6,8,9 \}; \\
A \cap B = \{ 3,4,5 \}; \\
A \cup B = \{ 1,2,3,4,5,6,8 \}; \\
B \cap C = \{ 4,5,6,8 \}; \\
B \cup C = \{ 3,4,5,6,8,9 \}; \\
A \cap C = \{ 4,5 \}; \\
A \cup C = \{ 1,2,3,4,5,6,8,9 \}; \\
A \cap B \cap C = \{ 4,5 \}; \\
A \cup B \cup C = \{ 1,2,3,4,5,6,8,9 \}; \\
\therefore | A \cup B \cup C | = | A | + | B | + | C | - | A \cap B | - | B \cap C | - | A \cap C | + | A \cap B \cap C |
\quad A = \{ 1,2,3,4,5 \}; \\ \quad B = \{ 3,4,5,6,8 \}; \\ \quad C = \{ 4,5,6,8,9 \}; \\ \quad A \cap B = \{ 3,4,5 \}; \\ \quad A \cup B = \{ 1,2,3,4,5,6,8 \}; \\ \quad B \cap C = \{ 4,5,6,8 \}; \\ \quad B \cup C = \{ 3,4,5,6,8,9 \}; \\ \quad A \cap C = \{ 4,5 \}; \\ \quad A \cup C = \{ 1,2,3,4,5,6,8,9 \}; \\ \quad A \cap B \cap C = \{ 4,5 \}; \\ \quad A \cup B \cup C = \{ 1,2,3,4,5,6,8,9 \}; \\ \quad \therefore | A \cup B \cup C | = | A | + | B | + | C | - | A \cap B | - | B \cap C | - | A \cap C | + | A \cap B \cap C |

1.9 环境

1.9.1 连等:eqnarray (or aligned)

1.9.1.1 eqnarray示范 \to 推
\begin{eqnarray}
    解:原式
     & = &
    2 + (-3) - 7 + 55 - 40
    \\ & = &
    2 + (-3) + (-1) + 55 + (-40)
    \\ & = &
    \left( 2 + 55 \right) - \left( 3 + 1 + 40 \right)
    \\ & = &
    57 - 44
    \\ & = &
    13
\end{eqnarray}
%luogu不支持eqnarray
%去在线编辑器

1.9.1.2 aligned示范
\begin{aligned}
    e^{i\pi}
     & = &
    \cos(\pi)+i\sin(\pi)
    \\ & = &
    \sum \limits_{n = 0}^{\infty}\cfrac{(i\pi)^n}{n!}
    \\ & = &
    \cfrac{e^{i\pi}+e^{-i\pi}}{2}+\cfrac{e^{i\pi}-e^{-i\pi}}{2i}
    \\ & = &
    \sum \limits_{2n = 0}^{\infty}\cfrac{(i\pi)^{\cfrac{n}{2}}}{\Gamma{(\cfrac{n}{2}+1)}}
    \\ & = &
    -1
\end{aligned}
\quad \begin{aligned} e^{i\pi} & = & \cos(\pi)+i\sin(\pi) \\ & = & \sum \limits_{n = 0}^{\infty}\cfrac{(i\pi)^n}{n!} \\ & = & \cfrac{e^{i\pi}+e^{-i\pi}}{2}+\cfrac{e^{i\pi}-e^{-i\pi}}{2i} \\ & = & \sum \limits_{2n = 0}^{\infty}\cfrac{(i\pi)^{\cfrac{n}{2}}}{\Gamma{(\cfrac{n}{2}+1)}} \\ & = & -1 \end{aligned}

1.9.2 方程组:matrix (or cases)

1.9.2.1 matrix示范
\left\{
\begin{matrix} 
    \cfrac{2a^2}{a^2+1}=b \\  
    \cfrac{2b^2}{b^2+1}=c \\  
    \cfrac{2c^2}{c^2+1}=a \\  
\end{matrix}
\right. 
\quad \left\{ \begin{matrix} \cfrac{2a^2}{a^2+1}=b \\ \cfrac{2b^2}{b^2+1}=c \\ \cfrac{2c^2}{c^2+1}=a \\ \end{matrix} \right.
1.9.2.2 cases示范 \to 推
\begin{cases} 
    x=a + r\text{cos}\theta \\  
    y=b + r\text{sin}\theta 
\end{cases}
\quad \begin{cases} x=a + r\text{cos}\theta \\ y=b + r\text{sin}\theta \end{cases}
1.9.2.3 好像用不了cases
%也可以这么用:
\left.
\begin{matrix}
    \because because1 \\
    \because because2 \\
\end{matrix}
\right\}
\therefore JieLun
\left. \quad \begin{matrix} \because because1 \\ \because because2 \\ \end{matrix} \right\} \therefore JieLun
1.9.2.4 随你用啥
在\Delta ABC与\Delta DEF中: \\ 
\begin{cases}
    AB = DE \\
    \angle BAC = \angle EAF \\
    AC = DF
\end{cases} \\
\therefore \Delta ABC \cong \Delta DEF \left( SAS \right)
%或者:
在\Delta ABC与\Delta DEF中: \\ 
\left\{
\begin{matrix}
    AB = DE \\
    \angle BAC = \angle EAF \\
    AC = DF
\end{matrix}
\right. \\
\therefore \Delta ABC \cong \Delta DEF \left( SAS \right)
\quad 在\Delta ABC与\Delta DEF中: \\ \quad \begin{cases} AB = DE \\ \angle BAC = \angle EAF \\ AC = DF \end{cases}\\ \quad \therefore \Delta ABC \cong \Delta DEF \left( SAS \right) \\ \text{} \\ \quad \begin{array}{|r|l|} \uparrow\texttt{cases} & 更居中 \\ 更靠左 & \downarrow\texttt{matrix} \end{array} \\ \text{} \\ \quad 在\Delta ABC与\Delta DEF中: \\ \quad \left\{ \begin{matrix} AB = DE \\ \angle BAC = \angle EAF \\ AC = DF \end{matrix} \right. \\ \quad \therefore \Delta ABC \cong \Delta DEF \left( SAS \right)
%上公式源代码:
\quad 在\Delta ABC与\Delta DEF中: \\ 
\quad
\begin{cases}
    AB = DE \\
    \angle BAC = \angle EAF \\
    AC = DF
\end{cases}\\
\quad \therefore \Delta ABC \cong \Delta DEF \left( SAS \right)
\\ \text{} \\
\quad \begin{array}{|r|l|}
    %array环境下面就讲
    \uparrow\texttt{cases} & 更居中 \\
    更靠左 & \downarrow\texttt{matrix}
\end{array}
\\ \text{} \\
\quad 在\Delta ABC与\Delta DEF中: \\ 
\quad \left\{
\begin{matrix}
    AB = DE \\
    \angle BAC = \angle EAF \\
    AC = DF
\end{matrix}
\right. \\
\quad \therefore \Delta ABC \cong \Delta DEF \left( SAS \right)

1.9.3 矩阵:matrix及其子环境

1.9.3.1 种类
\begin{matrix}
    1.1 & 1.2 & 1.3 & 1.4 \\
    2.1 & 2.2 & 2.3 & 2.4 \\ 
    3.1 & 3.2 & 3.3 & 3.4
\end{matrix}
\quad \begin{matrix} 1.1 & 1.2 & 1.3 & 1.4 \\ 2.1 & 2.2 & 2.3 & 2.4 \\ 3.1 & 3.2 & 3.3 & 3.4 \end{matrix}
\begin{bmatrix}
    1.1 & 1.2 & 1.3 & 1.4 \\
    2.1 & 2.2 & 2.3 & 2.4 \\ 
    3.1 & 3.2 & 3.3 & 3.4
\end{bmatrix}
\quad \begin{bmatrix} 1.1 & 1.2 & 1.3 & 1.4 \\ 2.1 & 2.2 & 2.3 & 2.4 \\ 3.1 & 3.2 & 3.3 & 3.4 \end{bmatrix}
\begin{pmatrix}
    1.1 & 1.2 & 1.3 & 1.4 \\
    2.1 & 2.2 & 2.3 & 2.4 \\ 
    3.1 & 3.2 & 3.3 & 3.4
\end{pmatrix}
\quad \begin{pmatrix} 1.1 & 1.2 & 1.3 & 1.4 \\ 2.1 & 2.2 & 2.3 & 2.4 \\ 3.1 & 3.2 & 3.3 & 3.4 \end{pmatrix}
\begin{vmatrix}
    1.1 & 1.2 & 1.3 & 1.4 \\
    2.1 & 2.2 & 2.3 & 2.4 \\ 
    3.1 & 3.2 & 3.3 & 3.4
\end{vmatrix}
\quad \begin{vmatrix} 1.1 & 1.2 & 1.3 & 1.4 \\ 2.1 & 2.2 & 2.3 & 2.4 \\ 3.1 & 3.2 & 3.3 & 3.4 \end{vmatrix}
\begin{Bmatrix}
    1.1 & 1.2 & 1.3 & 1.4 \\
    2.1 & 2.2 & 2.3 & 2.4 \\ 
    3.1 & 3.2 & 3.3 & 3.4
\end{Bmatrix}
\quad \begin{Bmatrix} 1.1 & 1.2 & 1.3 & 1.4 \\ 2.1 & 2.2 & 2.3 & 2.4 \\ 3.1 & 3.2 & 3.3 & 3.4 \end{Bmatrix}
\begin{Vmatrix}
    1.1 & 1.2 & 1.3 & 1.4 \\
    2.1 & 2.2 & 2.3 & 2.4 \\ 
    3.1 & 3.2 & 3.3 & 3.4
\end{Vmatrix}
\quad \begin{Vmatrix} 1.1 & 1.2 & 1.3 & 1.4 \\ 2.1 & 2.2 & 2.3 & 2.4 \\ 3.1 & 3.2 & 3.3 & 3.4 \end{Vmatrix}
1.9.3.2 示范
\begin{bmatrix}
    a_{1,\,1} & a_{1,\,2} & a_{1,\,3} & \cdots & a_{1,\,j} \\
    a_{2,\,1} & a_{2,\,2} & a_{2,\,3} & \cdots & a_{2,\,j} \\ 
    a_{3,\,1} & a_{3,\,2} & a_{3,\,3} & \cdots & a_{3,\,j} \\
    \vdots    & \vdots    & \vdots    & \ddots & \vdots    \\
    a_{i,\,1} & a_{i,\,2} & a_{i,\,3} & \cdots & a_{i,\,j}
\end{bmatrix}
\quad \begin{bmatrix} a_{1,\,1} & a_{1,\,2} & a_{1,\,3} & \cdots & a_{1,\,j} \\ a_{2,\,1} & a_{2,\,2} & a_{2,\,3} & \cdots & a_{2,\,j} \\ a_{3,\,1} & a_{3,\,2} & a_{3,\,3} & \cdots & a_{3,\,j} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ a_{i,\,1} & a_{i,\,2} & a_{i,\,3} & \cdots & a_{i,\,j} \end{bmatrix}
1.9.3.3 运用
A=\begin{bmatrix}
    1  & 2   & 3  & 4  & 5   \\
    -1 & 46  & 32 & 2  & 34  \\
    26 & 0   & 4  & 33 & -76 \\
    47 & -46 & -7 & 79 & 8
\end{bmatrix}
\quad A=\begin{bmatrix} 1 & 2 & 3 & 4 & 5 \\ -1 & 46 & 32 & 2 & 34 \\ 26 & 0 & 4 & 33 & -76 \\ 47 & -46 & -7 & 79 & 8 \end{bmatrix}
A^T=\begin{bmatrix}
    1  & 2   & 3  & 4  & 5   \\
    -1 & 46  & 32 & 2  & 34  \\
    26 & 0   & 4  & 33 & -76 \\
    47 & -46 & -7 & 79 & 8
\end{bmatrix}^T=\begin{bmatrix}
    1 & -1 & 26  & 47  \\
    2 & 46 & 0   & -46 \\
    3 & 32 & 4   & -7  \\
    4 & 2  & 33  & 79  \\
    5 & 34 & -76 & 8
\end{bmatrix}
\quad A^T=\begin{bmatrix} 1 & 2 & 3 & 4 & 5 \\ -1 & 46 & 32 & 2 & 34 \\ 26 & 0 & 4 & 33 & -76 \\ 47 & -46 & -7 & 79 & 8 \end{bmatrix}^T=\begin{bmatrix} 1 & -1 & 26 & 47 \\ 2 & 46 & 0 & -46 \\ 3 & 32 & 4 & -7 \\ 4 & 2 & 33 & 79 \\ 5 & 34 & -76 & 8 \end{bmatrix}
A+B=\begin{bmatrix}
    a_{11} & a_{12} & \cdots & a_{1m} \\
    a_{21} & a_{22} & \cdots & a_{2m} \\
    \vdots & \vdots & \ddots & \vdots \\
    a_{n1} & a_{n2} & \cdots & a_{nm} \\
\end{bmatrix}+\begin{bmatrix}
    b_{11} & b_{12} & \cdots & b_{1m} \\
    b_{11} & b_{22} & \cdots & b_{2m} \\
    \vdots & \vdots & \ddots & \vdots \\
    b_{n1} & b_{n2} & \cdots & b_{nm} \\
\end{bmatrix}
\\
A+B=\begin{bmatrix}
    a_{11}+b_{11} & a_{12}+b_{12} & \cdots & a_{1m}+b_{1m} \\
    a_{21}+b_{21} & a_{22}+b_{22} & \cdots & a_{2m}+b_{2m} \\
    \vdots        & \vdots        & \ddots & \vdots        \\
    a_{n1}+b_{n1} & a_{n2}+b_{n2} & \cdots & a_{nm}+b_{nm} \\
\end{bmatrix}
\quad A+B=\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1m} \\ a_{21} & a_{22} & \cdots & a_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nm} \\ \end{bmatrix}+\begin{bmatrix} b_{11} & b_{12} & \cdots & b_{1m} \\ b_{11} & b_{22} & \cdots & b_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ b_{n1} & b_{n2} & \cdots & b_{nm} \\ \end{bmatrix} \\ \quad A+B=\begin{bmatrix} a_{11}+b_{11} & a_{12}+b_{12} & \cdots & a_{1m}+b_{1m} \\ a_{21}+b_{21} & a_{22}+b_{22} & \cdots & a_{2m}+b_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1}+b_{n1} & a_{n2}+b_{n2} & \cdots & a_{nm}+b_{nm} \\ \end{bmatrix}
\because O=\begin{bmatrix}
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
\end{bmatrix}
\\
\therefore O^T=\begin{bmatrix}
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
\end{bmatrix}^T=
\begin{bmatrix}
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 \\
\end{bmatrix}
\quad \because O=\begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix} \\ \quad \therefore O^T=\begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix}^T= \begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix}
\lambda A=A \lambda =\begin{bmatrix}
    \lambda a_{11} & \lambda a_{12} & \cdots & \lambda a_{1m} \\
    \lambda a_{21} & \lambda a_{22} & \cdots & \lambda a_{2m} \\
    \vdots         & \vdots         & \ddots & \vdots         \\
    \lambda a_{n1} & \lambda a_{n2} & \cdots & \lambda a_{nm} \\
\end{bmatrix}
\quad \lambda A=A \lambda =\begin{bmatrix} \lambda a_{11} & \lambda a_{12} & \cdots & \lambda a_{1m} \\ \lambda a_{21} & \lambda a_{22} & \cdots & \lambda a_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ \lambda a_{n1} & \lambda a_{n2} & \cdots & \lambda a_{nm} \\ \end{bmatrix}

1.9.4 表格:array

先看一段示例

\begin{array}{c}
    3 & 3 & 3 \\
    5 & 6 & 7
\end{array}
\quad \begin{array}{c} 3 & 3 & 3 \\ 5 & 6 & 7 \end{array}

明明是与矩阵同样的用法,同样的&,同样的\\,为啥要加一个{c}呢?

\\

这就是表格高级的地方!!! 对齐功能!!!

char mode
c(center) 居中对齐
r(right) 向右对齐
l(left) 向左对齐
[1] 竖分割线
\hline(not in luogu,dddd) 横分割线
```latex \begin{array}{|l|c|r|} left & center & right \\ lefttt & centerrr & righttt \\ lefttttt & centerrrrr & righttttt \end{array} \\ \begin{array}{||l c r||} left & center & right \\ lefttt & centerrr & righttt \\ lefttttt & centerrrrr & righttttt \end{array} ```

\quad \begin{array}{|l|c|r|} left & center & right \ lefttt & centerrr & righttt \ lefttttt & centerrrrr & righttttt \end{array} \ \quad \begin{array}{||l c r||} left & center & right \ lefttt & centerrr & righttt \ lefttttt & centerrrrr & righttttt \end{array}

你还觉得你手里的`vmatrix & Vmatrix`香吗(6 $\\

别急,还有更离谱的!!

\left[
\begin{array}{c}
    3 & 5 & 7 \\
    8 & 6 & 4
\end{array}
\right]
\quad \left[ \begin{array}{c} 3 & 5 & 7 \\ 8 & 6 & 4 \end{array} \right]

废了,整个matrix都不香了!!

\\

PS: 本篇文章大体都是在摸索array之前写的,因此依然有很多matrix

再来单独讲讲\hline(全部转移在线编辑器,懂?演示部分为截屏)

%废话少说,上代码
\begin{array}{c}
    3 & 5 & 7 \\
    \hline
    8 & 6 & 4
\end{array}

\begin{array}{|c|c|}
    \hline
    3 & 5 & 7 \\
    \hline
    8 & 6 & 4 \\
    \hline
\end{array}

这才是真的表格啊(6

那么我们可不可以用它实现画数据结构?

\\

理论存在,实践 开始

\begin{array}{|c|}
    \\ \hline
    \\ \hline
    \\ \hline
    \\ \hline
    \text{var5} \\
    \hline
    \text{var4} \\
    \hline
    \text{var3} \\
    \hline
    \text{var2} \\
    \hline
    \text{var1} \\
    \hline
\end{array}

有那味儿了!

\begin{array}{c|c}
    %这个 c|c 是压缩表格状态,相当于 c|c|c|c|c|...|c|c
    \hline
    \text{var1} & \text{var2} & \text{var3} & \text{var4} & \text{var5} & & & & \\
    \hline
\end{array}

这横竖线的层次。。。总感觉它知道我画的是哪个数据结构啊(寒噤)

1.9.5 环境嵌套

\begin{aligned}
    A+B & = & \begin{bmatrix}
        a_{11} & a_{12} & \cdots & a_{1m} \\
        a_{21} & a_{22} & \cdots & a_{2m} \\
        \vdots & \vdots & \ddots & \vdots \\
        a_{n1} & a_{n2} & \cdots & a_{nm} \\
    \end{bmatrix}+\begin{bmatrix}
        b_{11} & b_{12} & \cdots & b_{1m} \\
        b_{11} & b_{22} & \cdots & b_{2m} \\
        \vdots & \vdots & \ddots & \vdots \\
        b_{n1} & b_{n2} & \cdots & b_{nm} \\
    \end{bmatrix} \\ & = & \begin{bmatrix}
        a_{11}+b_{11} & a_{12}+b_{12} & \cdots & a_{1m}+b_{1m} \\
        a_{21}+b_{21} & a_{22}+b_{22} & \cdots & a_{2m}+b_{2m} \\
        \vdots        & \vdots        & \ddots & \vdots        \\
        a_{n1}+b_{n1} & a_{n2}+b_{n2} & \cdots & a_{nm}+b_{nm} \\
    \end{bmatrix}
\end{aligned}
\quad \begin{aligned} A+B & = & \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1m} \\ a_{21} & a_{22} & \cdots & a_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nm} \\ \end{bmatrix}+\begin{bmatrix} b_{11} & b_{12} & \cdots & b_{1m} \\ b_{11} & b_{22} & \cdots & b_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ b_{n1} & b_{n2} & \cdots & b_{nm} \\ \end{bmatrix} \\ & = & \begin{bmatrix} a_{11}+b_{11} & a_{12}+b_{12} & \cdots & a_{1m}+b_{1m} \\ a_{21}+b_{21} & a_{22}+b_{22} & \cdots & a_{2m}+b_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1}+b_{n1} & a_{n2}+b_{n2} & \cdots & a_{nm}+b_{nm} \\ \end{bmatrix} \end{aligned}
%就是这个东西,一元二次方程!!!
ax^2+bx+c=0\ (a\neq0) \\
\Delta=b^2-4ac \\
\begin{cases} 
    \Delta\geq 0\Leftrightarrow方程有两个实根,
    \begin{cases} 
        \Delta>0\Leftrightarrow方程有两个不等实根\ , \ x_{1,2}=\dfrac{-b \pm \sqrt{\Delta}}{2a} \\
        \Delta=0 \Leftrightarrow方程有两个相等实根\ ,\ x_1=x_2=\dfrac{-b}{2a} \\
    \end{cases} \\
    \Delta<0 \Leftrightarrow方程无实根\ ,\ x_{1,2}=\dfrac{-b \pm \sqrt{-\Delta}i}{2a} \\
\end{cases}
\quad ax^2+bx+c=0\ (a\neq0) \\ \quad \Delta=b^2-4ac \\ \quad \begin{cases} \Delta\geq 0\Leftrightarrow方程有两个实根, \begin{cases} \Delta>0\Leftrightarrow方程有两个不等实根\ , \ x_{1,2}=\dfrac{-b \pm \sqrt{\Delta}}{2a} \\ \Delta=0 \Leftrightarrow方程有两个相等实根\ ,\ x_1=x_2=\dfrac{-b}{2a} \\ \end{cases} \\ \Delta<0 \Leftrightarrow方程无实根\ ,\ x_{1,2}=\dfrac{-b \pm \sqrt{-\Delta}i}{2a} \\ \end{cases}

1.10 符号

1.10.1 箭头

语法 符号
\leftarrow \leftarrow
\rightarrow \rightarrow
\longleftarrow \longleftarrow
\longrightarrow \longrightarrow
\leftrightarrow \leftrightarrow
\longleftrightarrow \longleftrightarrow
\Leftarrow \Leftarrow
\Rightarrow \Rightarrow
\Longleftarrow \Longleftarrow
\Longrightarrow \Longrightarrow
\Leftrightarrow \Leftrightarrow
\Longleftrightarrow \Longleftrightarrow
\rightleftharpoons \rightleftharpoons
\mapsto \mapsto
\longmapsto \longmapsto
\hookleftarrow \hookleftarrow
\hookrightarrow \hookrightarrow
\leftharpoonup \leftharpoonup
\rightharpoonup \rightharpoonup
\leftharpoondown \leftharpoondown
\rightharpoondown \rightharpoondown
\uparrow \uparrow
\downarrow \downarrow
\updownarrow \updownarrow
\Uparrow \Uparrow
\Downarrow \Downarrow
\Updownarrow \Updownarrow
\nearrow \nearrow
\searrow \searrow
\swarrow \swarrow
\nwarrow \nwarrow
\dashleftarrow \dashleftarrow
\dashrightarrow \dashrightarrow
\leftleftarrows \leftleftarrows
\rightrightarrows \rightrightarrows
\leftrightarrows \leftrightarrows
\rightleftarrows \rightleftarrows
\Lleftarrow \Lleftarrow
\Rrightarrow \Rrightarrow
\twoheadleftarrow \twoheadleftarrow
\twoheadrightarrow \twoheadrightarrow
\leftarrowtail \leftarrowtail
\rightarrowtail \rightarrowtail
\leftrightharpoons \leftrightharpoons
\rightleftharpoons \rightleftharpoons
\Lsh \Lsh
\Rsh \Rsh
\looparrowleft \looparrowleft
\looparrowright \looparrowright
\curvearrowleft \curvearrowleft
\curvearrowright \curvearrowright
\circlearrowleft \circlearrowleft
\circlearrowright \circlearrowright
\multimap \multimap
\upuparrows \upuparrows
\downdownarrows \downdownarrows
\upharpoonleft \upharpoonleft
\upharpoonright \upharpoonright
\downharpoonleft \downharpoonleft
\downharpoonright \downharpoonright
\rightsquigarrow \rightsquigarrow

1.10.2 关系符

语法 符号
< <
> >
= =
\ne \ne
\le \le
\ge \ge
\leqslant \leqslant
\geqslant \geqslant
\leqq \leqq
\geqq \geqq
\approx \approx
\not\approx \not\approx
\sim \sim
\simeq \simeq
\cong \cong
\equiv \equiv
\not\equiv \not\equiv
\ll \ll
\gg \gg
\lll \lll
\ggg \ggg
\propto \propto
\varpropto \varpropto
\triangleq \triangleq
\forall \forall
\exists \exists
\nexists \nexists
\emptyset \emptyset
\varnothing \varnothing
\in \in
\ni \ni
\notin \notin
\not\ni \not\ni
\setminus \setminus
\smallsetminus \smallsetminus
\subset \subset
\subseteq \subseteq
\supset \supset
\supseteq \supseteq
\cup \cup
\cap \cap
\land \land
\vee \vee
\neg \neg
\prec \prec
\succ \succ
\preceq \preceq
\succeq \succeq
\perp \perp
\mid \mid
\parallel \parallel
\dashv \dashv
\vdash \vdash
\models \models
\asymp \asymp
\doteq \doteq
\Doteq \Doteq
\doteqdot \doteqdot
\circeq \circeq
\fallingdotseq \fallingdotseq
\risingdotseq \risingdotseq
\bowtie \bowtie
\ltimes \ltimes
\rtimes \rtimes
\smile \smile
\smallsmile \smallsmile
\frown \frown
\smallfrown \smallfrown
\approxeq \approxeq
\backsim \backsim
\backsimeq \backsimeq
\bumpeq \bumpeq
\Bumpeq \Bumpeq
\because \because
\therefore \therefore
\eqcirc \eqcirc
\lesssim \lesssim
\gtrsim \gtrsim
\lessapprox \lessapprox
\gtrapprox \gtrapprox
\lessdot \lessdot
\gtrdot \gtrdot
\eqslantless \eqslantless
\eqslantgtr \eqslantgtr
\precsim \precsim
\succsim \succsim
\precapprox \precapprox
\succapprox \succapprox
\Subset \Subset
\Supset \Supset
\subseteqq \subseteqq
\supseteqq \supseteqq
\nsubseteq \nsubseteq
\nsupseteq \nsupseteq
\nsubseteqq \nsubseteqq
\nsupseteqq \nsupseteqq
\preccurlyeq \preccurlyeq
\succcurlyeq \succcurlyeq
\curlyeqprec \curlyeqprec
\curlyeqsucc \curlyeqsucc
\blacktriangleleft \blacktriangleleft
\blacktriangleright \blacktriangleright
\blacktriangle \blacktriangle
\blacktriangledown \blacktriangledown
\triangleleft \triangleleft
\triangleright \triangleright
\trianglelefteq \trianglelefteq
\trianglerighteq \trianglerighteq
\lessgtr \lessgtr
\gtrless \gtrless
\lesseqgtr \lesseqgtr
\gtreqless \gtreqless
\lesseqqgtr \lesseqqgtr
\gtreqqless \gtreqqless
\backepsilon \backepsilon
\between \between
\pitchfork \pitchfork
\shortmid \shortmid
\nshortmid \nshortmid
\Vdash \Vdash
\vDash \vDash
\Vvdash \Vvdash
\shortparallel \shortparallel
\nshortparallel \nshortparallel
\bigcap \bigcap
\bigcup \bigcup
\biguplus \biguplus
\bigtriangledown \bigtriangledown
\bigtriangleup \bigtriangleup
\bigvee \bigvee
\bigwedge \bigwedge
\sqsubset \sqsubset
\sqsubseteq \sqsubseteq
\sqsupset \sqsupset
\sqsupseteq \sqsupseteq
\sqcup \sqcup

1.10.3 运算符

语法 符号
+ +
- -
\times \times
\div \div
\pm \pm
\mp \mp
\lhd \lhd
\rhd \rhd
\cdot \cdot
\centerdot \centerdot
\setminus \setminus
\dotplus \dotplus
\divideontimes \divideontimes
\amalg \amalg

1.10.4 其他

语法 符号
\ast \ast
\bigstar \bigstar
\circ \circ
\bigcirc \bigcirc
\circledcirc \circledcirc
\bullet \bullet
\circleddash \circleddash
\ominus \ominus
\oplus \oplus
\otimes \otimes
\oslash \oslash
\circledast \circledast
\square \square
\blacksquare \blacksquare
\Box \Box
\boxplus \boxplus
\boxminus \boxminus
\boxtimes \boxtimes
\boxdot \boxdot
\barwedge \barwedge
\veebar \veebar
\curlywedge \curlywedge
\curlyvee \curlyvee
\doublebarwedge \doublebarwedge
\Cap \Cap
\Cup \Cup
\bot \bot
\top \top
\intercal \intercal
\leftthreetimes \leftthreetimes
\rightthreetimes \rightthreetimes
\LaTeX \TeX \KaTeX
%\KaTeX 在Typroa并不行,luogu终于赢了一回
%雀食没啥用,适合做LaTeX公式大全的......标题?
\quad \LaTeX \quad \TeX \quad \KaTeX
\Q \R \O \P \H \Z \C \N
%\R实数,\C复数
%luogu又不支持??
%下面有演示不是因为luogu支持,上面的等价于\mathbb而已 2025/1/26 注
\quad \mathbb{Q} \quad \mathbb{R} \quad \mathbb{O} \quad \mathbb{P} \quad \mathbb{H} \quad \mathbb{Z} \quad \mathbb{C} \quad \mathbb{N}

1.10.5 特殊字符

\# \$ \% \ & \_ \{ \} \^{} \~{}
%最后两个的{}不能删!!
%删了的效果见第一板块
\quad \# \quad \% \quad \& \quad \_ \quad \{ \quad \} \quad\: \^{} \quad\:\: \~{}

其他离谱的符号见附文2

1.11 上标、下标

1.11.1 上标

a^2
\quad a^2

1.11.2 下标

a_2
\quad a_2

1.11.3 组合

a^{2+2} a_{i,\,j}
\quad a^{2+2} \quad a_{i,\,j}

1.11.4 结合上下标

C_5^2
\quad C^2_5

1.11.5 前置上下标

{}^2_1\!X^3_4
\quad {}^2_1\!X^3_4

1.11.6 嵌套

\Large{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x}}}}}}}}}}}}}}}}}
\quad \Large{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x}}}}}}}}}}}}}}}}}
\Large{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x}}}}}}}}}}}}}}}}}
\quad \Large{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x}}}}}}}}}}}}}}}}}
\Large{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x}}}}}}}}}}}}}}}}_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x}}}}}}}}}}}}}}}}}
\quad \Large{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x}}}}}}}}}}}}}}}}_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x_{x}}}}}}}}}}}}}}}}}

1.11.?

\begin{aligned}
\Large{\sideset{_1^2}{_3^4}X_a^b}
\end{aligned}
%luogu双不支持。。。

1.12 [expecting]

Tip: 原1.12已合并至1.9.5

1.13 大运算

1.13.1 求和\sum

\Sigma\times \sum\surd
\quad \Sigma\times \quad \sum\surd
\sum\limits_{i=1}^{100}i = 1+2+3+\cdots+100 = 5050
\quad \sum\limits_{i=1}^{100}i = 1+2+3+\cdots+100 = 5050

1.13.2 连乘积\prod

\Pi\times \prod\surd
\quad \Pi\times \quad \prod\surd
\prod\limits_{i=1}^{10}i = 10! = 1\times2\times3\times\cdots\times10 = 3628800
\quad \prod\limits_{i=1}^{10}i = 10! = 1\times2\times3\times\cdots\times10 = 3628800

1.13.3 余积\coprod

\amalg\times \coprod\surd
\quad \amalg\times \quad \coprod\surd
\coprod\limits_{i\in I}A_i=\bigcup\limits_{i\in I} \left\{ \left( x,i \right) :x \in A_i \right\}
\quad \coprod\limits_{i\in I}A_i=\bigcup\limits_{i\in I} \left\{ \left( x,i \right) :x \in A_i \right\}

1.14 分数

\frac{a}{b} \cfrac{a}{b} \tfrac{a}{b} 3\cfrac{1}{4}
% cfrac > frac > tfrac
\quad \frac{a}{b} \quad \cfrac{a}{b} \quad \tfrac{a}{b} \quad 3 \cfrac{1}{4}
x = a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{a_4}}}}
\quad x = a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{a_4}}}}

1.15 [expecting]

Tip: 原1.15已合并至1.9

1.16 字体

1.16.1 希腊字母

\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta
\Iota\Kappa\Lambda\Mu\Nu\Xi\Omicron\Pi
\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega
%像字母的在线编辑器不支持,如\Alpha
%因为外观上,
\Alpha = \mathrm{A}
%且像英文字母的大写希腊字母调不了字体,都一样的
\mathtt{\Alpha} = \Alpha
%不像英文字母的可以调字体
\mathtt{\Phi} \neq \Phi
\quad \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \\ \quad \Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi \\ \quad \Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega \\ \quad \Alpha = \mathrm{A} \\ \quad \mathtt{\Alpha} = \Alpha \\ \quad \mathtt{\Phi} \neq \Phi
\alpha\beta\gamma\delta\epsilon\zeta\eta\theta
\iota\kappa\lambda\mu\nu\xi\omicron\pi
\rho\sigma\tau\upsilon\phi\chi\psi\omega
\quad \alpha \beta \gamma \delta \epsilon \zeta \eta \theta \\ \quad \iota \kappa \lambda \mu \nu \xi \omicron \pi \\ \quad \rho \sigma \tau \upsilon \phi \chi \psi \omega
\varepsilon\digamma\varkappa\varpi\varrho\varsigma\vartheta\varphi
\quad \varepsilon \digamma \varkappa \varpi \varrho \varsigma \vartheta \varphi

1.16.2 希伯来符号

\aleph\beth\gimel\daleth
\quad \aleph \beth \gimel \daleth

1.16.3 黑板粗体

\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
%\LaTeX 也可以!!!(下边也一样)(2024/11/17注)
\quad \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathbb{abcdefghijklmnopqrstuvwxyz} \\ \quad \mathbb{0123456789} \\ \quad \mathbb{\LaTeX \quad \TeX \quad \KaTeX}

1.16.4 粗体

\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
%mathbf = textbf
%尽量用\mathbf,有些只能用\math系列不能用\text系列(如\LaTeX)(2024/11/17注)
\quad \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathbf{abcdefghijklmnopqrstuvwxyz} \\ \quad \mathbf{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega} \\ \quad \mathbf{0123456789} \\ \quad \mathbf{\LaTeX \quad \TeX \quad \KaTeX}

1.16.5 斜体(英文字母和小写希腊字母默认)

\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
%mathit = textit
\quad \mathit{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega} \\ \quad \mathit{0123456789} \\ \quad \mathit{\LaTeX \quad \TeX \quad \KaTeX}

1.16.6 罗马体(像英文字母的大写希腊字母\color{red}{\texttt{固定}},其他大写字母默认)

\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
%mathrm = textrm
\quad \mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathrm{abcdefghijklmnopqrstuvwxyz} \\ \quad \mathrm{0123456789} \\ \quad \mathrm{\LaTeX \quad \TeX \quad \KaTeX}

1.16.7 打字机字体

\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
%mathtt = texttt
\quad \mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathtt{abcdefghijklmnopqrstuvwxyz} \\ \quad \mathtt{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega} \\ \quad \mathtt{0123456789} \\ \quad \mathtt{\LaTeX \quad \TeX \quad \KaTeX}

1.16.8 无衬线体

\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
%mathsf = textsf
\quad \mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathsf{abcdefghijklmnopqrstuvwxyz} \\ \quad \mathsf{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega} \\ \quad \mathsf{0123456789} \\ \quad \mathsf{\LaTeX \quad \TeX \quad \KaTeX}

1.16.9 手写体/花体

\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\quad \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathcal{0123456789} \\ \quad \mathcal{\LaTeX \quad \TeX \quad \KaTeX}

1.16.10 \text {Fraktur}体

\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\quad \mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \mathfrak{abcdefghijklmnopqrstuvwxyz} \\ \quad \mathfrak{0123456789} \\ \quad \mathfrak{\LaTeX \quad \TeX \quad \KaTeX}

1.16.11 小型字

\scriptstyle{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\quad \scriptstyle{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \scriptstyle{abcdefghijklmnopqrstuvwxyz} \\ \quad \scriptstyle{0123456789} \\ \quad \scriptstyle{\LaTeX \quad \TeX \quad \KaTeX}
\scriptstyle\text{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\quad \scriptstyle \text{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \scriptstyle \text{abcdefghijklmnopqrstuvwxyz} \\ \quad \scriptstyle \text{0123456789}

1.16.12 比operatorname更简单的 \text{text}字体

写题解时,不想用太长的operatorname?用text!没人看得出来

x y z 中文
%忽略公式源码中的空格,要强制空格的看下面空格一栏。
\text{x y z} \text{中文}
%不会忽略空格,支持大小写英文字母和数字。
%中文没多大作用
\quad x y z 中文 \\ \quad \text{x y z} \quad \text{中文}
\text{if }n\text{ is even}
%注意在\text中使用空格来显得更好看,或者可以用强制空格代替。
\quad \text{if } n \text{ is even}
\text{operatorname}
\operatorname{operatorname}
%表面几乎没有任何区别!!!
\quad \text{operatorname} \\ \quad \operatorname{operatorname}

1.16.13 下划线字

\underline{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\quad \underline{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \underline{abcdefghijklmnopqrstuvwxyz} \\ \quad \underline{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta} \\ \quad \underline{\Iota\Kappa\Lambda\Mu\Nu\Xi\Omicron\Pi} \\ \quad \underline{\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\ \quad \underline{0123456789}
\underline{\texttt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}}
%可以与任何字体混用
\quad \underline{\texttt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} \\ \quad \underline{\texttt{abcdefghijklmnopqrstuvwxyz}} \\ \quad \underline{\texttt{0123456789}}
\underline{\underline{ok}}
\underline{\underline{\underline{\underline{\underline{\underline{\underline{6}}}}}}} 
\quad \underline{\underline{ok}} \\ \quad \underline{\underline{\underline{\underline{\underline{\underline{\underline{6}}}}}}}

1.16.14 上划线字

\overline{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\quad \overline{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \quad \overline{abcdefghijklmnopqrstuvwxyz} \\ \quad \overline{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta} \\ \quad \overline{\Iota\Kappa\Lambda\Mu\Nu\Xi\Omicron\Pi} \\ \quad \overline{\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\ \quad \overline{0123456789}
\overline{\texttt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}}
%同样可以与任何字体混用
\quad \overline{\texttt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} \\ \quad \overline{\texttt{abcdefghijklmnopqrstuvwxyz}} \\ \quad \overline{\texttt{0123456789}}
\overline{\overline{ok}}
\overline{\overline{\overline{\overline{\overline{\overline{\overline{6}}}}}}} 
\quad \overline{\overline{ok}} \\ \quad \overline{\overline{\overline{\overline{\overline{\overline{\overline{6}}}}}}}
%当然可以
\overline{\underline{dd}}
\overline{\overline{\underline{\underline{ok}}}}
\overline{\overline{\overline{\overline{\overline{\overline{\overline{\underline{\underline{\underline{\underline{\underline{\underline{\underline{6}}}}}}}}}}}}}}
%\overline放前面观感好一点
\quad \overline{\underline{dd}}\\\text{}\\\quad\overline{\overline{\underline{\underline{ok}}}} \\ \text{} \\ \quad\overline{\overline{\overline{\overline{\overline{\overline{\overline{\underline{\underline{\underline{\underline{\underline{\underline{\underline{6}}}}}}}}}}}}}}

1.17 拼接

\ce{->} \ce{<-} \ce{<->} \ce{<=>} \ce{<-->} \ce{^} \ce{v}
%v在\ce单独出现时等价于\downarrow,是个例外 2025/1/28注

\ce{<<} \ce{>>}

\begin{array}{|c|c|}
    \hline
    \ce{*} & * \\
    \hline
    \ce{#} & \# \\
    \hline
    \ce{.} & . \\
    \hline
\end{array}

\ce{text}
%改字体
\ce{operatorname}\;\;\;
\text{operatorname}\:\:
\operatorname{operatorname}
%表面几乎没有任何区别!!!!!!

1.18 括号

1.18.1 普通括号

(\dfrac{1}{2}) (\dfrac{1}{x+\dfrac{2}{3}})
%对于较大的式子显得比较难看。
\quad (\dfrac{1}{2}) \qquad (\dfrac{1}{x+\dfrac{2}{3}})

1.18.2 根据式子大小匹配的括号

\left( \dfrac{1}{2} \right) \left( \dfrac{1}{x+\dfrac{2}{3}} \right)
%此功能(使用`\left`和`\right`)可以推广到不同的括号:
\quad \left( \dfrac{1}{2} \right) \qquad \left( \dfrac{1}{x+\dfrac{2}{3}} \right)

1.18.3 圆括号/小括号

\left( \dfrac{1}{2} \right)
\quad \left( \dfrac{1}{2} \right)

1.18.4 方括号/中括号

\left[ \dfrac{1}{2} \right]
\quad \left[ \dfrac{1}{2} \right]

1.18.5 花括号/大括号

\left\{ \dfrac{1}{2} \right\}
%注意大括号要用\{和\}。
\quad \left\{ \dfrac{1}{2} \right\}

1.18.6 角括号

\left\langle \dfrac{1}{2} \right\rangle
% \langle可以用<,\rangle可以用>。
\left< \dfrac{1}{2} \right>
\quad \left\langle \dfrac{1}{2} \right\rangle \left< \dfrac{1}{2} \right>

1.18.7 单竖线/绝对值

%这是第2085行
\left| \dfrac{1}{2} \right|
\quad \left| \dfrac{1}{2} \right|

1.18.8 双竖线

\left\| \dfrac{1}{2} \right\|
\quad \left\| \dfrac{1}{2} \right\|

1.18.9 向下取整

\left\lfloor \dfrac{1}{2} \right\rfloor
\quad \left\lfloor \dfrac{1}{2} \right\rfloor

1.18.10 向上取整

\left\lceil \dfrac{1}{2} \right\rceil
\quad \left\lceil \dfrac{1}{2} \right\rceil

1.18.11 斜线

\left/ \dfrac{1}{2} \right/
\quad \left/ \dfrac{1}{2} \right/

1.18.12 反斜线

\left\backslash \dfrac{1}{2} \right\backslash
\quad \left\backslash \dfrac{1}{2} \right\backslash

1.18.13 类小括号

\left\lgroup \dfrac{1}{2} \right\rgroup
%应该有个专业的名字吧?有没有dalao知道(2024/11/17注)
\quad \left\lgroup \dfrac{1}{2} \right\rgroup

1.18.14 类小括号...?

\left\lmoustache \dfrac{1}{2} \right\rmoustache
\quad \left\lmoustache \dfrac{1}{2} \right\rmoustache

1.18.15 类绝对值

\left\arrowvert \dfrac{1}{2} \right\arrowvert
%luogu...

1.18.16 类双竖线

\left\Arrowvert \dfrac{1}{2} \right\Arrowvert
%luogu......

1.18.17 粗类绝对值

\left\bracevert \dfrac{1}{2} \right\bracevert
%luogu。。。。。。

1.18.18 上下箭头

\left\uparrow \dfrac{1}{2} \right\uparrow
\quad \left\uparrow \dfrac{1}{2} \right\uparrow
\left\Uparrow \dfrac{1}{2} \right\Uparrow
\quad \left\Uparrow \dfrac{1}{2} \right\Uparrow
\left\downarrow \dfrac{1}{2} \right\downarrow
\quad \left\downarrow \dfrac{1}{2} \right\downarrow
\left\Downarrow \dfrac{1}{2} \right\Downarrow
\quad \left\Downarrow \dfrac{1}{2} \right\Downarrow
\left\updownarrow \dfrac{1}{2} \right\updownarrow
\quad \left\updownarrow \dfrac{1}{2} \right\updownarrow
\left\Updownarrow \dfrac{1}{2} \right\Updownarrow
\quad \left\Updownarrow \dfrac{1}{2} \right\Updownarrow

1.18.14 混合括号

%其实上述括号都可以混合使用,这里就随便列两个了。
\left\ceil \text{Hello \LaTeX !!!}\right\floor %Wrong
%Error: \raise is only supported in math mode
%此时你可以试试将\text改成\operatorname
%叫\LaTeX的operator(6
\left\ceil \operatorname{Hello \LaTeX !!!} \right\floor
\quad \left\lceil \operatorname{Hello \LaTeX !!!} \right\rfloor
x \in \left(\dfrac{1}{2},1\right]
\quad x \in \left( \dfrac{1}{2},1 \right]

1.18.15 单左括号

%上述括号都适用,这里就随便列一个。
\left( \dfrac{1}{2} \right.
\quad \left( \dfrac{1}{2} \right.

1.18.16 单右括号

%同上。
\left. \dfrac{1}{2} \right]
\quad \left. \dfrac{1}{2} \right]

1.18.17 强制括号大小

\Bigg( \bigg[ \Big\{ \big< \texttt{TaoWa.ing} \big> \Big\} \bigg] \Bigg)
%Bigg > bigg > Big > big > [empty]
\quad \Bigg( \bigg[ \Big\{ \big< \texttt{TaoWa.ing} \big> \Big\} \bigg] \Bigg)

1.18.18 运用

x^2 \left( y-z \right) +y^2 \left( z-x \right) +z^2 \left( x-y \right) = \left( x-y \right) \left( y-z \right) \left( x-z \right) \\
x^3 \left( y-z \right) +y^3 \left( z-x \right) +z^3 \left( x-y \right) = \left( x+y+z \right) \left( x-y \right) \left( y-z \right) \left( x-z \right)
\quad x^2 \left( y-z \right) +y^2 \left( z-x \right) +z^2 \left( x-y \right) = \left( x-y \right) \left( y-z \right) \left( x-z \right) \\ \quad x^3 \left( y-z \right) +y^3 \left( z-x \right) +z^3 \left( x-y \right) = \left( x+y+z \right) \left( x-y \right) \left( y-z \right) \left( x-z \right)
a_n = \cfrac{1}{\sqrt5 \left[ \left( 1+\cfrac{\sqrt5}{2} \right) ^ n- \left( 1-\cfrac{\sqrt5}{2} \right) ^n \right] }
\quad a_n = \cfrac{1}{\sqrt5 \left[ \left( 1+\cfrac{\sqrt5}{2} \right) ^ n- \left( 1-\cfrac{\sqrt5}{2} \right) ^n \right] }

1.19 空格 & 换行

1.19.1 空格

一般\operatorname{\LaTeX}能自动处理大多数空格,但必要时候需要强制控制大小。

以\text{quad}空格为m单位长度:

1.19.1.1 紧贴
x\!y
\quad x\!y

宽度为-\cfrac{m}{6}

1.19.1.2 无空格
xy
\quad xy

宽度为0

1.19.1.3 微空格
x\,y
\quad x\,y

宽度为\cfrac{m}{6}

1.19.1.4 小空格
x\:y
\quad x\:y

宽度为\cfrac{m}{4}

1.19.1.5 中等空格
x\;y
\quad x\;y

宽度为\cfrac{2m}{7}

1.19.1.6 大空格
x\ y
\quad x\ y

宽度为\cfrac{m}{3}

1.19.1.7 \text{quad}空格
x\quad y
\quad x \quad y

宽度为m

1.19.1.8 两个\text {quad}空格
x\qquad y
\quad x \qquad y

宽度为2m

1.19.2 换行

line\ 1 \\ line\ 2
\quad line\ 1 \\ \quad line\ 2
line\ 1 \newline line\ 2
\quad line\ 1 \newline \quad line\ 2

但是特别烦人的就是\operatorname{\LaTeX}的多个换行都强制变成一个换行。其实Markdown也是

\\

那该怎么办呢?

\\

首先问你一句,皇帝的新字符串没有字的字符串,你看得见吗

\\

这叫 如换两行。

line\ 1 \\
\text{} \\
line\ 3
\quad line\ 1 \\ \text{} \\ \quad line\ 3

当然你想换n行,你就搞n-1个皇帝的新字符串没有字的字符串就好了!

line\ 1 \\
\text{} \\
\text{} \\
\text{} \\
line\ 5
\quad line\ 1 \\ \text{} \\ \text{} \\ \text{} \\ \quad line\ 5

这一招我在讲环境的时候就用了,不知道有没有人注意(当时我给了演示时候的源代码)。

1.20 颜色

1.20.1 语法

{\color{文字色调}\colorbox{背景色调}{表达式(可以打中文)}}

1.20.2 基本颜色

这颜色把我震惊到了,Aquamarine和AquaMarine在Typroa是两个颜色?!!

\begin{array}{l}
    {\color{Aqua}Aqua}\\
    {\color{Aquamarine}Aquamarine}\\ 
    {\color{AquaMarine}AquaMarine}\\ 
    {\color{Black}Black}\\ 
    {\color{Blue}Blue}\\ 
    {\color{Blueviolet}Blueviolet}\\ 
    {\color{BlueViolet}BlueViolet}\\ 
    {\color{Brown}Brown}\\ 
    {\color{Cadetblue}Cadetblue}\\ 
    {\color{CadetBlue}CadetBlue}\\ 
    {\color{CornflowerBlue}CornflowerBlue}\\ 
    {\color{CornFlowerBlue}CornFlowerBlue}\\ 
    {\color{Cyan}Cyan}\\
    {\color{DarkBlue}DarkBlue}\\
    {\color{DarkCyan}DarkCyan}\\
    {\color{DarkGray}DarkGray}\\
    {\color{DarkGreen}DarkGreen}\\
    {\color{DarkMagenta}DarkMagenta}\\
    {\color{DarkOrchid}DarkOrchid}\\
    {\color{DarkSalmon}DarkSalmon}\\
    {\color{DarkRed}DarkRed}\\
    {\color{DarkTurquoise}DarkTurquoise}\\ 
    {\color{DarkViolet}DarkViolet}\\ 
    {\color{Forestgreen}Forestgreen}\\ 
    {\color{ForestGreen}ForestGreen}\\ 
    {\color{Fuchsia}Fuchsia}\\ 
    {\color{Goldenrod}Goldenrod}\\ 
    {\color{GoldenRod}GoldenRod}\\ 
    {\color{Gold}Gold}\\ 
    {\color{Gray}Gray}\\ 
    {\color{Green}Green}\\ 
    {\color{Greenyellow}Greenyellow}\\ 
    {\color{GreenYellow}GreenYellow}\\ 
    {\color{Lavender}Lavender}\\ 
    {\color{LightBlue}LightBlue}\\
    {\color{LightCyan}LightCyan}\\
    {\color{LightGray}LightGray}\\
    {\color{LightGreen}LightGreen}\\
    {\color{LightSalmon}LightSalmon}\\
    {\color{LightYellow}LightYellow}\\
    {\color{Limegreen}Limegreen}\\ 
    {\color{LimeGreen}LimeGreen}\\ 
    {\color{Magenta}Magenta}\\ 
    {\color{Maroon}Maroon}\\ 
    {\color{Navy}Navy}\\
    {\color{Orange}Orange}\\ 
    {\color{Orangered}Orangered}\\ 
    {\color{OrangeRed}OrangeRed}\\ 
    {\color{Orchid}Orchid}\\ 
    {\color{Pink}Pink}\\
    {\color{Plum}Plum}\\ 
    {\color{Purple}Purple}\\ 
    {\color{Red}Red}\\ 
    {\color{Royalblue}Royalblue}\\ 
    {\color{RoyalBlue}RoyalBlue}\\ 
    {\color{Salmon}Salmon}\\ 
    {\color{Seagreen}Seagreen}\\ 
    {\color{SeaGreen}SeaGreen}\\ 
    {\color{Silver}Silver}\\
    {\color{Skyblue}Skyblue}\\ 
    {\color{SkyBlue}SkyBlue}\\ 
    {\color{Springgreen}Springgreen}\\ 
    {\color{SpringGreen}SpringGreen}\\ 
    {\color{Tan}Tan}\\ 
    {\color{Thistle}Thistle}\\ 
    {\color{Turquoise}Turquoise}\\ 
    {\color{Violet}Violet}\\ 
    {\color{White}White}\gets\text{这是White}\\
    {\color{Yellow}Yellow}\\ 
    {\color{Yellowgreen}Yellowgreen}\\ 
    {\color{YellowGreen}YellowGreen}\\ 
\end{array}
\quad \begin{array}{l} {\color{Aqua}Aqua}\\ {\color{Aquamarine}Aquamarine}\\ {\color{AquaMarine}AquaMarine}\\ {\color{Black}Black}\\ {\color{Blue}Blue}\\ {\color{Blueviolet}Blueviolet}\\ {\color{BlueViolet}BlueViolet}\\ {\color{Brown}Brown}\\ {\color{Cadetblue}Cadetblue}\\ {\color{CadetBlue}CadetBlue}\\ {\color{CornflowerBlue}CornflowerBlue}\\ {\color{CornFlowerBlue}CornFlowerBlue}\\ {\color{Cyan}Cyan}\\ {\color{DarkBlue}DarkBlue}\\ {\color{DarkCyan}DarkCyan}\\ {\color{DarkGray}DarkGray}\\ {\color{DarkGreen}DarkGreen}\\ {\color{DarkMagenta}DarkMagenta}\\ {\color{DarkOrchid}DarkOrchid}\\ {\color{DarkSalmon}DarkSalmon}\\ {\color{DarkRed}DarkRed}\\ {\color{DarkTurquoise}DarkTurquoise}\\ {\color{DarkViolet}DarkViolet}\\ {\color{Forestgreen}Forestgreen}\\ {\color{ForestGreen}ForestGreen}\\ {\color{Fuchsia}Fuchsia}\\ {\color{Goldenrod}Goldenrod}\\ {\color{GoldenRod}GoldenRod}\\ {\color{Gold}Gold}\\ {\color{Gray}Gray}\\ {\color{Green}Green}\\ {\color{Greenyellow}Greenyellow}\\ {\color{GreenYellow}GreenYellow}\\ {\color{Lavender}Lavender}\\ {\color{LightBlue}LightBlue}\\ {\color{LightCyan}LightCyan}\\ {\color{LightGray}LightGray}\\ {\color{LightGreen}LightGreen}\\ {\color{LightSalmon}LightSalmon}\\ {\color{LightYellow}LightYellow}\\ {\color{Limegreen}Limegreen}\\ {\color{LimeGreen}LimeGreen}\\ {\color{Magenta}Magenta}\\ {\color{Maroon}Maroon}\\ {\color{Navy}Navy}\\ {\color{Orange}Orange}\\ {\color{Orangered}Orangered}\\ {\color{OrangeRed}OrangeRed}\\ {\color{Orchid}Orchid}\\ {\color{Pink}Pink}\\ {\color{Plum}Plum}\\ {\color{Purple}Purple}\\ {\color{Red}Red}\\ {\color{Royalblue}Royalblue}\\ {\color{RoyalBlue}RoyalBlue}\\ {\color{Salmon}Salmon}\\ {\color{Seagreen}Seagreen}\\ {\color{SeaGreen}SeaGreen}\\ {\color{Silver}Silver}\\ {\color{Skyblue}Skyblue}\\ {\color{SkyBlue}SkyBlue}\\ {\color{Springgreen}Springgreen}\\ {\color{SpringGreen}SpringGreen}\\ {\color{Tan}Tan}\\ {\color{Thistle}Thistle}\\ {\color{Turquoise}Turquoise}\\ {\color{Violet}Violet}\\ {\color{White}White}\gets\text{这是White}\\ {\color{Yellow}Yellow}\\ {\color{Yellowgreen}Yellowgreen}\\ {\color{YellowGreen}YellowGreen}\\ \end{array}

1.20.3 RGB

1.20.3.0 格式
\color{#[R][G][B]}{text}
1.20.3.1 16-16-16 mode
\color{#F00}{red}
\color{#0F0}{green}
\color{#00F}{blue}
\color{#FF0}{yellow}
\color{#F0F}{fichsia}
\color{#0FF}{aqua}
\color{#000}{black}
\color{#FFF}{white}
\quad \color{#F00}{red} \\ \quad \color{#0F0}{green} \\ \quad \color{#00F}{blue} \\ \quad \color{#FF0}{yellow} \\ \quad \color{#F0F}{fuchsia} \\ \quad \color{#0FF}{aqua} \\ \quad \color{#000}{black} \\ \quad \color{#FFF}{white}
1.20.3.2 256-256-256 mode
\color{#FF0000}{red}
\color{#00FF00}{green}
\color{#0000FF}{blue}
\color{#FFFF00}{yellow}
\color{#FF00FF}{fuchsia}
\color{#00FFFF}{aqua}
\color{#000000}{black}
\color{#FFFFFF}{white}

\color{#1f1e33}{\text{\#1f1e33 FTR11}}
%小写字母也可以的
%以前是10+,此处已更新 2025/6/16注
\quad \color{#FF0000}{red} \\ \quad \color{#00FF00}{green} \\ \quad \color{#0000FF}{blue} \\ \quad \color{#FFFF00}{yellow} \\ \quad \color{#FF00FF}{fuchsia} \\ \quad \color{#00FFFF}{aqua} \\ \quad \color{#000000}{black} \\ \quad \color{#FFFFFF}{white} \\ \text{} \\ \quad \color{#1f1e33}{\text{\#1f1e33 FTR11}}
1.20.3.3 another 256-256-256 mode
{\color[RGB]{255,0,0} red}
{\color[RGB]{0,255,0} green}
{\color[RGB]{0,0,255} blue}
{\color[RGB]{255,255,0} yellow}
{\color[RGB]{255,0,255} purple}
{\color[RGB]{0,255,255} aqua}
{\color[RGB]{0,0,0} black} 
{\color[RGB]{255,255,255} white}
%luogu!!!!!!

1.20.4 举例

x=\dfrac{-b\pm\sqrt{\color{Red}b^2-4ac}}{\color{Blue}2a}
\quad x=\dfrac{-b\pm\sqrt{\color{Red}b^2-4ac}}{\color{Blue}2a}
\color{Blue}\colorbox{Yellow}{LaTeX公式大全}
\quad \color{Blue} \colorbox{Yellow}{LaTeX公式大全}

1.21 大小

表达式 大小 pts(10pt) pts(11pt) pts(12pt)
\tiny \text{\tiny{tiny}} 5 6 6
\footnotesize\\(Typora似乎不支持,luogu终于又赢了一回!) \text{\footnotesize{footnotesize}} 7 8 8
\scriptsize \text{\scriptsize{scriptsize}} 8 9 10
\small \text{\small{small}} 9 10 10.95
\normalsize \text{\normalsize{normalsize}} 10 10.95 12
\large \text{\large{large}} 12 12 14.4
\Large \text{\Large{Large}} 14.4 14.4 17.28
\LARGE \text{\LARGE{LARGE}} 17.28 17.28 20.74
\huge \text{\huge{huge}} 20.74 20.74 24.88
\Huge \text{\Huge{Huge}} 24.88 24.88 24.88

什么?你不满足??还要更大(小)???

整!!!

{\fontsize{30pt}{36pt}\selectfont {\text{30pt}}} 
{\Huge \text{Huge}}
{\fontsize{15pt}{18pt}\selectfont {\text{15pt}}} 
{\tiny \text{tiny}}
{\fontsize{3pt}{3.6pt}\selectfont {\text{3pt}}}
%素材来源转发,用于编写LaTeX文档
%不演示了,Typroa & luogu & latexlive 都不支持
%大概是这样(image,凑合看吧):

1.22 把数学公式框起来

\boxed{\sum\limits_{i = 1}^{n} i = \dfrac{n(n - 1)}{2}}^{\large{\times}}
%《大片块的错误不要划去,画个框,右上角打个x就好了》
%对于行内模式同样有效,不过大多情况用于独立模式。
\quad \boxed{\sum\limits_{i = 1}^{n} i = \dfrac{n(n - 1)}{2}}^{\large{\times}}
\boxed{
  \Large{
    \begin{array}{c}
      H_{n}=\cfrac{n}{\sum \limits_{i=1}^{n}\cfrac{1}{x_{i}}}= \cfrac{n}{\cfrac{1}{x_{1}}+ \cfrac{1}{x_{2}}+ \cdots + \cfrac{1}{x_{n}}} \\
      G_{n}=\sqrt[n]{\prod \limits_{i=1}^{n}x_{i}}= \sqrt[n]{x_{1}x_{2}\cdots x_{n}} \\
      A_{n}=\cfrac{1}{n}\sum \limits_{i=1}^{n}x_{i}=\cfrac{x_{1}+ x_{2}+ \cdots + x_{n}}{n} \\
      Q_{n}=\sqrt{\sum \limits_{i=1}^{n}x_{i}^{2}}= \sqrt{\cfrac{x_{1}^{2}+ x_{2}^{2}+ \cdots + x_{n}^{2}}{n}} \\
      H_{n}\leq G_{n}\leq A_{n}\leq Q_{n}
    \end{array}
  }
}
%大亿点点
\quad \boxed{ \Large{ \begin{array}{c} H_{n}=\cfrac{n}{\sum \limits_{i=1}^{n}\cfrac{1}{x_{i}}}= \cfrac{n}{\cfrac{1}{x_{1}}+ \cfrac{1}{x_{2}}+ \cdots + \cfrac{1}{x_{n}}} \\ G_{n}=\sqrt[n]{\prod \limits_{i=1}^{n}x_{i}}= \sqrt[n]{x_{1}x_{2}\cdots x_{n}} \\ A_{n}=\cfrac{1}{n}\sum \limits_{i=1}^{n}x_{i}=\cfrac{x_{1}+ x_{2}+ \cdots + x_{n}}{n} \\ Q_{n}=\sqrt{\sum \limits_{i=1}^{n}x_{i}^{2}}= \sqrt{\cfrac{x_{1}^{2}+ x_{2}^{2}+ \cdots + x_{n}^{2}}{n}} \\ H_{n}\leq G_{n}\leq A_{n}\leq Q_{n} \end{array} } }

1.23 公式内:定义函数

C++人玩过#define吧,python人玩过def吧;

1.23.1 示范

%无参数
% \def {名称}{定义}

\def \MoBaiDaLao {\%\%\%\quad}
\MoBaiDaLao \MoBaiDaLao \MoBaiDaLao
\def \MoBaiDaLao {\%\%\%\quad} \quad \MoBaiDaLao \MoBaiDaLao \MoBaiDaLao
%有参数
% \def {名称}#1#2...#n{定义}

\def \MoBai#1{\text{#1}\ \%\%\%\quad}
\MoBai{kkksc03} \MoBai{chen\_zhe}
\def \MoBai#1{\text{#1}\ \%\%\%\quad} \quad \MoBai{kkksc03} \MoBai{chen\_zhe}
\def \and#1#2{#1\ \&\ #2\quad}
\and{\operatorname{\LaTeX}}{\text{Markdown}} \and{\text{hxl}}{\text{lln}}
\def \and#1#2{#1\ \&\ #2\quad} \quad \and{\operatorname{\LaTeX}}{\text{Markdown}} \and{\text{hxl}}{\text{lln}}

1.23.2 函数调用函数

\def \MoBaiDaLao {\%\%\%\quad}
\def \MOMOMO {\MoBaiDaLao\MoBaiDaLao\MoBaiDaLao}
\MOMOMO
\def \MoBaiDaLao {\%\%\%\quad} \def \MOMOMO {\MoBaiDaLao\MoBaiDaLao\MoBaiDaLao} \quad \MOMOMO

1.23.3 正经用法

%原来:
\angle\alpha = 45^\circ \\ 
\angle\beta = 70^\circ \\ 
\angle\gamma = 35^\circ \\ 
\therefore \angle\gamma < \angle\alpha < \angle\beta
%用定义:
\def \caa#1#2{\angle #1 = #2^\circ \\} %Create An Angle
\caa{\alpha}{45}\caa{\beta}{70}\caa{\gamma}{35}
\therefore \angle\gamma < \angle\alpha < \angle\beta
\quad \angle\alpha = 45^\circ \\ \quad \angle\beta = 70^\circ \\ \quad \angle\gamma = 35^\circ \\ \quad \therefore \angle\gamma < \angle\alpha < \angle\beta \\ \text{} \\ \def \caa#1#2{\quad\angle #1 = #2^\circ \\} \caa{\alpha}{45} \caa{\beta}{70} \caa{\gamma}{35} \quad \therefore \angle\gamma < \angle\alpha < \angle\beta

1.23.4 全局定义

%众所周知,
{\def \ooo {\text{dfd}}} \ooo \\
%会报错(Typroa不会,自动全局)
%那!!!
%我想让他这样
%实际上加一个g,就O了
{\gdef \ooo {\text{dfd}}} \ooo \\
%或
{\global\def \ooo {\text{dfd}}} \ooo \\
%Typora因为自动全局,没这俩
%效果:
\quad {\def \ooo {\text{dfd}}} \ooo \\ \quad {\gdef \ooo {\text{dfd}}} \ooo\\ \quad {\global\def \ooo {\text{dfd}}} \ooo

1.23.5 再来一个

突然发现还有command没讲

% \_____command {名称}[几个变量]{定义}

% \newcommand: 新定义
% \renewcommand: 覆定义
% \providecommand: 上俩加起来(不是缺点)

% \newcommand \gcd = [ERROR](因为已经有gcd了)
% \renewcommand \lcm = [ERROR](因为还没有lcm)

\newcommand \lcm[2]{\operatorname{lcm}(#1,#2)}
\renewcommand \to[2]{\xrightarrow{#1}_{#2}}
\lcm{1}{2}
\to{yes}{isok}
\newcommand \lcm[2]{\operatorname{lcm}(#1,#2)} \renewcommand \to[2]{\xrightarrow{#1}_{#2}} \quad \lcm{1}{2} \quad\to{yes}{isok}

Tips: 没搞清白edef咋用,知道的dalao帮忙讲讲

1.24 综合运用

\begin{array}{c} 
    S= \binom{N}{n},A_{k}=\binom{M}{k}\cdot \binom{N-M}{n-k} \\ 
    P\left( A_{k}\right) = \cfrac{\binom{M}{k}\cdot \binom{N-M}{n-k}}{\binom{N}{n}} 
\end{array}
\begin{array}{c} \quad S= \binom{N}{n},A_{k}=\binom{M}{k}\cdot \binom{N-M}{n-k} \\ \quad P\left ( A_{k}\right ) = \cfrac{\binom{M}{k}\cdot \binom{N-M}{n-k}}{\binom{N}{n}} \end{array}
\alpha\varphi = \cfrac{\partial y}{\partial x}+\cfrac{\large\lim\delta_{\pi}^{\epsilon}}{{\large\operatorname{arccsc}+\cfrac{\large\iiint_{\varpi}^{\tau}}{{\textstyle\Large\prod_{\eta}^{\upsilon}}+\cfrac{\left(\frac{\partial^2}{\partial\beta\partial\gamma}\sigma\right)}{\large\zeta+\cfrac{\large\nu_{\theta}^{\scriptsize\chi}}{{\textstyle\Large{\sum}_{\,\normalsize\lim\varrho}^{\large\frac{\partial\Delta}{\partial\lim\pi}}}}}}}}
\quad \alpha\varphi = \cfrac{\partial y}{\partial x}+\cfrac{\large\lim\delta_{\pi}^{\epsilon}}{{\large\operatorname{arccsc}+\cfrac{\large\iiint_{\varpi}^{\tau}}{{\textstyle\Large\prod_{\eta}^{\upsilon}}+\cfrac{\left(\frac{\partial^2}{\partial\beta\partial\gamma}\sigma\right)}{\large\zeta+\cfrac{\large\nu_{\theta}^{\scriptsize\chi}}{{\textstyle\Large{\sum}_{\,\normalsize\lim\varrho}^{\large\frac{\partial\Delta}{\partial\lim\pi}}}}}}}}
%需要 mhchem 扩展包支持
\ce{Zn^2+  <=>[+ 2OH-][+ 2H+]  \underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}  <=>[+ 2OH-][+ 2H+]  \underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}}
%luogu不支持!!!老老实实去在线编辑器!!!

\begin{array}{l} 
    a\mathop{{x}}\nolimits^{{2}}+bx+c=0 \\ 
    \Delta =\mathop{{b}}\nolimits^{{2}}-4ac \\ 
    \mathop{{x}}\nolimits_{{1,2}}=\cfrac{{-b \pm  
    \sqrt{{\mathop{{b}}\nolimits^{{2}}-4ac}}}}{{2a}} \\ 
    \mathop{{x}}\nolimits_{{1}}+\mathop{{x}}\nolimits_{{2}}=-\cfrac{{b}}{{a}} \\ 
    \mathop{{x}}\nolimits_{{1}}\mathop{{x}}\nolimits_{{2}}=\cfrac{{c}}{{a}} 
\end{array} 
\quad \begin{array}{l} a\mathop{{x}}\nolimits^{{2}}+bx+c=0 \\ \Delta =\mathop{{b}}\nolimits^{{2}}-4ac \\ \mathop{{x}}\nolimits_{{1,2}}=\cfrac{{-b \pm \sqrt{{\mathop{{b}}\nolimits^{{2}}-4ac}}}}{{2a}} \\ \mathop{{x}}\nolimits_{{1}}+\mathop{{x}}\nolimits_{{2}}=-\cfrac{{b}}{{a}} \\ \mathop{{x}}\nolimits_{{1}}\mathop{{x}}\nolimits_{{2}}=\cfrac{{c}}{{a}} \end{array}
%需要 unicode 扩展包支持
\begin{array}{l}  
    {\unicode{8751}}_\mathbb{S}  \mathbf{E} \cdot\mathrm{d}s= \cfrac{Q}{\varepsilon_0}  \\  
    {\unicode{8751}}_\mathbb{S}  \mathbf{B} \cdot\mathrm{d}s= 0 \\  
    {\oint}_{\mathbb{L}}^{} \mathbf{E} \cdot \mathrm{d}l=-\cfrac{\mathrm{d}\Phi _{\mathbf{B}}}{\mathrm{d}t }  \\  
    {\oint}_{\mathbb{L}}^{} \mathbf{B} \cdot \mathrm{d}l=\mu_0I+ \mu_0 \varepsilon_0\cfrac{\mathrm{d}\Phi _{\mathbf{E}}}{\mathrm{d}t }   
\end{array}
%luogu不支持!!!!!!老老实实去在线编辑器!!!!!!

2. \text{Markdown}

**加粗文本**

__也可以这样加粗__

*斜体文本*

_也可以这样斜体_

***粗斜文本***
<!-- 别用太多,我们不想看到“三星堆” --->

___也可以这样粗斜___

`行内公式`

```语言
独立公式
```

<!-- 我是~~你F12检查也看不到的~~注释 --->

---
<!-- 上面是分割线 --->

# 我是1级标题
我也是1级标题 <!-- 看下行 --->
---
## 我是2级标题
我也是2级标题 <!-- 看下行 --->
===
### 我是3级标题
#### 我是4级标题
##### 我是5级标题
###### 我是6级标题
<!-- 为不影响文章目录,以上10行不进行展示 --->

~~删掉了的文本~~

- `-`无序目录
- `-`无序目录
- `-`无序目录
+ `+`无序目录
+ `+`无序目录
+ `+`无序目录
* `*`无序目录
* `*`无序目录
* `*`无序目录
<!-- 不同符号之间有空隙,可适当用不同符号,`*`已承担许多,尽量不用 --->
<!-- Microsoft Visual Studio Code 的 Markdown 无序目录只能用 `-`,用另外两个会显示语法错误 --->

1. 有序目录
2. 有序目录
3. 有序目录

> ~~五星评论家麦克阿瑟曾...~~
>
> 我引用了一段~~废~~话

| col | col | col | col | col | col |
| - | - | - | - | - | - |
| content | content | content | content | content | content |
| content | content | content | content | content | content |
| content | content | content | content | content | content |
| content | content | content | content | content | content |

![image](图片网址)

[称呼](网址 "显示名")

<!-- 我后来才知道这个是HTML的注释,但懒得改了 2025/1/23注 --->
<!-- 虽然但是,Typora可以用HTML 2025/1/26注 --->

加粗文本

也可以这样加粗

斜体文本

也可以这样斜体

粗斜文本

也可以这样粗斜

行内公式

独立公式

删掉了的文本

  1. 有序目录
  2. 有序目录
  3. 有序目录

五星评论家麦克阿瑟曾...

我引用了一段废话

col col col col col col
content content content content content content
content content content content content content
content content content content content content
content content content content content content

称呼

3 附文

附文1: 1.20.3.1: 16-16-16 mode 全部4096个颜色\\Tips: 此文渲染过多,点进去会卡白屏,数秒后可食用~

附文2: 1.10: \operatorname{\LaTeX}所有的latexlive支持的符号(施工中)

\text{by\ \color{orange}{JSGF\_ArcPhi}\:\color{white}\colorbox{limegreen}{√}} \\ \text{the\ end.}

\color{#000000}{戳我返回导览}