-
Notifications
You must be signed in to change notification settings - Fork 0
/
tex.snippets
125 lines (90 loc) · 2.51 KB
/
tex.snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
extends texmath
###########################################################################
# LATEX SNIPPETS #
###########################################################################
snippet r "\ref{}" w
\ref{$1}
endsnippet
###########################################################################
# TEXTMATE SNIPPETS #
###########################################################################
#################
# GENERAL STUFF #
#################
snippet "b(egin)?" "begin{} / end{}" br
\begin{${1:something}}
$0
\end{$1}
endsnippet
####################
# 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 "Enumerate" b
\begin{enumerate}
\item $0
\end{enumerate}
endsnippet
snippet item "Itemize" b
\begin{itemize}
\item $0
\end{itemize}
endsnippet
snippet desc "Description" b
\begin{description}
\item[$1] $0
\end{description}
endsnippet
#####################################
# SECTIONS, CHAPTERS AND THERE LIKE #
#####################################
snippet part "Part" b
\part{${1:part name}}
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/g}}}
${0}
% part $2 (end)
endsnippet
snippet cha "Chapter" b
\chapter{${1:chapter name}}
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% chapter $2 (end)
endsnippet
snippet sec "Section" b
\section{${1:section name}}
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% section $2 (end)
endsnippet
snippet sub "Subsection" b
\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" b
\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" b
\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" b
\subparagraph{${1:subparagraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}}
${0}
% subparagraph $2 (end)
endsnippet
# vim:ft=snippets: