LaTex公式编写

LaTex公式编写


MarkDown中引用LaTex公式

特殊字符说明示例
$公式$LaTex公式前后加$是行内公式$y=ax+b$
$$公式$$两个$括起来的是独占一行的公式$$y=ax+b$$
\转义字符要表示$可输入\$

通常我们使用单个$括住公式,来表示行内公式如 y = a x + b y=ax+b y=ax+b,他是不会换行的。

如果是两个$$来括住公式,那么这个公式独占一行,如:

y = a x + b y=ax+b y=ax+b

会占用单独的一行空间。


LaTex公式的表示

简单运算

像拉丁字母(az,AZ)、阿拉伯数字(0~9)和 + − ∗ / = +-*/= +/=运算符均可以直接输入获得,没有特殊的表示方法,如:

y = a b c + 9 ∗ 8 − d / 5 y=abc+9*8-d/5 y=abc+98d/5

还有些特殊的运算符:

符号意义展示
\cdot乘法的圆点 ⋅ \cdot
\neq不等号 ≠ \neq =
\equiv恒等于 ≡ \equiv
\bmod取模   m o d   \bmod mod
\sim波形号 ∼ \sim
\times乘法符号 × \times ×
\div除法符号 ÷ \div ÷
\approx约等于 ≈ \approx
\ldots跟本文底线对齐的省略号 … \ldots
\cdots跟文本中线对齐的省略号 ⋯ \cdots

上下标

通常 _ 表示下标、 ^ 表示上标;当上下标内容不止一个字符时,需用大括号 {} 括起来;单引号 表示求导,如:

y''=x^{x^2}_0

y ′ ′ = x 0 x 2 y''=x^{x^2}_0 y=x0x2

上下标记(水平线&括弧)

通常用 \overline\underline 分别在表达式上、下方画出水平线,例如:

\overline{y}=\underline{x_1+x_2}

y ‾ = x 1 + x 2 ‾ \overline{y}=\underline{x_1+x_2} y=x1+x2

\overbrace\underbrace 分别在表达式上、下方画出花括弧,例如:

\overbrace{1+2+3+\cdots+n}^{n} \qquad \underbrace{1^2+2^2+3^2+\cdots+10^2}_{10}

1 + 2 + 3 + ⋯ + n ⏞ n 1 2 + 2 2 + 3 2 + ⋯ + 1 0 2 ⏟ 10 \overbrace{1+2+3+\cdots+n}^{n} \qquad \underbrace{1^2+2^2+3^2+\cdots+10^2}_{10} 1+2+3++n n10 12+22+32++102

分式

通常用 \frac 表示分式,即 \frac{分子}{分母} ,如:

\frac{x^2_0}{x_1+x_2}

x 0 2 x 1 + x 2 \frac{x^2_0}{x_1+x_2} x1+x2x02

根号

通常用 \sqrt 表示平方根,即 \sqrt{根号下的公式}\sqrt[n] 表示n次方根,即 \sqrt[n]{根号下的公式} ,例如:

y=\sqrt[3]{\frac{x_1^2}{x_2}}+\sqrt{x_1^2+x_2^2}

y = x 1 2 x 2 3 + x 1 2 + x 2 2 y=\sqrt[3]{\frac{x_1^2}{x_2}}+\sqrt{x_1^2+x_2^2} y=3x2x12 +x12+x22

向量

通常用 \vec 表示向量, \overrightarrow 表示箭头向右的向量, \overleftarrow 表示箭头向左的向量。使用时后面还要跟上 {} ,即 \vec{向量字母} ,如:

\vec{a_0}=\overrightarrow{AB}-\overleftarrow{AC}

a 0 ⃗ = A B → − A C ← \vec{a_0}=\overrightarrow{AB}-\overleftarrow{AC} a0 =AB AC

积分

通常用 \int 表示积分,格式为 \int_{积分下限}^{积分上限}{公式}\mathrm{d}x ,例如:

y'=\int_{1}^{x}{(x^2+3x+3)}\mathrm{d}x

y ′ = ∫ 1 x ( x 2 + 3 x + 3 ) d x y'=\int_{1}^{x}{(x^2+3x+3)}\mathrm{d}x y=1x(x2+3x+3)dx

此外还有二重积分 \iint ,闭合积分 \oint ,闭合二重积分 \oiint

\iint \oint \oiint_{1}^{x}

∬ ∮ ∯ 1 x \iint \oint \oiint_{1}^{x} 1x

极限

通常用 \lim 表示极限, \infty 表示无穷,+\infty 表示正无穷, -\infty 表示负无穷, \to 表示向右的箭头(或者 \rightarrow ),格式为 \lim_{条件} ,例如:

\lim_{x \to +\infty}e^{-x}=0

lim ⁡ x → + ∞ e − x = 0 \lim_{x \to +\infty}e^{-x}=0 x+limex=0

求和

通常用 \sum 表示求和,格式 \sum_{下条件}^{上条件} ,如:

\sum_{i=1}^{100}x^{-1}=1^{-1}+2^{-1}+\cdots+100^{-1}

∑ i = 1 100 x − 1 = 1 − 1 + 2 − 1 + ⋯ + 10 0 − 1 \sum_{i=1}^{100}x^{-1}=1^{-1}+2^{-1}+\cdots+100^{-1} i=1100x1=11+21++1001

乘积

可以用 \prod 表示乘积,格式为 \prod_{下条件}^{上条件} ,例如:

\prod_{j=1}^{10}x^3=1^3\cdot2^3\cdots10^3

∏ j = 1 10 x 3 = 1 3 ⋅ 2 3 ⋯ 1 0 3 \prod_{j=1}^{10}x^3=1^3\cdot2^3\cdots10^3 j=110x3=1323103

矩阵

对于不带任何括号的矩阵,通常以 \begin{matrix} 开始, \end{matrix} 结束,用 & 来分割列,用 \\ 来分割行,例如:

\begin{matrix}
1 & 2 \\
3 & 4 \\
\end{matrix}

1 2 3 4 \begin{matrix} 1 & 2 \\ 3 & 4 \\ \end{matrix} 1324

还有带方括弧的矩阵 bmatrix ,例如:

\begin{bmatrix}
a & b & \cdots \\
c & d & \cdots \\
\vdots & \vdots & \ddots \\
\end{bmatrix}

[ a b ⋯ c d ⋯ ⋮ ⋮ ⋱ ] \begin{bmatrix} a & b & \cdots \\ c & d & \cdots \\ \vdots & \vdots & \ddots \\ \end{bmatrix} acbd

也有带两条竖线的矩阵 vmatrix ,例如:

\begin{vmatrix}
1 & 2 \\
3 & 4 \\
\end{vmatrix}

∣ 1 2 3 4 ∣ \begin{vmatrix} 1 & 2 \\ 3 & 4 \\ \end{vmatrix} 1324

最后有带圆括弧的矩阵 pmatrix ,例如:

\begin{pmatrix}
x_{11} & x_{12} & \cdots & x_{1j} \\
x_{21} & x_{22} & \cdots & x_{2j} \\
\vdots & \vdots & \ddots & \vdots \\
x_{i1} & x_{i2} & \cdots & x_{ij} \\
\end{pmatrix}

( x 11 x 12 ⋯ x 1 j x 21 x 22 ⋯ x 2 j ⋮ ⋮ ⋱ ⋮ x i 1 x i 2 ⋯ x i j ) \begin{pmatrix} x_{11} & x_{12} & \cdots & x_{1j} \\ x_{21} & x_{22} & \cdots & x_{2j} \\ \vdots & \vdots & \ddots & \vdots \\ x_{i1} & x_{i2} & \cdots & x_{ij} \\ \end{pmatrix} x11x21xi1x12x22xi2x1jx2jxij

证明

常用的证明符号如下:

公式符号说明
\therefore ∴ \therefore 所以
\because ∵ \because 因为
\forall ∀ \forall 对于所有
\exist ∃ \exist 存在
\bigvee ⋁ \bigvee
\bigwedge ⋀ \bigwedge
\Leftarrow ⇐ \Leftarrow
\Rightarrow ⇒ \Rightarrow
\Leftrightarrow ⇔ \Leftrightarrow

集合

对于常见的集合符号,有:

公式符号说明
\bigcup ⋃ \bigcup 并集
\bigcap ⋂ \bigcap 交集
\subset ⊂ \subset 属于
\supset ⊃ \supset 属于
\subseteq ⊆ \subseteq 真属于
\supseteq ⊇ \supseteq 真属于
\in ∈ \in
\notin ∉ \notin /
\subsetneq ⊊ \subsetneq
\supsetneq ⊋ \supsetneq

比较符

常见的比较符号如下:

公式符号说明
< < < <小于
> > > >大于
\leq ≤ \leq 小于等于
\geq ≥ \geq 大于等于
\ll ≪ \ll 远小于
\gg ≫ \gg 远大于
= = = =等于
\approx ≈ \approx 约等于
\neq ≠ \neq =不等于
\equiv ≡ \equiv 恒等于

箭头

常用的箭头如下:

公式符号说明
\leftarrow ← \leftarrow
\rightarrow → \rightarrow
\leftrightarrow ↔ \leftrightarrow
\Leftarrow ⇐ \Leftarrow
\Rightarrow ⇒ \Rightarrow
\Leftrightarrow ⇔ \Leftrightarrow
\uparrow ↑ \uparrow
\downarrow ↓ \downarrow
\updownarrow ↕ \updownarrow
\Uparrow ⇑ \Uparrow
\Downarrow ⇓ \Downarrow
\Updownarrow ⇕ \Updownarrow
\leftharpoonup ↼ \leftharpoonup
\leftharpoondown ↽ \leftharpoondown
\rightharpoonup ⇀ \rightharpoonup
\rightharpoondown ⇁ \rightharpoondown
\rightleftharpoons ⇌ \rightleftharpoons
\leftrightharpoons ⇋ \leftrightharpoons
\iff    ⟺    \iff
\mapsto ↦ \mapsto

希腊字母

通常大写希腊字母只需将小写希腊字母中LaTeX语法的第一个字母改为大写即可,如 \alpha α \alpha α 的大写为 \Alpha A \Alpha A ,小写希腊字母语法见下表:

公式符号说明
\alpha α \alpha α
\beta β \beta β
\gamma γ \gamma γ
\delta δ \delta δ
\epsilon ϵ \epsilon ϵ
\zeta ζ \zeta ζ
\eta η \eta η
\theta θ \theta θ
\iota ι \iota ι
\kappa κ \kappa κ
\lambda λ \lambda λ
\mu μ \mu μ
\xi ξ \xi ξ
o o o o
\pi π \pi π
\rho ρ \rho ρ
\sigma σ \sigma σ
\tau τ \tau τ
\upsilon υ \upsilon υ
\phi ϕ \phi ϕ
\chi χ \chi χ
\psi ψ \psi ψ

空格&间隔

  1. 两个单词之间使用 \! ,使输入的单词之间内容紧贴,缩进1/6宽度:
Embrace\!the\!glorious\!mess\!that\!you\!are.

E m b r a c e  ⁣ t h e  ⁣ g l o r i o u s  ⁣ m e s s  ⁣ t h a t  ⁣ y o u  ⁣ a r e . Embrace\!the\!glorious\!mess\!that\!you\!are. Embracethegloriousmessthatyouare.

  1. 单词之间使用 \, ,使输出的单词之间有了较小的空格,间隔1/6宽度:
Embrace\,the\,glorious\,mess\,that\,you\,are.

E m b r a c e   t h e   g l o r i o u s   m e s s   t h a t   y o u   a r e . Embrace\,the\,glorious\,mess\,that\,you\,are. Embracethegloriousmessthatyouare.

  1. 单词之间使用";",使输出的单词之间有了中等的空格,间隔2/7宽度:
Embrace\;the\;glorious\;mess\;that\;you\;are.

E m b r a c e    t h e    g l o r i o u s    m e s s    t h a t    y o u    a r e . Embrace\;the\;glorious\;mess\;that\;you\;are. Embracethegloriousmessthatyouare.

  1. 单词之间使用"\ ",使输出的单词之间有了大空格,间隔1/3宽度:
Embrace\ the\ glorious\ mess\ that\ you\ are.

E m b r a c e   t h e   g l o r i o u s   m e s s   t h a t   y o u   a r e . Embrace\ the\ glorious\ mess\ that\ you\ are. Embrace the glorious mess that you are.

  1. 单词之间使用"\quad ",使输出的单词之间有了大空格,间隔1宽度:
Embrace\quad the\quad glorious\quad mess\quad that\quad you\quad are.

E m b r a c e t h e g l o r i o u s m e s s t h a t y o u a r e . Embrace\quad the\quad glorious\quad mess\quad that\quad you\quad are. Embracethegloriousmessthatyouare.

  1. 单词之间使用"\qquad ",使输出的单词之间有了大空格,间隔2宽度:
Embrace\qquad the\qquad glorious\qquad mess\qquad that\qquad you\quad are.

E m b r a c e t h e g l o r i o u s m e s s t h a t y o u a r e . Embrace\qquad the\qquad glorious\qquad mess\qquad that\qquad you\quad are. Embracethegloriousmessthatyouare.

字母上标

字母上标就是字母头上的标记,如 a ^ \hat{a} a^

所有类型的上标如下表格所示:

公式符号
\hat{a} a ^ \hat{a} a^
\ddot{a} a ¨ \ddot{a} a¨
\bar{a} a ˉ \bar{a} aˉ
\vec{a} a ⃗ \vec{a} a
\grave{a} a ˋ \grave{a} aˋ
\breve{a} a ˘ \breve{a} a˘
\overline{a} a ‾ \overline{a} a
\widehat{a} a ^ \widehat{a} a
\dot{a} a ˙ \dot{a} a˙
\check{a} a ˇ \check{a} aˇ
\tilde{a} a ~ \tilde{a} a~
\acute{a} a ˊ \acute{a} aˊ
\widetilde{a} a ~ \widetilde{a} a
\sim ∼ \sim

其中里面的 a 可以换成其他字母或者表达式!

公式组合

通过 cases 语句可以实现公式的组合,用 & 来分割公式和条件,用 \\ 来换行,例如:

F(x)=
\begin{cases}
x^2+x+1 & x<3 \\
1 & 3<=x<4 \\
\int_4^{x}{x^3}\mathrm{d}x & x>=4 \\
\end{cases}

F ( x ) = { x 2 + x + 1 x < 3 1 3 < = x < 4 ∫ 4 x x 3 d x x > = 4 F(x)= \begin{cases} x^2+x+1 & x<3 \\ 1 & 3<=x<4 \\ \int_4^{x}{x^3}\mathrm{d}x & x>=4 \\ \end{cases} F(x)=x2+x+114xx3dxx<33<=x<4x>=4

公式拆分

可以用 split 语句来拆分公式,用 & 来分割,用 \\ 来换行,例如:

\begin{split}
\cos 2x & = \cos^2 2x-\sin^22x \\
&=2\cos^2x-1 \\
\end{split}

KaTeX parse error: No such environment: split at position 8: \begin{̲s̲p̲l̲i̲t̲}̲ \cos 2x & = \c…

### 回答1: LaTeX公式编辑器离线是指无需连接互联网,即可使用的编辑器。在没有网络条件或者需要在没有网络的环境下进行编辑时,离线编辑器非常方便。 使用离线的LaTeX公式编辑器,可以在电脑或移动设备上安装相关的软件或应用程序,并进行LaTeX公式的编辑和排版。离线编辑器通常包含了LaTeX语言的编辑和预览功能,用户可以通过输入LaTeX代码来插入各种符号、函数和公式,并实时预览编辑结果。用户还可以设置字体、大小和对齐方式等格式选项,以符合自己的需求。一些离线编辑器还支持手写输入,用户可以使用触摸屏或绘图板来绘制公式。 离线编辑器相比在线编辑器有许多优势。首先,离线编辑器无需依赖网络连接,当没有网络或者网络信号不稳定时也可以进行编辑工作。其次,离线编辑器通常具有更强大的功能和更高的性能,对于复杂的公式编辑更加方便和高效。同时,离线编辑器的安全性也更高,用户的相关数据不会被存储在云端,更加保护隐私。 总之,LaTeX公式编辑器的离线功能为用户提供了更加灵活和便捷的编辑环境,无论是在没有网络的情况下还是对性能和安全性有要求的用户都能够从中受益。使用离线编辑器,用户可以随时随地进行公式编辑,提高工作效率和方便性。 ### 回答2: LaTeX公式编辑器的离线功能指的是用户在没有网络连接的情况下也可以使用该编辑器来编辑和生成Latex公式。这个功能非常实用,因为有时候我们可能会在没有网络的环境中工作,或者有时候我们可能面临网络连接不稳定的情况。 离线功能使得用户可以在没有网络连接的情况下使用LaTeX编辑器打开已有的文件、编辑和保存文件。用户可以在离线模式下使用LaTeX编辑器的所有功能,包括创建、修改和预览LaTeX公式。当用户重新连接到网络时,编辑器可以将离线期间所做的更改同步到服务器上保存的文件中。 离线功能的实现主要依靠本地存储和同步机制。当用户首次使用LaTeX公式编辑器时,它会下载所需的文件和工具来实现离线编辑功能。编辑器会在本地保存用户所做的更改,并在重新连接到网络时将这些更改同步到服务器上。 此外,离线功能还提供了自动备份功能,可以在用户编辑公式时定期备份文件,以防止因为突发情况导致的丢失数据。 总而言之,LaTeX公式编辑器的离线功能使得用户可以在没有网络连接的情况下进行LaTeX公式编辑,保证了用户的工作效率和数据的安全。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值