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

相关文章

Python中pywin32 常用窗口操作的实现

《Python中pywin32常用窗口操作的实现》本文主要介绍了Python中pywin32常用窗口操作的实现,pywin32主要的作用是供Python开发者快速调用WindowsAPI的一个... 目录获取窗口句柄获取最前端窗口句柄获取指定坐标处的窗口根据窗口的完整标题匹配获取句柄根据窗口的类别匹配获取句

Python的time模块一些常用功能(各种与时间相关的函数)

《Python的time模块一些常用功能(各种与时间相关的函数)》Python的time模块提供了各种与时间相关的函数,包括获取当前时间、处理时间间隔、执行时间测量等,:本文主要介绍Python的... 目录1. 获取当前时间2. 时间格式化3. 延时执行4. 时间戳运算5. 计算代码执行时间6. 转换为指

Python正则表达式语法及re模块中的常用函数详解

《Python正则表达式语法及re模块中的常用函数详解》这篇文章主要给大家介绍了关于Python正则表达式语法及re模块中常用函数的相关资料,正则表达式是一种强大的字符串处理工具,可以用于匹配、切分、... 目录概念、作用和步骤语法re模块中的常用函数总结 概念、作用和步骤概念: 本身也是一个字符串,其中

usb接口驱动异常问题常用解决方案

《usb接口驱动异常问题常用解决方案》当遇到USB接口驱动异常时,可以通过多种方法来解决,其中主要就包括重装USB控制器、禁用USB选择性暂停设置、更新或安装新的主板驱动等... usb接口驱动异常怎么办,USB接口驱动异常是常见问题,通常由驱动损坏、系统更新冲突、硬件故障或电源管理设置导致。以下是常用解决

springboot项目中常用的工具类和api详解

《springboot项目中常用的工具类和api详解》在SpringBoot项目中,开发者通常会依赖一些工具类和API来简化开发、提高效率,以下是一些常用的工具类及其典型应用场景,涵盖Spring原生... 目录1. Spring Framework 自带工具类(1) StringUtils(2) Coll

Java String字符串的常用使用方法

《JavaString字符串的常用使用方法》String是JDK提供的一个类,是引用类型,并不是基本的数据类型,String用于字符串操作,在之前学习c语言的时候,对于一些字符串,会初始化字符数组表... 目录一、什么是String二、如何定义一个String1. 用双引号定义2. 通过构造函数定义三、St

Linux上设置Ollama服务配置(常用环境变量)

《Linux上设置Ollama服务配置(常用环境变量)》本文主要介绍了Linux上设置Ollama服务配置(常用环境变量),Ollama提供了多种环境变量供配置,如调试模式、模型目录等,下面就来介绍一... 目录在 linux 上设置环境变量配置 OllamPOgxSRJfa手动安装安装特定版本查看日志在

Java常用注解扩展对比举例详解

《Java常用注解扩展对比举例详解》:本文主要介绍Java常用注解扩展对比的相关资料,提供了丰富的代码示例,并总结了最佳实践建议,帮助开发者更好地理解和应用这些注解,需要的朋友可以参考下... 目录一、@Controller 与 @RestController 对比二、使用 @Data 与 不使用 @Dat

Mysql中深分页的五种常用方法整理

《Mysql中深分页的五种常用方法整理》在数据量非常大的情况下,深分页查询则变得很常见,这篇文章为大家整理了5个常用的方法,文中的示例代码讲解详细,大家可以根据自己的需求进行选择... 目录方案一:延迟关联 (Deferred Join)方案二:有序唯一键分页 (Cursor-based Paginatio

Python实现常用文本内容提取

《Python实现常用文本内容提取》在日常工作和学习中,我们经常需要从PDF、Word文档中提取文本,本文将介绍如何使用Python编写一个文本内容提取工具,有需要的小伙伴可以参考下... 目录一、引言二、文本内容提取的原理三、文本内容提取的设计四、文本内容提取的实现五、完整代码示例一、引言在日常工作和学