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

相关文章

HarmonyOS学习(七)——UI(五)常用布局总结

自适应布局 1.1、线性布局(LinearLayout) 通过线性容器Row和Column实现线性布局。Column容器内的子组件按照垂直方向排列,Row组件中的子组件按照水平方向排列。 属性说明space通过space参数设置主轴上子组件的间距,达到各子组件在排列上的等间距效果alignItems设置子组件在交叉轴上的对齐方式,且在各类尺寸屏幕上表现一致,其中交叉轴为垂直时,取值为Vert

JS常用组件收集

收集了一些平时遇到的前端比较优秀的组件,方便以后开发的时候查找!!! 函数工具: Lodash 页面固定: stickUp、jQuery.Pin 轮播: unslider、swiper 开关: switch 复选框: icheck 气泡: grumble 隐藏元素: Headroom

【C++】_list常用方法解析及模拟实现

相信自己的力量,只要对自己始终保持信心,尽自己最大努力去完成任何事,就算事情最终结果是失败了,努力了也不留遗憾。💓💓💓 目录   ✨说在前面 🍋知识点一:什么是list? •🌰1.list的定义 •🌰2.list的基本特性 •🌰3.常用接口介绍 🍋知识点二:list常用接口 •🌰1.默认成员函数 🔥构造函数(⭐) 🔥析构函数 •🌰2.list对象

常用的jdk下载地址

jdk下载地址 安装方式可以看之前的博客: mac安装jdk oracle 版本:https://www.oracle.com/java/technologies/downloads/ Eclipse Temurin版本:https://adoptium.net/zh-CN/temurin/releases/ 阿里版本: github:https://github.com/

30常用 Maven 命令

Maven 是一个强大的项目管理和构建工具,它广泛用于 Java 项目的依赖管理、构建流程和插件集成。Maven 的命令行工具提供了大量的命令来帮助开发人员管理项目的生命周期、依赖和插件。以下是 常用 Maven 命令的使用场景及其详细解释。 1. mvn clean 使用场景:清理项目的生成目录,通常用于删除项目中自动生成的文件(如 target/ 目录)。共性规律:清理操作

hdu 4565 推倒公式+矩阵快速幂

题意 求下式的值: Sn=⌈ (a+b√)n⌉%m S_n = \lceil\ (a + \sqrt{b}) ^ n \rceil\% m 其中: 0<a,m<215 0< a, m < 2^{15} 0<b,n<231 0 < b, n < 2^{31} (a−1)2<b<a2 (a-1)^2< b < a^2 解析 令: An=(a+b√)n A_n = (a +

019、JOptionPane类的常用静态方法详解

目录 JOptionPane类的常用静态方法详解 1. showInputDialog()方法 1.1基本用法 1.2带有默认值的输入框 1.3带有选项的输入对话框 1.4自定义图标的输入对话框 2. showConfirmDialog()方法 2.1基本用法 2.2自定义按钮和图标 2.3带有自定义组件的确认对话框 3. showMessageDialog()方法 3.1

工作常用指令与快捷键

Git提交代码 git fetch  git add .  git commit -m “desc”  git pull  git push Git查看当前分支 git symbolic-ref --short -q HEAD Git创建新的分支并切换 git checkout -b XXXXXXXXXXXXXX git push origin XXXXXXXXXXXXXX

java常用面试题-基础知识分享

什么是Java? Java是一种高级编程语言,旨在提供跨平台的解决方案。它是一种面向对象的语言,具有简单、结构化、可移植、可靠、安全等特点。 Java的主要特点是什么? Java的主要特点包括: 简单性:Java的语法相对简单,易于学习和使用。面向对象:Java是一种完全面向对象的语言,支持封装、继承和多态。跨平台性:Java的程序可以在不同的操作系统上运行,称为"Write once,

nginx介绍及常用功能

什么是nginx nginx跟Apache一样,是一个web服务器(网站服务器),通过HTTP协议提供各种网络服务。 Apache:重量级的,不支持高并发的服务器。在Apache上运行数以万计的并发访问,会导致服务器消耗大量内存。操作系统对其进行进程或线程间的切换也消耗了大量的CPU资源,导致HTTP请求的平均响应速度降低。这些都决定了Apache不可能成为高性能WEB服务器  nginx: