-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtex.snippets
74 lines (58 loc) · 1.43 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
snippet newdocument "\documentclass ..." b
\documentclass[a4paper,10pt]{report}
% ...
\begin{document}
\tableofcontents
% \listoffigures
% \listoftables
% \chapter{Introduction}
% \label{introduction}
\end{document}
endsnippet
snippet document "\documentclass ..." b
\documentclass[00-Title.tex]{subfiles}
\begin{document}
\chapter{$1}
\label{$2}
% ...
\end{document}
endsnippet
snippet "begin( (\S+))?" "begin{...} ... end{...}" br
\begin{${1:`!p
snip.rv = match.group(2) if match.group(1) is not None else "something"`}}
${2:${VISUAL}}
\end{$1}$0
endsnippet
snippet figure "\begin{figure} ... \end{figure}" b
\begin{figure}[ht]
\centering
${1:\includegraphics[width=\linewidth]{$2}}
\caption{$3}
\label{figure:$4}
\end{figure}
endsnippet
snippet subfigure "\begin{figure} \begin{subfigure} ... \end{subfigure} \end{figure}" b
\begin{figure}[ht]
\begin{subfigure}{.495\linewidth}
\includegraphics[width=\linewidth]{$1}
\caption{$2}
\label{figure:a:$3}
\end{subfigure}%
\hfill%
\begin{subfigure}{.495\linewidth}
\includegraphics[width=\linewidth]{$4}
\caption{$5}
\label{figure:b:$3}
\end{subfigure}
\caption{$6}
\label{figure:$3}
\end{figure}
endsnippet
snippet tabularx "\begin{tabularx}{...}{...} ... \end{tabularx}" b
\begin{tabularx}{${1:\linewidth}}{${2:lX}}
${3:\textbf{${4:something}}: & ${5:something}}
\end{tabularx}
endsnippet
snippet row "\textbf{...}: & ..."
\textbf{${1:something}}: & ${2:something}
endsnippet