UltiSnips/PySnippets/tex.snippets

152 lines
2.7 KiB
Plaintext
Raw Normal View History

2009-07-06 05:35:53 -04:00
###########################################################################
# LATEX SNIPPETS #
###########################################################################
2009-07-06 16:00:21 -04:00
snippet r "\ref{}"
\ref{$1}
endsnippet
###########################################################################
# TEXTMATE SNIPPETS #
###########################################################################
####################
# TABULARS, ARRAYS #
####################
snippet tab
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
endsnippet
########################
# ENUM, DESCR, ITEMIZE #
########################
snippet enum
\begin{enumerate}
\item $0
\end{enumerate}
endsnippet
snippet item
\begin{itemize}
\item $0
\end{enumerate}
endsnippet
snippet desc
\begin{description}
\item[$1] $0
\end{description}
endsnippet
##############
# MATH STUFF #
##############
snippet eq "Equation"
\begin{equation}
$0
\end{equation}
endsnippet
snippet eqnn "Equation without number"
\begin{equation*}
$0
\end{equation*}
endsnippet
snippet eqa "Equation array"
\begin{eqnarray}
$1 & $2 & $0
\end{eqnarray}
endsnippet
snippet eqann "Equation array without numbers"
\begin{eqnarray*}
$1 & $2 & $0
\end{eqnarray*}
endsnippet
snippet frac
\frac{${1:nom}}{${2:denom}}
endsnippet
snippet mat
\begin{${1:p/b/v/V/B/small}matrix}
$0
\end{$1matrix}
endsnippet
2009-07-06 16:00:21 -04:00
#####################################
# SECTIONS, CHAPTERS AND THERE LIKE #
#####################################
snippet part
\part{${1:part name}}
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/g}}}
${0}
% part $2 (end)
endsnippet
snippet cha
\chapter{${1:chapter name}}
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% chapter $2 (end)
endsnippet
2009-07-06 05:35:53 -04:00
snippet sec
\section{${1:section name}}
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
2009-07-06 05:35:53 -04:00
${0}
% section $2 (end)
2009-07-06 05:35:53 -04:00
endsnippet
2009-07-06 16:00:21 -04:00
snippet sub
\subsection{${1:subsection name}}
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% subsection $2 (end)
endsnippet
snippet ssub
\subsubsection{${1:subsubsection name}}
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% subsubsection $2 (end)
endsnippet
snippet par
\paragraph{${1:paragraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% paragraph $2 (end)
endsnippet
snippet subp
\subparagraph{${1:subparagraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% subparagraph $2 (end)
endsnippet