dotfiles/vim/UltiSnips/tex/global.snippets

73 lines
1.3 KiB
Plaintext
Raw Normal View History

# vim:sts=2:sw=2
snippet use "Usepackage" b
\usepackage{${1:${VISUAL:babel}}}$0
endsnippet
snippet useo "Usepackage with option" b
\usepackage[${2:italian}]{${1:${VISUAL:babel}}}$0
endsnippet
snippet italian "Use italian hyphenations with polyglossia" b
\usepackage{polyglossia}
\setdefaultlanguage{italian}
$0
endsnippet
snippet othlang "Insert an environment with another language" b
\begin{lang}{${1:english}}
$0
\end{lang}
endsnippet
snippet env "Environment from input" b
\begin{${1:${VISUAL:center}}}
$0
\end{$1}
endsnippet
snippet it "Italics (LaTeX macro)"
\textit{${1:${VISUAL}}}$0
endsnippet
snippet +it "Insert an item in an environment" b
\item ${1:${VISUAL}}
$0
endsnippet
snippet bf "Bold (LaTeX macro)"
\textbf{${1:${VISUAL}}} $0
endsnippet
snippet sl "Slanted (LaTeX macro)"
\textsl{${1:${VISUAL}}} $0
endsnippet
snippet sc "Small Caps (LaTeX macro)"
\textsc{${1:${VISUAL}}} $0
endsnippet
snippet em "Emphasize (LaTeX macro)"
\emph{${1:${VISUAL}}} $0
endsnippet
snippet al "Alert text"
\alert{${1:${VISUAL}}}<${2:overlay}> $0
endsnippet
snippet ebl "Beamer Block Environment" b
\begin{block}{${2:titolo}}<$3>
${1:${VISUAL}}
\end{block}
$0
endsnippet
global !p
def math():
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
endglobal
context "math()"
snippet ff "\frac macro."
\frac{$1}{$2}$0
endsnippet