OrangeX4-HyperSnips快捷命令

== fraction ==

simple fraction

Snippet

snippet // "Fraction" iAm
\\frac{${1:${VISUAL}}}{$2}$0
endsnippet

example

input://
latex:$\frac{}{}$
visual:\(\frac{}{}\)

fraction no '()'

Snippet

snippet `((\d+)|(\d*)(\\)?([A-Za-z!]+)((\^|_)(\{\d+\}|\d))*)/` "Fraction no ()" iAm
\frac{``rv = m[1]``}{$1}$0
endsnippet

Regex

img

example

keys latex visual
5/ \frac{5}{} \(\frac{5}{}\)
5/2 \frac{5}{2} \(\frac{5}{2}\)
5a^2/ \frac{5a^2}{} \(\frac{5a^2}{}\)
5a^2/3 \frac{5a^2}{3} \(\frac{5a^2}{3}\)
5\alpah^2/3 \frac{5\alpha^2}{3} \(\frac{5\alpha^2}{3}\)
5a_2/3 \frac{5a_2}{3} \(\frac{5a_2}{3}\)
5\alpah_2/3 \frac{5\alpha_2}{3} \(\frac{5\alpha_2}{3}\)
5a_2/b \frac{5a_2}{b} \(\frac{5a_2}{b}\)

fraction with ()

Snippet

priority 200
snippet `(?<=\s)(\\mu|\\alpha|\\sigma|\\rho|\\beta|\\gamma|\\delta|\\zeta|\\eta|\\varepsilon|\\theta|\\iota|\\kappa|\\vartheta|\\lambda|\\nu|\\pi|\\rho|\\tau|\\upsilon|\\phi|\\chi|\\psi|\\omega|\\Gamma|\\Delta|\\Theta|\\Lambda|\\Xi|\\Pi|\\Sigma|\\Upsilon|\\Phi|\\Psi|\\Omega|[A-Za-z]{1,2})?(_[A-Za-z0-9]|_\{[^}]+\})?(\^[A-Za-z0-9]|\^\{[^}]+\})?(_[A-Za-z0-9]|_\{[^}]+\})?(\([^)]+\))(_[A-Za-z0-9]|_\{[^}]+\})?(\^[A-Za-z0-9]|\^\{[^}]+\})?(_[A-Za-z0-9]|_\{[^}]+\})?\/` "Fraction with ()" iAm
``rv = "\\frac{" + m.slice(1, m.length).join('') + "}{$1}$2"``
endsnippet

Regex

img

Comments

输入方式:空白字符 + 字母 + 上下标 + (任意非)字符) + 上下标 + /

example

keys latex visual
a_1(2)^3/ \frac{a_1(2)^3}{} $ \frac{a_1(2)^3}{}$
\alpah_1(2)^3/ \frac{a_1(2)^3}{} $ \frac{\alpha_1(2)^3}{b}$
a_1(c+d)^3/b \frac{a_1(c+d)^3}{b} $ \frac{a_1(c+d)^3}{b}$
a_12(c+d)_e3/b \frac{a_1^2(c+d)_e^3}{b} $ \frac{a_12(c+d)_e3}{b}$

== Hat Operation ==

==== Auto Capture Hat Operation ====

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*}?)?)(hbar|BAR)` "Bar" iAm
\overline{``rv = m[1] + m[2] + m[3]``}
endsnippet

Regex

img

Example

keys latex visual
`` `` $$

Tilde

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)(htd|TD)` "tilde" iAm
\tilde{``rv = m[1]``}
endsnippet

Regex

img

Example

keys latex visual
ahtd \tilde{a} \(\tilde{a}\)
\alphahtd \tilde{\alpha} \(\tilde{\alpha}\)
a1htd \tilde{a_1{2}} \(\tilde{a_1}\)
a1{3}htd \tilde{a_1{3}} \(\tilde{a_1{3}}\)

Bar

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)bar` "bar" iAm
\bar{``rv = m[1]``}
endsnippet

Example

keys latex visual
abar \bar{a} \(\bar{a}\)
\alphabar \bar{\alpha} \(\bar{\alpha}\)
a1bar \bar{a_1{2}} \(\bar{a_1}\)
a1{3}bar \bar{a_1{3}} \(\bar{a_1{3}}\)

Hat

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)(hat|HAT)` "hat" iAm
\hat{``rv = m[1]``}
endsnippet

Example

keys latex visual
ahat \hat{a} \(\hat{a}\)
\alphahat \hat{\alpha} \(\hat{\alpha}\)
a1hat \hat{a_1{2}} \(\hat{a_1}\)
a1{3}hat \hat{a_1{3}} \(\hat{a_1{3}}\)

Vector postfix

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)(hvec)` "Vector postfix" iAm
\vec{``rv = m[1]``}
endsnippet

Example

keys latex visual
avec \vec{a} \(\vec{a}\)
\alphavec \vec{\alpha} \(\vec{\alpha}\)
a1vec \vec{a_1{2}} \(\vec{a_1}\)
a1{3}vec \vec{a_1{3}} \(\vec{a_1{3}}\)

Vector postfix

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)(rta)` "Vector postfix" iAm
\overrightarrow{``rv = m[1]``}
endsnippet

Comment

word + rta : \(\overrightarrow{word}\)

Example

keys latex visual
arta \overrightarrow{a} \(\overrightarrow{a}\)
alpharta \overrightarrow{\alpha} \(\overrightarrow{\alpha}\)
a1rta \overrightarrow{a_1} \(\overrightarrow{a_1}\)
a1{3}rta \overrightarrow{a} \(\overrightarrow{a_1{3}}\)

dot hat

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)(hdot)` "dot" iAm
\dot{``rv = m[1]``}
endsnippet

Comment

word + hdot

Example

keys latex visual
ahdot \dot{a} \(\dot{a}\)
\alphahdot \dot{\alpha} \(\dot{\alpha}\)
a1hdot \dot{a_1{2}} \(\dot{a_1}\)
a1{3}hdot \dot{a_1{3}} \(\dot{a_1{3}}\)

dot hat

Snippet

snippet `(\\?[a-zA-Z]\w*({?\w*})?)(hddot)` "ddot" iAm
\ddot{``rv = m[1]``}
endsnippet

Comment

word + hddot: $$

Example

keys latex visual
ahddot \ddot{a} \(\ddot{a}\)
\alphahddot \ddot{\alpha} \(\ddot{\alpha}\)
a1hddot \ddot{a_1{2}} \(\ddot{a_1}\)
a1{3}hddot \ddot{a_1{3}} \(\ddot{a_1{3}}\)

===== Static Hat Operation ====

dot hat

Snippet

snippet hbar "bar" iAm
\overline{$1}$0
endsnippet

Comment

word + hbar: $$

Example

keys latex visual
---- ----- ------

hat

Snippet

snippet hat "hat" iAm
\hat{$1}$0
endsnippet

Comment

word + hat: \(\hat{word}\)

Example

keys latex visual
ahat \hat{a} \(\hat{a}\)
\alphahat \hat{\alpha} \(\hat{\alpha}\)
a1hat \hat{a_1{2}} \(\hat{a_1}\)
a1{3}hat \hat{a_1{3}} \(\hat{a_1{3}}\)

Sqrt

Snippet

snippet hsq "\sqrt{}" iAm
\sqrt{${1}}$0
endsnippet

Comment

hsq + word: \(\sqrt{word}\)

Example

keys latex visual
hsqa \sqrt{a} \(\sqrt{a}\)
hsq a^2+b^2 \sqrt{a} \(\sqrt{a^2+b^2}\)

== Superscript Operation ==

Inverse

Snippet

snippet invs "inverse" iAm
^{-1}
endsnippet

Comment

word+invs: \(word^{-1}\)

Example

keys latex visual
invs ^{-1} \(^{-1}\)
ainvs a^{-1} \(a^{-1}\)
xyinvs xy^{-1} \(xy^{-1}\)
(a+b)invs (a+b)^{-1} \((a+b)^{-1}\)

T Inverse

Snippet

priority 10000
snippet TR "inverse" iAm
^{\mathsf{T}}
endsnippet

Comment

word+TR: \(word^{\mathsf{T}}\)

Example

keys latex visual
TR ^{\mathsf{T}} \(^{\mathsf{T}}\)
aTR a^{\mathsf{T}} \(a^{\mathsf{T}}\)

Complement

Snippet

snippet CL "complement" iAm
^{c}
endsnippet

Comment

word+CL: \(word^{c}\)

Example

keys latex visual
CL ^{c} \(^{c}\)
aCL a^{c} \(a^{c}\)

\(R_0^+\)

Snippet

snippet R+ "R0+" iAm
R_0^+
endsnippet

Comment

word+R+: \(wordR_0^+\)

Example

keys latex visual
R+ R_0^+ \(R_0^+\)
aR+ aR_0^+ \(aR_0^+\)

power

Snippet

snippet pow "power" iAm
^{${1:2}}$0
endsnippet

Comment

word+pow: \(a^{2}\)

Example

keys latex visual
pow ^{2} \(^{2}\)
apow3 a^{3} \(a^{3}\)

to the ... power

Snippet

snippet tp "to the ... power" iAm
^{${1:2}}$0
endsnippet

Comment

word+tp: \(a^{2}\)

Example

keys latex visual
tp ^{2} \(^{2}\)
atp a^{2} \(a^{2}\)
atp5 a^{5} \(a^{5}\)

Square

Snippet

snippet sr "square" iAm
^{2}$0
endsnippet

Comment

word+sr: \(a^{2}\)

Example

keys latex visual
sr ^{2} \(^{2}\)
asr a^{2} \(a^{2}\)

== Subscript Operation ==

Subscript

Snippet

snippet td "subscript" iAm
_{${1}}$0
endsnippet

Comment

word+td: \(word_{}\)
下标待输入

Example

keys latex visual
td _{2} \(_{2}\)
atd a_{2} \(a_{2}\)

Subscript with default 2

Snippet

snippet sb "subscript" iAm
_{${1:2}}$0
endsnippet

Comment

word+sb: \(word_{2}\)
下标默认值为2

Example

keys latex visual
sb _{2} \(_{2}\)
asb3 a_{3} \(a_{3}\)

Auto Subscript after } repeat digit

Snippet

snippet `(})(\d)\2` "auto subscript" iAm
`` rv = m[1] + "_" + m[2]``
endsnippet

Regex

img

Comment

{+word+}+\d+前一个相同数字: \({word}_2\)

Example

keys latex visual
{a}11 {a}_1 \({a}_1\)
{(a+b)}22 {(a+b)}_2 \({(a+b)}_2\)

Auto Subscript Letter + Digit

Snippet

snippet `([A-Za-z])(\d)` "auto subscript" iAm
`` rv = m[1] + "_" + m[2]``
endsnippet

Comment

字母+数字: \(a_1\)

Example

keys latex visual
a1 a_1 \(a_1\)
b1 b_1 \(b_1\)

Auto Subscript Letter + 2 Digits

Snippet

priority 100
snippet `([A-Za-z])_(\d{2})` "auto subscript" iAm
`` rv = m[1] + "_{" + m[2] + "}$0" ``
endsnippet

Comment

字母+两个数字: \(a_{12}\)

Example

keys latex visual
a12 a_{12} \(a_{12}\)
b12 b_{12} \(b_{12}\)

Auto Subscript Letter + S + Digit

Snippet

priority 100
snippet `([A-Za-z])S(\d)` "auto subscript" iAm
`` rv = m[1] + "_{" + m[2] + "$1}$2"``
endsnippet

Comment

字母+S+数字+word: \(a_{2a}\)

Example

keys latex visual
aS2b a_{2b} \(a_{2b}\)

Auto Subscript 2

Snippet

snippet `\b(?<!\\)([A-Za-z}])([a-z])\2` "auto subscript 2" iAm
`` rv = m[1] + "_" + m[2].substring(0, 1) ``
endsnippet

Regex

img

Comment

字边界+字母+小写字母+前一个相同字母: \(word b_a\)

Example

keys latex visual
word baa word b_a \(word b_a\)
{abc}baa {abc}b_a \({abc}b_a\)

Auto Subscript 2

Snippet

snippet `\b(?<!\\)([A-Za-z}])S([a-z])\2` "auto subscript 2" iAm
`` rv = m[1] + "_{" + m[2].substring(0, 1) + "$1}$2"``
endsnippet

Comment

字边界+字母+S+小写字母+前一个相同字母: \(word b_a\)

Example

keys latex visual
word bSaab word b_{ab} \(word b_{ab}\)
{abc}bSaab {abc}b_{ab} \({abc}b_{ab}\)

Custom: Add more greek letters

Auto subscript for greek letter

Snippet

snippet `(\\mu|\\alpha|\\sigma|\\rho|\\beta|\\gamma|\\delta|\\zeta|\\eta|\\varepsilon|\\theta|\\iota|\\kappa|\\vartheta|\\lambda|\\nu|\\pi|\\rho|\\tau|\\upsilon|\\phi|\\chi|\\psi|\\omega|\\Gamma|\\Delta|\\Theta|\\Lambda|\\Xi|\\Pi|\\Sigma|\\Upsilon|\\Phi|\\Psi|\\Omega)([a-z])\2` "auto subscript for greek letter" iAm
`` rv = m[1] + "_" + m[2].substring(0, 1) ``
endsnippet

Comment

希腊字母+小写字母+前一个相同小写字母: \(\mu_a\)

Example

keys latex visual
muaa \mu_a \(\mu_a\)
\muaa \mu_a \(\mu_a\)

Auto subscript for greek letter with {}

Snippet

snippet `(\\mu|\\alpha|\\sigma|\\rho|\\beta|\\gamma|\\delta|\\zeta|\\eta|\\varepsilon|\\theta|\\iota|\\kappa|\\vartheta|\\lambda|\\nu|\\pi|\\rho|\\tau|\\upsilon|\\phi|\\chi|\\psi|\\omega|\\Gamma|\\Delta|\\Theta|\\Lambda|\\Xi|\\Pi|\\Sigma|\\Upsilon|\\Phi|\\Psi|\\Omega)S([a-z])\2` "auto subscript for greek letter" iAm
`` rv = m[1] + "_{${1:" + m[2].substring(0, 1) + "}}$2"``
endsnippet

Comment

希腊字母+S+小写字母+前一个相同小写字母: \(\mu_{a}\)

Example

keys latex visual
muSaa \mu_{a} \(\mu_{a}\)

== Font Operation ==

==== Static Operation ====

Text

Snippet

snippet txt "text" iAm
\text{$1}$0
endsnippet

snippet tit "text it" iAm
\textit{$1}$0
endsnippet

Example

keys latex visual
txtabc \text{abc} \(\text{abc}\)
titabc \textit{abc} \(\textit{abc}\)

Math Text

Snippet

snippet mcal "mathcal" im
\mathcal{$1}$0
endsnippet

snippet mbb "mathbb" iAm
\mathbb{$1}$0
endsnippet

snippet mbf "mathbf" iAm
\mathbf{$1}$0
endsnippet

snippet mbm "mathbm" iAm
\mathbm{$1}$0
endsnippet

snippet KK "K" iAm
^{\mathrm{K}}
endsnippet

snippet TT "T" iAm
^{\mathrm{T}}
endsnippet

snippet RR "R" iAm
\mathbb{R}
endsnippet

snippet NN "N" iAm
\mathbb{N}
endsnippet

snippet ZZ "Z" iAm
\mathbb{Z}
endsnippet

snippet QQ "Q" iAm
\mathbb{Q}
endsnippet

snippet CC "C" iAm
\mathbb{C}
endsnippet

Example

keys latex visual
mcal \mathcal{M} \(\mathcal{M}\)
Acal \mathcal{A} \(\mathcal{A}\)
mbb \mathbb{m} \(\mathbb{m}\)
Abb \mathbb{A} \(\mathbb{A}\)
mbf \mathbf{m} \(\mathbf{m}\)
Abf \mathbf{A} \(\mathbf{A}\)
mbm \bm{m} \(\bm{m}\)
Abm \bm{A} \(\bm{A}\)
KK \mathbb{K} \(\mathbb{K}\)
TT \mathbb{T} \(\mathbb{T}\)
RR \mathbb{R} \(\mathbb{R}\)
NN \mathbb{N} \(\mathbb{N}\)
ZZ \mathbb{Z} \(\mathbb{Z}\)
QQ \mathbb{Q} \(\mathbb{Q}\)
CC \mathbb{C} \(\mathbb{C}\)

==== Dynamic Operation ====

mathbf mathbm 1bm

Snippets

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)(bf|BF)` "mathbf" iAm
\mathbf{``rv = m[1]``}
endsnippet

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)(bm|BM)` "mathbm" iAm
\bm{``rv = m[1]``}
endsnippet

snippet 1bm "1bm" iAm
\bm{1}
endsnippet

Example

keys latex visual
wordbf \mathbf{word} \(\mathbf{word}\)
wordbm \mathbm{word} \(\bm{word}\)
1bm \bm{1} \(\bm{1}\)

boldsymbol

Snippets

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)(bs)` "boldsymbol" iAm
\boldsymbol{``rv = m[1]``}
endsnippet

Example

keys latex visual
abcbs \boldsymbol{abc} \(\boldsymbol{abc}\)

mathsf

Snippets

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)(sf)` "mathsf" iAm
\mathsf{``rv = m[1]``}
endsnippet

Example

keys latex visual
abcsf \mathsf{abc} \(\mathsf{abc}\)

mathfrak

Snippets

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)(frak)` "mathfrak" iAm
\mathfrak{``rv = m[1]``}
endsnippet

Example

keys latex visual
abcfrak \mathfrak{abc} \(\mathfrak{abc}\)

mathcal

Snippets

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)cal` "mathcal" iAm
\mathcal{``rv = m[1].toUpperCase()``}$0
endsnippet

Example

keys latex visual
abccal \mathcal{ABC} \(\mathcal{ABC}\)

mathrm

Snippets

priority 100
snippet `(?<!\\)\b([a-zA-Z]+)rm` "mathrm" iAm
\mathrm{``rv = m[1]``}
endsnippet

img

Example

keys latex visual
arm \mathrm{a} \(\mathrm{a}\)
abrm \mathrm{ab} \(\mathrm{ab}\)

operatorname

Snippets

priority 100
snippet `(?<!\\)\b([a-zA-Z]+)opn` "operatorname" iAm
\operatorname{``rv = m[1]``}
endsnippet

Example

keys latex visual
aopn \operatorname{a} \(\operatorname{a}\)
abopn \operatorname{ab} \(\operatorname{ab}\)

mathbb

Snippets

priority 100
snippet `(\\?[a-zA-Z]\w*({?\w*})?)bb` iAm
\mathbb{``rv = m[1]``}$0
endsnippet

Example

keys latex visual
abb \mathbb{a} \(\mathbb{a}\)

== Auto Symbol ==

$\infty, \cdots, \diamond $

Snippet

snippet oo "\infty" iAmm
\infty
endsnippet

snippet ... "cdots" iAm
\cdots 
endsnippet

snippet <> "hokje" iA
\diamond 
endsnippet

Example

keys latex visual
oo \infty \(\infty\)
... \cdots $\cdots $
<> \diamond $\diamond $

+... -> , \cdots

- ... -> , \cdots

add a space if there already is one.

$- \cdots, + \cdots $

Snippet

priority 101
snippet `(?<=[-+])\s*\.\.\.` "smart cdots" imA
 \cdots 
endsnippet

Example

keys latex visual
-... - \cdots $- \cdots $
+... + \cdots $+ \cdots $

It seems that \ldots is only used when , ...,

,... -> , \ldots

, ... -> , \ldots

$, \ldots,\cdot ,\odot $

Snippet

priority 101
snippet `(?<=,)(\s*)\.\.\.` "smart ldots" imA
 \ldots 
endsnippet

snippet ** "dot multiply" iAm
\cdot 
endsnippet

snippet odot "odot" iAm
\odot 
endsnippet
keys latex visual
,... , \ldots $, \ldots $
** \cdot $\cdot $
odot \odot $\odot $

\(\times,\epsilon,\ell,\log,\)

Snippet

priority 101
snippet xx "cross" iAm
\times 
endsnippet

snippet eps "epsilon" iAm
\epsilon
endsnippet

priority 100
snippet ell "ell" iAm
\ell
endsnippet

priority 100
snippet log "log" iAm
\log
endsnippet
keys latex visual
xx \times $\times $
eps \epsilon \(\epsilon\)
ell \ell \(\ell\)

\(^{*}\)

Snippet

snippet star "star" iAm
^{*}
endsnippet
keys latex visual
star ^{*} \(^{*}\)

\(\int,\iint,\iiint,\oint\)

Snippet

snippet `(?<!\\)(oint|iiint|iint|int)` "integrate" iAm
\\``rv = m[1]``
endsnippet
keys latex visual
oint \oint \(\oint\)
iiint \iiint \(\iiint\)
iint \iint \(\iint\)
int \int \(\int\)

\(\sum_{},\min_{},\max_{}\)

Snippet

snippet `(?<!\\)(sum|min|max|argmin|argmax|sup|inf)` "sum|min|max|argmin|argmax|sup|inf" iAm
\\``rv = m[1]``_{$1}
endsnippet
keys latex visual
suma \sum_{a} \(\sum_{a}\)
mina \min_{a} \(\min_{a}\)
maxa \max_{a} \(\max_{a}\)

function

Snippet

snippet `(?<!\\)(sin|cos|arccot|cot|csc|ln|exp|det|perp|arcsin|arccos|arctan|arccot|arccsc|arcsec|ell|nabla|notin|not)` "function" iAm
\\``rv = m[1]`` 
endsnippet

Example

keys latex visual
sina \sin a \(\sin a\)
cosa \cos a \(\cos a\)
cota \cot a \(\cot a\)
csca \csc a \(\csc a\)
lna \ln a \(\ln a\)
deta \det a \(\det a\)
perpa \perp a \(\perp a\)
expa \exp a \(\exp a\)
ella \ell a \(\ell a\)
nablaa \nabla a \(\nabla a\)
notina \notin a \(\notin a\)
nota \not a \(\not a\)

greek

Snippet

snippet `(?<!\\)(mu|alpha|sigma|rho|beta|gamma|delta|pi|zeta|eta|varepsilon|theta|iota|kappa|vartheta|lambda|nu|pi|rho|tau|upsilon|varphi|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)` "greek" iAm
\\``rv = m[1]``
endsnippet

Example

keys latex visual keys latex visual
mu \mu \(\mu\) alpha \alpha \(\alpha\)
sigma \sigma \(\sigma\) rho \rho \(\rho\)
beta \beta \(\beta\) gamma \gamma \(\gamma\)
pi \pi \(\pi\) zeta \zeta \(\zeta\)
eta \eta \(\eta\) varepsilon \varepsilon \(\varepsilon\)
theta \theta \(\theta\) iota \iota \(\iota\)
kappa \kappa \(\kappa\) vartheta \vartheta \(\vartheta\)
lambda \lambda \(\lambda\) nu \nu \(\nu\)
tau \tau \(\tau\) upsilon \upsilon \(\upsilon\)
varphi \varphi \(\varphi\) phi \phi \(\phi\)
chi \chi \(\chi\) psi \psi \(\psi\)
omega \omega \(\omega\) Gamma \Gamma \(\Gamma\)
Delta \Delta \(\Delta\) Theta \Theta \(\Theta\)
Lambda \Lambda \(\Lambda\) Xi \Xi \(\Xi\)
Pi \Pi \(\Pi\) Sigma \Sigma \(\Sigma\)
Upsilon \Upsilon \(\Upsilon\) Phi \Phi \(\Phi\)
Psi \Psi \(\Psi\) Omega \Omega \(\Omega\)

==== Space Symbol ====

Space

Snippet

snippet `(?<!\\)(quad)` "ln" iAm
\\``rv = m[1]``
endsnippet

Example

keys latex visual
aquad b a\quad b \(a\quad b\)

==== Logic Symbol ====

empty

Snippet

snippet empty "empty" iAm
\empty
endsnippet

Example

keys latex visual
empty \empty \(\empty\)

\(\in\)

Snippet

priority 200
snippet inn "in" iAm
\in 
endsnippet

Example

keys latex visual
iin \in $\in $

$\lnot $

Snippet

snippet `\\ln ot` "in" iAm
\lnot 
endsnippet

Example

keys latex visual
\ln ot \lnot $\lnot $

$\subseteq $

Snippet

snippet sse "subseteq" iAm
\subseteq 
endsnippet

Example

keys latex visual
sse \subseteq $\subseteq $

$\sqsubseteq $

Snippet

snippet sqs "sqsubset" iAm
\sqsubseteq 
endsnippet

Example

keys latex visual
sqs \sqsubseteq $\sqsubseteq $

$\to $

Snippet

snippet tto "to" iAm
\to 
endsnippet

Example

keys latex visual
tto \to $\to $

logic

Snippet

priority 200
snippet `(?<=\b|\d+)(?<!\\)(cap|cup|land|lor|lnot|oplus|ominus|otimes|sqcap|sqcup|vdash|models)` "logic operator" iAm
\\``rv = m[1]`` 
endsnippet

priority 200
snippet `(?<=\b|\d+)(?<!\\)(bot|top|dagger)` "logic symbols" iAm
\\``rv = m[1]``
endsnippet

Example

keys latex visual
cap \cap $\cap $
cup \cup $\cup $
land \land $\land $
lor \lor $\lor $
lnot \lnot $\lnot $
oplus \oplus $\oplus $
ominus \ominus $\ominus $
otimes \otimes $\otimes $
sqcap \sqcap $\sqcap $
sqcup \sqcup $\sqcup $
vdash \vdash $\vdash $
models \models $\models $
bot \bot $\bot $
top \top $\top $
dagger \dagger $\dagger $

$\to $

Snippet

snippet -> "to" iAm
\to 
endsnippet

snippet !> "mapsto" iAm
\mapsto 
endsnippet

snippet => "implies" iAm
\implies
endsnippet

snippet =< "implied by" iAm
\impliedby
endsnippet

priority 200
snippet iff "if and only if" iAm
\iff
endsnippet

snippet EE "exist" iAm
\exists 
endsnippet

snippet AA "forall" iAm
\forall 
endsnippet

snippet bec "because" iAm
\because 
endsnippet

snippet thr "therefore" iAm
\therefore 
endsnippet

Example

keys latex visual
-> \to \(\to\)
=> \implies \(\implies\)
=< \impliedby \(\impliedby\)
iff \iff \(\iff\)
EE \exists $\exists $
AA \forall $\forall $
bec \because $\because $
thr \therefore $\therefore $

==== Possibility Symbol ====

\(\operatorname{Pr}\)

Snippet

snippet Pr "Pr" iAm
\operatorname{Pr}
endsnippet

snippet Var "Var" iAm
\operatorname{Var}
endsnippet

snippet Cov "Cov" iAm
\operatorname{Cov}
endsnippet

snippet Exp "Expected" iAm
\mathbb{E}
endsnippet

Example

keys latex visual
P r \operatorname{Pr} \(\operatorname{Pr}\)
V ar \operatorname{Var} \(\operatorname{Var}\)
C ov \operatorname{Cov} \(\operatorname{Cov}\)
Exp \mathbb{E} \(\mathbb{E}\)

==== Compare Symbol ====

Compare

Snippet

snippet -- "setminus" iAm
\setminus
endsnippet

snippet >= "greater than" iAm
\ge $0
endsnippet

snippet dis "displaystyle" iAm
\displaystyle 
endsnippet

snippet <= "less than" iAm
\le $0
endsnippet

snippet != "no equals" iAm
\neq 
endsnippet

snippet == " constan equals" iAm
\equiv 
endsnippet

snippet sim " sim" iAm
\sim 
endsnippet

snippet ~~ " Amppro equals" iAm
\thickapprox 
endsnippet

snippet ~= " Amppro equals2" iAm
\cong
endsnippet

snippet >> ">>" iAm
\gg
endsnippet


snippet << "<<" iAm
\ll
endsnippet

Example

keys latex visual
-- \setminus \(\setminus\)
>= \ge $\ge $
dis \displaystyle $\displaystyle $
<= \le $\le $
!= \neq $\neq $
== \equiv $\equiv $
~= \cong \(\cong\)
sim \sim $\sim $
~~ \thickapprox $\thickapprox $
>> \gg \(\gg\)
<< \ll \(\ll\)

== Auto Environment ==

==== Auto Math Mode ====

Atom Math

Snippet

snippet lm "inline Math" wA
$${1}$$0
endsnippet

snippet dm "display Math" wA
$$
${1}
$$$0
endsnippet

snippet eqt "equation" wA
\begin{equation}
  ${1}
\end{equation}
endsnippet

snippet eqs "equation*" wA
\begin{equation*}
  ${1}
\end{equation*}
endsnippet

Example

keys latex visual comment
lma $a$ \(a\) 公式外
dma `$ keys latex
------ ----------------------------------------- ---------------------------------------------- -------

a
`$
keys latex visual
------ ----------------------------------------- ---------------------------------------------- -------
                     | $$a$$                                          | 公式外  |

| eqta | \begin{equation}
a
\end{equation} | $$\begin{equation} a \qquad \end{equation}$$ | 公式内 |
| eqsa | \begin{equation}
a
\end{equation
} | $$\begin{equation} a \qquad \end{equation}$$ | 公式内 |
img

==== Common Environment ====

{,align

Snippet

snippet case "cases" iAm
\begin{cases}
	$1 \\\\
\end{cases}
endsnippet

snippet ali "aligned" iAm
\begin{aligned}
$1 \\\\
\end{aligned}
endsnippet

Example

keys latex visual comment
casea>b \begin{cases}
a>b\\
a<b\\
a=b\\
\end
\(\begin{cases} a>b\\a<b\\a=b \end{cases}\)
alia&=b \begin{aligned}
a&=b\\
&=c
\end
\(\begin{aligned} a&=b\\ &=c \end{aligned}\)

== Auto Adaptive Close ==

\(\left\lceil \right\rceil \left\lfloor \right\rfloor\)

Snippet

snippet ceil "ceil" iAm
\left\lceil $1 \right\rceil $0
endsnippet

snippet floor "floor" iAm
\left\lfloor $1 \right\rfloor$0
endsnippet

Example

keys latex visual comment
ceila \left\lceil a \right\rceil $\left\lceil a \right\rceil $
floora \left\lfloor a \right\rfloor \(\left\lfloor a \right\rfloor\)

()||{}[]<> \(\left\| \right\|_{}\)

Snippet

priority 100
snippet @( "left( right)" Aim
\left( ${1} \right) $0
endsnippet

priority 100
snippet @| "left| right|" Aim
\left| ${1} \right| $0
endsnippet

priority 100
snippet @{ "left\{ right\}" Aim
\left\\{ ${1} \right\\} $0
endsnippet

priority 100
snippet set "\{ \}" Aim
\\{ ${1} \\}$0
endsnippet

priority 100
snippet @[ "left[ right]" Aim
\left[ ${1} \right] $0
endsnippet

priority 100
snippet @< "leftangle rightangle" iAm
\left<${1} \right>$0
endsnippet

priority 200
snippet norm iAm
\left\| ${1} \right\|_{$2}$3
endsnippet

Example

keys latex visual comment
@(//1<tab>2 \left( \frac{1}{2} \right) $\left( \frac{1}{2} \right) $
@\(\vert\)//1<tab>2 \left \(\vert\) \frac{1}{2} \right $\vert $ $\left \vert \frac{1}{2} \right \vert $
@{//1<tab>2 \left\\{ \frac{1}{2} \right\\} $\left{ \frac{1}{2} \right} $
set//1<tab>2 \{ \frac{1}{2} \} \(\{ \frac{1}{2} \}\)
@[//1<tab>2 \left[ \frac{1}{2} \right] $\left[ \frac{1}{2} \right] $
@<//1<tab>2 \left< \frac{1}{2} \right> \(\left<\frac{1}{2} \right>\)
norm//1<tab>2 \left\\(\vert\) \frac{1}{2} \right\\(\vert\) \(\left| \frac{1}{2} \right|_{}\)

== Snippet ==

==== General Snippet ====

====== Lite Snippet ======

tag, (x,y), (x,y,z)

Snippet

snippet tag "tag" iAm
\tag{$1}
endsnippet

snippet xyb "Auto (x, y)" iAm
(x, y)
endsnippet

snippet xyzb "Auto (x, y ,z)" iAm
(x, y, z)
endsnippet

Example

keys latex visual comment
tag1-1 \tag{1-1} $$\tag{1-1}$$

xyb (x, y) \((x, y)\)
xyzb (x, y, z) \((x, y, z)\)

\(a_{n+1}\)

Snippet

priority 100
snippet `\b([a-zA-Z])n(\d)` "x[n+1]" iAm
``rv = m[1]``_{${1:n}+``rv = m[2]``}$0
endsnippet

Example

keys latex visual comment
an1 a_{n+1} \(a_{n+1}\)
bn2 b_{n+2} \(b_{n+2}\)

Unkown

\((x_n)_{n \in N}\)

Snippet

snippet rij "mrij" iAm
(${1:x}_${2:n})_{${3:$2} \\in ${4:N}}$0
endsnippet

Example

keys latex visual comment
rij (x_n)_{n \in N} \((x_n)_{n \in N}\)

$\left\vert a \right\vert $

Snippet

priority 200
snippet abs "absolute value" iAm
\left\vert ${1} \right\vert $0
endsnippet

Example

keys latex visual comment
absa \left\vert a \right\vert $\left\vert a \right\vert $

begin.end

Snippet

snippet beg "begin{} / end{}" bA
\\begin{$1}
	$0
\\end{$1}
endsnippet

Example

keys latex visual comment

======== N Series ========

\(\alpha_1,\alpha_2,\cdots,\alpha_n\)

Snippet

priority 100
snippet comma "comma" iAm
${1:\\alpha}_1,${1:\\alpha}_2,\\cdots,${1:\\alpha}_${2:n}
endsnippet

Example

keys latex visual comment
comma \alpha_1,\alpha_2,\cdots,\alpha_n \(\alpha_1,\alpha_2,\cdots,\alpha_n\)

\(k_1\alpha_1+k_2\alpha_2+\cdots+k_n\alpha_n\)

Snippet

priority 100
snippet plus "plus" iAm
${1:k}_1${2:\\alpha}_1+${1:k}_2${2:\\alpha}_2+\\cdots+${1:k}_${3:n}${2:\\alpha}_${3:n}
endsnippet

Example

keys latex visual comment
plus k_1\alpha_1+k_2\alpha_2+\cdots+k_n\alpha_n \(k_1\alpha_1+k_2\alpha_2+\cdots+k_n\alpha_n\)

\(i=1,2,\cdots,n\)

Snippet

snippet `\b([ijk])=n` "i=1,2,\cdots,n" iAm
``rv = m[1]``=1,2,\cdots,n
endsnippet

Example

keys latex visual comment
i=n i=1,2,\cdots,n \(i=1,2,\cdots,n\)
j=n j=1,2,\cdots,n \(j=1,2,\cdots,n\)
k=n k=1,2,\cdots,n \(k=1,2,\cdots,n\)

======== Common Operator Snippet ========

$\sum_{k=0}^{\infty} c_k (x-a)^k $

Snippet

snippet taylor "taylor" iAm
\sum_{${1:k}=${2:0}}^{${3:\infty}} ${4:c_$1} (x-a)^$1 $0
endsnippet

Example

keys latex visual comment
taylor \sum_{k=0}^{\infty} c_k (x-a)^k $\sum_{k=0}^{\infty} c_k (x-a)^k $

\(\lim_{n \to \infty}\)

Snippet

snippet `(?<!\\)lim` "limit" iAm
\lim_{${1:n} \to ${2:\infty}}
endsnippet

Example

keys latex visual comment
lim \lim_{n \to \infty} \(\lim_{n \to \infty}\)

$\prod_{n=1}^{\infty} $

Snippet

snippet `(?<!\\)prod` "product" iAm
\prod_{${1:n=${2:1}}}^{${3:\infty}} ${4:${VISUAL}}$0
endisnippet

Example

keys latex visual comment
prod \prod_{n=1}^{\infty} $\prod_{n=1}^{\infty} $

\(\frac{\partial V}{\partial x}\)

Snippet

snippet `(?<!\\)part` "d/dx" iAm
\frac{\partial ${1:V}}{\partial ${2:x}}$0
endsnippet

Example

keys latex visual comment
part \frac{\partial V}{\partial x} \(\frac{\partial V}{\partial x}\)

\(\frac{\mathrm{d}y}{\mathrm{d}x}\)

Snippet

priority 300
snippet `(?<!\\)diff` "d/dx" iAm
\frac{\mathrm{d}${1:y}}{\mathrm{d}${2:x}}$0
endsnippet

Example

keys latex visual comment
diff \frac{\mathrm{d}y}{\mathrm{d}x} \(\frac{\mathrm{d}y}{\mathrm{d}x}\)

\(\mathrm{d}\)

Snippet

priority 300
snippet `dd` "dd" iAm
\mathrm{d}
endsnippet

Example

keys latex visual comment
dd \mathrm{d} \(\mathrm{d}\)

bigcup

Snippet

snippet buu "bigcup" iAm
\bigcup_{${1:i \in ${2: I}}} $0
endsnippet

Example

keys latex visual comment

bigcap

Snippet

snippet bnn "bigcap" iAm
\bigcap_{${1:i \in ${2: I}}} $0
endsnippet

Example

keys latex visual comment

\(\int_{-\infty}^{\infty} \mathrm{d}x\)

Snippet

priority 100
snippet dint "integral" iAm
\int_{${1:-\infty}}^{${2:\infty}} ${3} \\mathrm{d}${4:x}$0
endsnippet

Example

keys latex visual comment
dint \int_{-\infty}^{\infty} \mathrm{d}x \(\int_{-\infty}^{\infty} \mathrm{d}x\)

s egral

Snippet

priority 200
snippet `c(o|n)?(l|n)?(b|c)?int` "s 	egral" iAm
``
let final = "\\"; // init
let isO = m[1] == "o";
(isO) ? final += "o" : "" // o option
let b = 1;
let isL = m[2] == "l";
(m[3] == 'b') ? b = 2 : (m[3] == 'c') ? b = 3 : 1;
for (let i = 0; i < b - 1; i++) {
final += "i";
}
final += "int";
final += ((b >= 2) || (b != 1 && !isO && isL)) ? "\\limits" : "";
let r = (b == 3) ? "E" : (b == 1 && (isL || isO)) ? "C" : "R";
final += ((b >= 2) || isO || (b == 1 && isL)) ? "_{${1:" + r + "}}" : "_{${1:-\\infty}}^{${2:\\infty}}";
let x = (b == 2) ? "A" : (b == 3) ? "V" : (b == 1 && isL) ? "s" : "x";
final += " ${3} \\mathrm{d}${4:" + x + "}$0";
rv = final;
``
endsnippet

Example

keys latex visual comment

Custom: Can add more defined operator

Math function

Snippet

priority 100
snippet `(?<![\a-zA-Z])(rank|lcm|gcd|atan2|softmax|tr|trace|diag|sign|const)` "math function" iAm
\\operatorname{``rv = m[1]``}
endsnippet
keys latex visual comment
rank \operatorname{rank} \(\operatorname{rank}\)
lcm \operatorname{lcm} \(\operatorname{lcm}\)
gcd \operatorname{gcd} \(\operatorname{gcd}\)
atan2 \operatorname{atan2} \(\operatorname{atan2}\)
softmax \operatorname{softmax} \(\operatorname{softmax}\)
tr \operatorname{tr} \(\operatorname{tr}\)
diag \operatorname{diag} \(\operatorname{diag}\)
sign \operatorname{sign} \(\operatorname{sign}\)
const \operatorname{const} \(\operatorname{const}\)

====== Big Snippet ======

big function

Snippet

snippet bigdef "Big function" iAm
\begin{equation$6}
    \begin{aligned}
        $1\colon $2 &\longrightarrow $3 \\\\
                 $4 &\longmapsto $1($4) = $5
    \end{aligned}
\end{equation$6}$0
endsnippet

Example

keys: bigdefabcde
latex:

\begin{equation}
	\begin{aligned}
		a\colon b &\longrightarrow c \\
				 d &\longmapsto a(d) = e
	\end{aligned}
\end{equation}

visual:

\[\begin{equation} \begin{aligned} a\colon b &\longrightarrow c \\ d &\longmapsto a(d) = e \end{aligned} \end{equation} \]

bigmin

Snippet

snippet bigmin "Optimization problem" iAm
\begin{equation$4}
	\begin{aligned}
		\min &\quad ${1:f(x)}\\\\
		\text{s.t.} &\quad ${2:g(x)} \leq 0\\\\
					&\quad ${3:h(x)} = 0\\\\
	\end{aligned}
\end{equation$4}$0
endsnippet

Example

keys: ``
latex:

\begin{equation}
	\begin{aligned}
		\min &\quad f(x)\\
		\text{s.t.} &\quad g(x) \leq 0\\
					&\quad h(x) = 0\\
	\end{aligned}
\end{equation}

visual:

\[\begin{equation} \begin{aligned} \min &\quad f(x)\\ \text{s.t.} &\quad g(x) \leq 0\\ &\quad h(x) = 0\\ \end{aligned} \end{equation} \]

bigmax

Snippet

snippet bigmax "Optimization problem" iAm
\begin{equation$4}
	\begin{aligned}
		\max &\quad ${1:f(x)}\\\\
		\text{s.t.} &\quad ${2:g(x)} \leq 0\\\\
					&\quad ${3:h(x)} = 0\\\\
	\end{aligned}
\end{equation$4}$0
endsnippet

Example

keys: ``
latex:

\begin{equation}
	\begin{aligned}
		\max &\quad f(x)\\
		\text{s.t.} &\quad g(x) \leq 0\\
					&\quad h(x) = 0\\
	\end{aligned}
\end{equation}

visual:

\[\begin{equation} \begin{aligned} \max &\quad f(x)\\ \text{s.t.} &\quad g(x) \leq 0\\ &\quad h(x) = 0\\ \end{aligned} \end{equation} \]

Definition of function

Snippet

snippet deff "Definition of function" iAm
$1\colon ${2:\\mathbb{R\}} \to ${3:\\mathbb{R\}}, ${4:x} \mapsto $0
endsnippet

Example

keys: deff a<tab><tab><tab>b
latex: a\colon \mathbb{R} \to \mathbb{R}, x \mapsto b
visual: \(a\colon \mathbb{R} \to \mathbb{R}, x \mapsto b\)

\(\overset{\text{i.i.d.}}{\sim}\)

Snippet

snippet iid "independent and identical distribution" iAm
\overset{\text{i.i.d.}}{\sim}
endsnippet

Example

keys: iid
latex: \overset{\text{i.i.d.}}{\sim}
visual: \(\overset{\text{i.i.d.}}{\sim}\)

\(\overset{\underset{\mathrm{def}}{}}{=}\)

Snippet

snippet defe "define equal" iAm
\overset{\underset{\mathrm{def}}{}}{=}
endsnippet

Example

keys: defe
latex: \overset{\underset{\mathrm{def}}{}}{=}
visual: \(\overset{\underset{\mathrm{def}}{}}{=}\)

== Matrix ==

==== Static Matrix ====

pmat

Snippet

snippet pmat "pmat" wm
\begin{pmatrix} 
    ${1: } 
\end{pmatrix} $0
endsnippet

Example

keys: pmata,b,c
latex: \begin{pmatrix} a,b,c \end{pmatrix}
visual: $\begin{pmatrix} a,b,c \end{pmatrix} $

bmat

Snippet

snippet bmat "pmat" wm
\begin{bmatrix} 
    $1 
\end{bmatrix} $0
endsnippet

Example

keys: bmata,b,c
latex: \begin{bmatrix} a,b,c \end{bmatrix}
visual: $\begin{bmatrix} a,b,c \end{bmatrix} $

column vector

Snippet

snippet vecC "column vector" iAm
\begin{pmatrix} ${1:x}_1 \\\\ ${1:x}_2 \\\\ \vdots \\\\ ${1:x}_${2:n} \end{pmatrix}
endsnippet

Example

keys: vecC
latex: \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}
visual: \(\begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}\)

row vector

Snippet

snippet vecR "row vector" iAm
\begin{pmatrix} ${1:x}_1, ${1:x}_2, \cdots, ${1:x}_${2:n} \end{pmatrix}$0
endsnippet

Example

keys: vecR
latex: \begin{pmatrix} x_1, x_2, \cdots, x_n \end{pmatrix}
visual: \(\begin{pmatrix} x_1, x_2, \cdots, x_n \end{pmatrix}\)

lomission

Snippet

priority 300
snippet omis "omission" iAm
\\begin{pmatrix}${1:1}&${2:1}&\\cdots&${4:1}\\\\${5:1}&${6:1}&\\cdots&${8:1}\\\\\\vdots&\\vdots&\\ddots&\\vdots\\\\${13:1}&${14:1}&\\cdots&${16:1}\\end{pmatrix}
endsnippet

Example

keys: omis
latex: \begin{pmatrix}1&1&\cdots&1\\1&1&\cdots&1\\\vdots&\vdots&\ddots&\vdots\\1&1&\cdots&1\end{pmatrix}
visual: \(\begin{pmatrix}1&1&\cdots&1\\1&1&\cdots&1\\\vdots&\vdots&\ddots&\vdots\\1&1&\cdots&1\end{pmatrix}\)

omission

Snippet

priority 300
snippet submat "omission" iAm
\\begin{pmatrix}
    ${1:a}_{11} & ${1:a}_{12} & \\cdots & ${1:a}_{1n} \\\\
    ${1:a}_{21} & ${1:a}_{22} & \\cdots & ${1:a}_{2n} \\\\
    \\vdots & \\vdots & \\ddots & \\vdots \\\\
    ${1:a}_{n1} & ${1:a}_{n2} & \\cdots & ${1:a}_{nn}
\\end{pmatrix}
endsnippet

Example

keys: **latex:**
visual:

omission

Snippet

priority 300
snippet subplusmat "omission" iAm
\\begin{pmatrix}
    ${1:a}_{11}+${2:b}_{11} & ${1:a}_{12}+${2:b}_{12} & \\cdots & ${1:a}_{1n}+${2:b}_{1n} \\\\
    ${1:a}_{21}+${2:b}_{21} & ${1:a}_{22}+${2:b}_{22} & \\cdots & ${1:a}_{2n}+${2:b}_{2n} \\\\
    \\vdots & \\vdots & \\ddots & \\vdots \\\\
    ${1:a}_{n1}+${2:b}_{n1} & ${1:a}_{n2}+${2:b}_{n2} & \\cdots & ${1:a}_{nn}+${2:b}_{nn}
\\end{pmatrix}
endsnippet

Example

keys: **latex:**
visual:

jacobi

Snippet

snippet jacobi "jacobi" iAm
\\begin{pmatrix}\\frac{\\partial ${1:f}_1}{\\partial ${2:x}_1}&\\frac{\\partial ${1:f}_1}{\\partial ${2:x}_2}&\\cdots&\\frac{\\partial ${1:f}_1}{\\partial ${2:x}_${3:n}}\\\\\\frac{\\partial ${1:f}_2}{\\partial ${2:x}_1}&\\frac{\\partial ${1:f}_2}{\\partial ${2:x}_2}&\\cdots&\\frac{\\partial ${1:f}_2}{\\partial ${2:x}_${3:n}}\\\\\\vdots&\\vdots&\\ddots&\\vdots\\\\\\frac{\\partial ${1:f}_${3:m}}{\\partial ${2:x}_1}&\\frac{\\partial ${1:f}_${3:m}}{\\partial ${2:x}_2}&\\cdots&\\frac{\\partial ${1:f}_${3:m}}{\\partial ${2:x}_${3:n}}\\end{pmatrix}
endsnippet

Example

keys: jacobi
latex: \begin{pmatrix}\frac{\partial f_1}{\partial x_1}&\frac{\partial f_1}{\partial x_2}&\cdots&\frac{\partial f_1}{\partial x_n}\\\frac{\partial f_2}{\partial x_1}&\frac{\partial f_2}{\partial x_2}&\cdots&\frac{\partial f_2}{\partial x_n}\\\vdots&\vdots&\ddots&\vdots\\\frac{\partial f_n}{\partial x_1}&\frac{\partial f_n}{\partial x_2}&\cdots&\frac{\partial f_n}{\partial x_n}\end{pmatrix}
visual: \(\begin{pmatrix}\frac{\partial f_1}{\partial x_1}&\frac{\partial f_1}{\partial x_2}&\cdots&\frac{\partial f_1}{\partial x_n}\\\frac{\partial f_2}{\partial x_1}&\frac{\partial f_2}{\partial x_2}&\cdots&\frac{\partial f_2}{\partial x_n}\\\vdots&\vdots&\ddots&\vdots\\\frac{\partial f_n}{\partial x_1}&\frac{\partial f_n}{\partial x_2}&\cdots&\frac{\partial f_n}{\partial x_n}\end{pmatrix}\)

==== Dynamic Matrix ====

bmatrix

Snippet

priority 300
snippet `(b|p|v)mata([1-9])` "bmatrix" iiAm
\\begin{``rv = m[1]``matrix}``
	let len = m[2];
	let results = "";
	for (var i=0; i<len; i++){
		results += "$1 &".repeat(len-1) + " $1 \\\\\\\\";
	}
	rv = results;
``\\end{``rv = m[1]``matrix}$0
endsnippet

Example

keys: vmata3
latex: \begin{vmatrix}a &a & a \\a &a & a \\a &a & a \\\end{vmatrix}
visual: \(\begin{vmatrix}a &a & a \\a &a & a \\a &a & a \\\end{vmatrix}\)

bmatrix

Snippet

priority 300
snippet `(b|p|v)mat([1-9])` "bmatrix" iiAm
\\begin{``rv = m[1]``matrix}``
	rv = gen_matrix(m[2],m[2]);
``\\end{``rv = m[1]``matrix}$0
endsnippet

Example

keys: pmat3 a<tab>b<tab>c<tab>d<tab>e<tab>f<tab>h<tab>j<tab>
latex: \begin{pmatrix} a & b & c \\ d & e & f \\ i & j & k \\\end{pmatrix}
visual: \(\begin{pmatrix} a & b & c \\ d & e & f \\ i & j & k \\\end{pmatrix}\)

bmatrix

Snippet

priority 2000
snippet `(b|p|v)matr([1-9]{1})` "bmatrix" iiAm
\\begin{``rv = m[1]``matrix}``
	rv = gen_matrix_transposed(m[2],m[2]);
``\\end{``rv = m[1]``matrix}$0
endsnippet

Example

keys: bmatr3 a<tab>b<tab>c<tab>d<tab>e<tab>f<tab>h<tab>j<tab>
latex: \begin{bmatrix} a & d & i \\ b & e & j \\ c & f & k \\\end{bmatrix}
visual: \(\begin{bmatrix} a & d & h \\ b & e & i \\ c & f & j \\\end{bmatrix}\)

col vector

Snippet

priority 300
snippet `vec([1-9])` "col vector" iiAm
\\begin{pmatrix}``
    rv = gen_matrix(m[1], 1);
``\\end{pmatrix}$0
endsnippet

Example

keys: vec3 a<tab>b<tab>c
latex: \begin{pmatrix} a \\ b \\ c \\\end{pmatrix}
visual: \(\begin{pmatrix} a \\ b \\ c \\\end{pmatrix}\)

row vector

Snippet

priority 300
snippet `vecr([1-9])` "row vector" iiAm
\\begin{pmatrix}``
    rv = gen_matrix(1, m[1]);
``\\end{pmatrix}$0
endsnippet

Example

keys: vecr3 a<tab>b<tab>c
latex: \begin{pmatrix} a & b & c \\\end{pmatrix}
visual: \(\begin{pmatrix} a & b & c \\\end{pmatrix}\)

== General ==

Box

Snippet

snippet \box "Box" 
``rv = '┌' + '─'.repeat(t[0].length + 2) + '┐'``
│ $1 │
``rv = '└' + '─'.repeat(t[0].length + 2) + '┘'``
endsnippet

Example

keys: \box
latex: ``
visual:
┌───────┐
│ abcde │
└───────┘

create table with rows and columns

Snippet

priority 300
snippet `table(\d)(\d)` "create table with rows and columns" wA
``
rv = createTable(m[1], m[2]);
``
endsnippet

Example

keys: **latex:**
visual:

posted @ 2023-04-08 21:41  清哥他弟  阅读(93)  评论(0编辑  收藏  举报