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

相关文章

C#中读取XML文件的四种常用方法

《C#中读取XML文件的四种常用方法》Xml是Internet环境中跨平台的,依赖于内容的技术,是当前处理结构化文档信息的有力工具,下面我们就来看看C#中读取XML文件的方法都有哪些吧... 目录XML简介格式C#读取XML文件方法使用XmlDocument使用XmlTextReader/XmlTextWr

如何解决Pycharm编辑内容时有光标的问题

《如何解决Pycharm编辑内容时有光标的问题》文章介绍了如何在PyCharm中配置VimEmulator插件,包括检查插件是否已安装、下载插件以及安装IdeaVim插件的步骤... 目录Pycharm编辑内容时有光标1.如果Vim Emulator前面有对勾2.www.chinasem.cn如果tools工

CSS弹性布局常用设置方式

《CSS弹性布局常用设置方式》文章总结了CSS布局与样式的常用属性和技巧,包括视口单位、弹性盒子布局、浮动元素、背景和边框样式、文本和阴影效果、溢出隐藏、定位以及背景渐变等,通过这些技巧,可以实现复杂... 一、单位元素vm 1vm 为视口的1%vh 视口高的1%vmin 参照长边vmax 参照长边re

Python中操作Redis的常用方法小结

《Python中操作Redis的常用方法小结》这篇文章主要为大家详细介绍了Python中操作Redis的常用方法,文中的示例代码简洁易懂,具有一定的借鉴价值,有需要的小伙伴可以了解一下... 目录安装Redis开启、关闭Redisredis数据结构redis-cli操作安装redis-py数据库连接和释放增

一文详解Python中数据清洗与处理的常用方法

《一文详解Python中数据清洗与处理的常用方法》在数据处理与分析过程中,缺失值、重复值、异常值等问题是常见的挑战,本文总结了多种数据清洗与处理方法,文中的示例代码简洁易懂,有需要的小伙伴可以参考下... 目录缺失值处理重复值处理异常值处理数据类型转换文本清洗数据分组统计数据分箱数据标准化在数据处理与分析过

Java中Object类的常用方法小结

《Java中Object类的常用方法小结》JavaObject类是所有类的父类,位于java.lang包中,本文为大家整理了一些Object类的常用方法,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1. public boolean equals(Object obj)2. public int ha

Java 字符数组转字符串的常用方法

《Java字符数组转字符串的常用方法》文章总结了在Java中将字符数组转换为字符串的几种常用方法,包括使用String构造函数、String.valueOf()方法、StringBuilder以及A... 目录1. 使用String构造函数1.1 基本转换方法1.2 注意事项2. 使用String.valu

VUE动态绑定class类的三种常用方式及适用场景详解

《VUE动态绑定class类的三种常用方式及适用场景详解》文章介绍了在实际开发中动态绑定class的三种常见情况及其解决方案,包括根据不同的返回值渲染不同的class样式、给模块添加基础样式以及根据设... 目录前言1.动态选择class样式(对象添加:情景一)2.动态添加一个class样式(字符串添加:情

Java 枚举的常用技巧汇总

《Java枚举的常用技巧汇总》在Java中,枚举类型是一种特殊的数据类型,允许定义一组固定的常量,默认情况下,toString方法返回枚举常量的名称,本文提供了一个完整的代码示例,展示了如何在Jav... 目录一、枚举的基本概念1. 什么是枚举?2. 基本枚举示例3. 枚举的优势二、枚举的高级用法1. 枚举

IDEA常用插件之代码扫描SonarLint详解

《IDEA常用插件之代码扫描SonarLint详解》SonarLint是一款用于代码扫描的插件,可以帮助查找隐藏的bug,下载并安装插件后,右键点击项目并选择“Analyze”、“Analyzewit... 目录SonajavascriptrLint 查找隐藏的bug下载安装插件扫描代码查看结果总结Sona