KaTex 常用公式编辑

2024-04-01 04:28
文章标签 公式 编辑 常用 katex

本文主要是介绍KaTex 常用公式编辑,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

原文:https://blog.iyatt.com/?p=7854

注:语法上和 Latex 差不多一样,我是因为 WordPress 上使用 WP Githuber MD 插件,才用的 KaTex(插件里面的 LaTex 模块有 bug,无法渲染)

希腊字母

大写代码小写代码
AAα\alpha
BBβ\beta
Γ\Gammaγ\gamma
Δ\Deltaδ\delta
EEϵ\epsilon
ZZζ\zeta
HHη\eta
Θ\Thetaθ\theta
IIι\iota
KKκ\kappa
Λ\Lambdaλ\lambda
MMμ\mu
NNν\nu
Ξ\Xiξ\xi
OOο\omicron
Π\Piπ\pi
PPρ\rho
Σ\Sigmaσ\sigma
TTτ\tau
ΥΥυ\upsilon
Φ\Phiϕ\phi
XXχ\chi
Ψ\Psiψ\psi
Ω\Omegaω\omega

符号

乘 \times × \times ×
除 \div ÷ \div ÷
加减 \pm ± \pm ±
减加 \mp ∓ \mp
偏导数 \partial ∂ \partial
小于 \lt < \lt <
大于 \gt > \gt >
小于等于 \le ≤ \le
大于等于 \ge ≥ \ge
不等于 \ne ≠ \ne =
加 \not 否定,如 \not \lt ≮ \not \lt <
并集 \cup ∪ \cup
交集 \cap ∩ \cap
子集 subset ⊂ \subset ,subseteq ⊊ \subsetneq
差集 \setminus ∖ \setminus
非子集 \subsetneq ⊊ \subsetneq
父集 \supset ⊃ \supset
属于 \in ∈ \in
不属于 \notin ∉ \notin /
空集 \emptyset ∅ \emptyset
空 \varnothing ∅ \varnothing
虚数 i、j \imath ı \imath , \jmath ȷ \jmath
异或 \oplus ⊕ \oplus
同与 \otimes ⊗ \otimes
同或 \odot ⊙ \odot
与 \land ∧ \land
或 \lor ∨ \lor
非 \lnot ¬ \lnot ¬
点乘 \cdot ⋅ \cdot
平均运算符 \overline{x} x ‾ \overline{x} x
向量(单)\vec{x} x ⃗ \vec{x} x
向量(多)\overrightarrow{xy} x y → \overrightarrow{xy} xy
梯度算子 \nabla ∇ \nabla
空格 \ ,比如 a\ b a b a\ b a b
任意 \forall ∀ \forall
存在 \exists ∃ \exists
反斜杠 \backslash \ \backslash \

\to → \to
\rightarrow → \rightarrow
\leftarrow ← \leftarrow
\leftrightarrow ↔ \leftrightarrow
\uparrow ↑ \uparrow
\downarrow ↓ \downarrow
\updownarrow ↕ \updownarrow
\Rightarrow ⇒ \Rightarrow
\Leftarrow ⇐ \Leftarrow
\Leftrightarrow ⇔ \Leftrightarrow
\Uparrow ⇑ \Uparrow
\Downarrow ⇓ \Downarrow
\Updownarrow ⇕ \Updownarrow
长箭头,前面加 long 或 Long,比如 \longrightarrow ⟶ \longrightarrow ,\Longrightarrow ⟹ \Longrightarrow

\twoheadrightarrow ↠ \twoheadrightarrow
\rightarrowtail ↣ \rightarrowtail
\looparrowright ↬ \looparrowright
\curvearrowright ↷ \curvearrowright
\circlearrowright ↻ \circlearrowright
\Rsh ↱ \Rsh
\multimap ⊸ \multimap
\leftrightsquigarrow ↭ \leftrightsquigarrow
\rightsquigarrow ⇝ \rightsquigarrow
\leadsto ⇝ \leadsto
\nearrow ↗ \nearrow
\searrow ↘ \searrow
\swarrow ↙ \swarrow
\nwarrow ↖ \nwarrow
\nleftarrow ↚ \nleftarrow
\nrightarrow ↛ \nrightarrow
\nLeftarrow ⇍ \nLeftarrow
\nRightarrow ⇏ \nRightarrow
\nleftrightarrow ↮ \nleftrightarrow
\nLeftrightarrow ⇎ \nLeftrightarrow
\dashrightarrow ⇢ \dashrightarrow
\dashleftarrow ⇠ \dashleftarrow
\leftleftarrows ⇇ \leftleftarrows
\leftrightarrows ⇆ \leftrightarrows
\twoheadleftarrow ↞ \twoheadleftarrow
\leftarrowtail ↢ \leftarrowtail
\looparrowleft ↫ \looparrowleft
\curvearrowleft ↶ \curvearrowleft
\circlearrowleft ↺ \circlearrowleft
\Lsh ↰ \Lsh
\mapsto ↦ \mapsto
\hookleftarrow ↩ \hookleftarrow
\hookrightarrow ↪ \hookrightarrow
\upharpoonright ↾ \upharpoonright
\upharpoonleft ↿ \upharpoonleft
\downharpoonright ⇂ \downharpoonright
\downharpoonleft ⇃ \downharpoonleft
\leftharpoonup ↼ \leftharpoonup
\rightharpoonup ⇀ \rightharpoonup
\leftharpoondown ↽ \leftharpoondown
\rightharpoondown ⇁ \rightharpoondown
\upuparrows ⇈ \upuparrows
\downdownarrows ⇊ \downdownarrows
\rightrightarrows ⇉ \rightrightarrows
\rightleftarrows ⇄ \rightleftarrows
\rightrightarrows ⇉ \rightrightarrows
\rightleftarrows ⇄ \rightleftarrows
\rightleftharpoons ⇌ \rightleftharpoons
\leftrightharpoons ⇋ \leftrightharpoons

\mapsto ↦ \mapsto
\forall ∀ \forall
\exists ∃ \exists
\top ⊤ \top
\bot ⊥ \bot
\vDash ⊨ \vDash
\star ⋆ \star
\ast ∗ \ast
\bullet ∙ \bullet
约等于 \approx ≈ \approx
波浪号 \sim ∼ \sim
\equiv ≡ \equiv
\prec ≺ \prec
无穷 \infty ∞ \infty
\aleph_o ℵ o \aleph_o o
\aleph_o ℵ o \aleph_o o
\Im ℑ \Im
\Re ℜ \Re
\ldots … \ldots
\cdots ⋯ \cdots
\vdots ⋮ \vdots
\ddots ⋱ \ddots
\hat x x ^ \hat x x^
\widehat {xy} x y ^ \widehat {xy} xy
\dot x x ˙ \dot x x˙
\ddot x x ¨ \ddot x x¨
\dot {\dot x} x ˙ ˙ \dot {\dot x} x˙˙
\mathring{U} U ˚ \mathring{U} U˚

##上下添加公式

\overset{x=9}{=}
= x = 9 \overset{x=9}{=} =x=9

\underset{x=\sin\theta}{=}
= x = sin ⁡ θ \underset{x=\sin\theta}{=} x=sinθ=

\xlongequal[下方公式]{上方公式}
= 下方公式 上方公式 \xlongequal[下方公式]{上方公式} 上方公式 下方公式

上下大括号

\overbrace{a+b+c}^x a + b + c ⏞ x \overbrace{a+b+c}^x a+b+c x

a+\underbrace{b+c}_y a + b + c ⏟ y a+\underbrace{b+c}_y a+y b+c

上下标

A^m_n A n m A_n^m Anm
A_n^m A n m A_n^m Anm
x^2 x 2 x^2 x2
a_n a n a_n an
a_{n+1} a n + 1 a_{n+1} an+1
A{BC} A B C A^{B^C} ABC
{AB}C A B C {A^B}^C ABC

根号

\sqrt{25} 25 \sqrt{25} 25
\sqrt[3]{27} 27 3 \sqrt[3]{27} 327

分式

\frac{a+b}{a-b} a + b a − b \frac{a+b}{a-b} aba+b
\frac{4}{5} 4 5 \frac{4}{5} 54

括号

(), [] 直接使用,{ 和 } 有特殊含义,需要使用 { 和 } 表示。

尖括号使用
\langle ⟨ \langle
\rangle ⟩ \rangle

求和

\sum_{i=1}^n ∑ i = 1 n \sum_{i=1}^n i=1n
\sum_{j=0}^k ∑ j = 0 k \sum_{j=0}^k j=0k

连乘

\prod_{i=0}^nx ∏ i = 0 n \prod_{i=0}^n i=0n

积分

\int_0^x ∫ 0 x \int_0^x 0x
\iint_0^x ∬ 0 x \iint_0^x 0x
\iiint_0^x ∭ 0 x \iiint_0^x 0x

极限

\lim_{x \to \infty}(1 + \frac{1}{x})^x
lim ⁡ x → ∞ ( 1 + 1 x ) x \lim_{x \to \infty}(1 + \frac{1}{x})^x xlim(1+x1)x

换行等号对齐

\begin{aligned}
19&=10+9 \\
&=11+8 \\
&=12+7
\end{aligned}

19 = 10 + 9 = 11 + 8 = 12 + 7 \begin{aligned} 19&=10+9 \\ &=11+8 \\ &=12+7 \end{aligned} 19=10+9=11+8=12+7

分类

f(x)=
\begin{cases}
x+1, &x<0\\
0, &x=0\\
2x-1, &x>0
\end{cases}

f ( x ) = { x + 1 , x < 0 0 , x = 0 2 x − 1 , x > 0 f(x)= \begin{cases} x+1, &x<0\\ 0, &x=0\\ 2x-1, &x>0 \end{cases} f(x)= x+1,0,2x1,x<0x=0x>0

方程组

\left \{
\begin{array}{l} % l 靠左、c 居中、r 靠右
x+y+z=6 \\
2x-y+z=3 \\
x+y-z=0
\end{array}
\right.

{ x + y + z = 6 2 x − y + z = 3 x + y − z = 0 \left \{ \begin{array}{l} x+y+z=6 \\ 2x-y+z=3 \\ x+y-z=0 \end{array} \right. x+y+z=62xy+z=3x+yz=0

多列对齐

\begin{array}{l l} % l 靠左、c 居中、r 靠右
x+y+z=6 & x+y+z=6\\
2x-y+z=3 & 2x-y+z=3 \\
x+y-z=0 & x+y-z=0
\end{array}

x + y + z = 6 x + y + z = 6 2 x − y + z = 3 2 x − y + z = 3 x + y − z = 0 x + y − z = 0 \begin{array}{l l} % l 靠左、c 居中、r 靠右 x+y+z=6 & x+y+z=6\\ 2x-y+z=3 & 2x-y+z=3 \\ x+y-z=0 & x+y-z=0 \end{array} x+y+z=62xy+z=3x+yz=0x+y+z=62xy+z=3x+yz=0

矩阵

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

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

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

{ 1 2 3 4 5 6 7 8 9 } \left \{ \begin{matrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{matrix} \right \} 147258369

\left |
\begin{matrix}
1&2&3 \\
4&5&6 \\
7&8&9
\end{matrix}
\right |

∣ 1 2 3 4 5 6 7 8 9 ∣ \left | \begin{matrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{matrix} \right | 147258369

\left (
\begin{matrix}
1&2&3 \\
4&5&6 \\
7&8&9
\end{matrix}
\right )

( 1 2 3 4 5 6 7 8 9 ) \left ( \begin{matrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{matrix} \right ) 147258369

上面是使用 \left 和 \right 来添加的左右括号,也可以不用这对符号,将 \begin 和 \end 后面的词分别换为 pmatrix、bmatrix、Bmatrix、vmatrix、Vmatrix,分别对应小括号、中括号、大括号、单竖线、双竖线,如:

\begin{pmatrix}
1&2&3 \\
4&5&6 \\
7&8&9
\end{pmatrix}

( 1 2 3 4 5 6 7 8 9 ) \begin{pmatrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{pmatrix} 147258369

\begin{array} {c c | c} % c 居中,r 右对齐,l 左对齐,竖线为插入竖线的位置
1&2&3 \\
\hline % 插入横线
4&5&6 \\
7&8&9
\end{array}

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

表格

\begin{array}{c|lcr}
n & \text{Left} & \text{Center} & \text{Right} \\
\hline
1 & 2 & 1 & 4 \\
4 & 3 & 2 & 1 \\
1.0 & 2.0 & 3000 & 3\times10^5 \\
\end{array}

n Left Center Right 1 2 1 4.0 4 3 2 1 1.0 2.0 3000 3 × 1 0 5 \begin{array}{c|lcr} n & \text{Left} & \text{Center} & \text{Right} \\ \hline 1 & 2 & 1 & 4.0 \\ 4 & 3 & 2 & 1 \\ 1.0 & 2.0 & 3000 & 3\times10^5 \\ \end{array} n141.0Left232.0Center123000Right4.013×105

\begin{array}{|c|c|}
\hline
\text{公式1} & \text{公式2} \\
\hline
\begin{aligned}
a &= b + c \\&= d + e
\end{aligned}
&
\begin{aligned}
f &= g + h \\&= i + j
\end{aligned} \\
\hline
\end{array}

公式1 公式2 a = b + c = d + e f = g + h = i + j \begin{array}{|c|c|} \hline \text{公式1} & \text{公式2} \\ \hline \begin{aligned} a &= b + c \\ &= d + e \end{aligned} & \begin{aligned} f &= g + h \\ &= i + j \end{aligned} \\ \hline \end{array} 公式1a=b+c=d+e公式2f=g+h=i+j

字体

黑板粗体

一般用于表示数学和物理学中的向量或集合

\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
\mathbb{abcdefghijklmnopqrstuvwxyz} a b c d e f g h i j k l m n o p q r s t u v w x y z \mathbb{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz

正粗体

\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
\mathbf{abcdefghijklmnopqrstuvwxyz} a b c d e f g h i j k l m n o p q r s t u v w x y z \mathbf{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz

罗马体

\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
\mathrm{abcdefghijklmnopqrstuvwxyz} a b c d e f g h i j k l m n o p q r s t u v w x y z \mathrm{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz

哥特体

\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
\mathfrak{abcdefghijklmnopqrstuvwxyz} a b c d e f g h i j k l m n o p q r s t u v w x y z \mathfrak{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz

打印体

\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
\mathtt{abcdefghijklmnopqrstuvwxyz} a b c d e f g h i j k l m n o p q r s t u v w x y z \mathtt{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz

手写体

\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
\mathcal{abcdefghijklmnopqrstuvwxyz} a b c d e f g h i j k l m n o p q r s t u v w x y z \mathcal{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz

这篇关于KaTex 常用公式编辑的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/866200

相关文章

MySQL常用字符串函数示例和场景介绍

《MySQL常用字符串函数示例和场景介绍》MySQL提供了丰富的字符串函数帮助我们高效地对字符串进行处理、转换和分析,本文我将全面且深入地介绍MySQL常用的字符串函数,并结合具体示例和场景,帮你熟练... 目录一、字符串函数概述1.1 字符串函数的作用1.2 字符串函数分类二、字符串长度与统计函数2.1

MySQL 内存使用率常用分析语句

《MySQL内存使用率常用分析语句》用户整理了MySQL内存占用过高的分析方法,涵盖操作系统层确认及数据库层bufferpool、内存模块差值、线程状态、performance_schema性能数据... 目录一、 OS层二、 DB层1. 全局情况2. 内存占js用详情最近连续遇到mysql内存占用过高导致

Linux系统中查询JDK安装目录的几种常用方法

《Linux系统中查询JDK安装目录的几种常用方法》:本文主要介绍Linux系统中查询JDK安装目录的几种常用方法,方法分别是通过update-alternatives、Java命令、环境变量及目... 目录方法 1:通过update-alternatives查询(推荐)方法 2:检查所有已安装的 JDK方

MySQL字符串常用函数详解

《MySQL字符串常用函数详解》本文给大家介绍MySQL字符串常用函数,本文结合实例代码给大家介绍的非常详细,对大家学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录mysql字符串常用函数一、获取二、大小写转换三、拼接四、截取五、比较、反转、替换六、去空白、填充MySQL字符串常用函数一、

Java中Arrays类和Collections类常用方法示例详解

《Java中Arrays类和Collections类常用方法示例详解》本文总结了Java中Arrays和Collections类的常用方法,涵盖数组填充、排序、搜索、复制、列表转换等操作,帮助开发者高... 目录Arrays.fill()相关用法Arrays.toString()Arrays.sort()A

Spring Boot中WebSocket常用使用方法详解

《SpringBoot中WebSocket常用使用方法详解》本文从WebSocket的基础概念出发,详细介绍了SpringBoot集成WebSocket的步骤,并重点讲解了常用的使用方法,包括简单消... 目录一、WebSocket基础概念1.1 什么是WebSocket1.2 WebSocket与HTTP

golang中reflect包的常用方法

《golang中reflect包的常用方法》Go反射reflect包提供类型和值方法,用于获取类型信息、访问字段、调用方法等,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值... 目录reflect包方法总结类型 (Type) 方法值 (Value) 方法reflect包方法总结

C# 比较两个list 之间元素差异的常用方法

《C#比较两个list之间元素差异的常用方法》:本文主要介绍C#比较两个list之间元素差异,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录1. 使用Except方法2. 使用Except的逆操作3. 使用LINQ的Join,GroupJoin

python常用的正则表达式及作用

《python常用的正则表达式及作用》正则表达式是处理字符串的强大工具,Python通过re模块提供正则表达式支持,本文给大家介绍python常用的正则表达式及作用详解,感兴趣的朋友跟随小编一起看看吧... 目录python常用正则表达式及作用基本匹配模式常用正则表达式示例常用量词边界匹配分组和捕获常用re

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的