1
Fork 0
satellite/home/features/neovim/config/lua/my/snippets/tex.miros

104 lines
2 KiB
Plaintext
Raw Normal View History

for thmenv <- @{theorem,lemma,exercise,definition,corollary,example}
for thmprefix <- @{@thmenv:thm,lem,exe,def,cor,exa}
block auto !math start
for env <- @{$1,enumerate,itemize,align*}
string @{@env:begin,olist,ulist,dm}
name @{@env:environment,ordered list,unordered list,display math}
snip
\begin{@env}
$0
\end{@env}
end
string @thmprefix
snip
\begin{@thmenv}$?1{[@^{$1}]} \label{@thmprefix:$2}
$0
\end{@thmenv}
end
string proof
snip
\begin{proof}$?1{[Proof of @^{$1}]}
$0
\end{proof}
end
string ciff
name cases for ⟺
snip
\begin{enumerate}
\item[$\implies$]$1,
\item[$\impliedby$]$2,
\end{enumerate}
$0
end
string item
snip \item$|1{,[$1] $0}
block auto !math
string ref
snip \ref{$1}$0
string r@thmprefix
snip \ref{@thmprefix:$1}$0
string pref
snip (\ref{$1})$0
string pr@thmprefix
snip (\ref{@thmprefix:$1})$0
string quote
snip ``$1''$0
string forcecr
snip {\ \\\\}
pattern ([Ll]et)
name definition
snip @1 \$$1 = $2\$
string im
name inline math
snip \$$1\$$0
block math end
for suffix <- @{add,sub,rmul,pow,inv}
string ex@suffix
snip
&& \lrb{\square @{@suffix:
+ $1,
- $1,
\cdot $1,
^{$1\},
^{-1\},
}}$0
end
for prefix <- @{neg,mul,ln}
string ex@prefix
snip && \lrb{@{@prefix:-,$1,\ln} \square}$0
string exdiv
snip && \lrb{\frac \square {$1}}$0
string exint
snip && \lrb{\int\square \dif $1}$0
string exdint
snip && \lrb{\int_{$1}^{$2}\square \dif $3}$0
for kind <- @{texpl,extrin,exbound,exdef}
string @kind
snip
&& \lrb{\text{@{kind:
$1,
triangle inequality on \$$1\$,
\$$1\$ is bounded,
definition of \$$1\$,
}}}$0
end
for operator <- {overline,hat,abs,norm}
string @operator
snip \\@operator $|1{ $1,{$1\}$0}