diff options
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/my_snippets/tex.snippets | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/.config/nvim/my_snippets/tex.snippets b/.config/nvim/my_snippets/tex.snippets index f81ad94..727253f 100644 --- a/.config/nvim/my_snippets/tex.snippets +++ b/.config/nvim/my_snippets/tex.snippets | |||
@@ -21,12 +21,6 @@ snippet template "Basic template" b | |||
21 | \pdfminorversion=7 | 21 | \pdfminorversion=7 |
22 | \usepackage{pdfpages} | 22 | \usepackage{pdfpages} |
23 | \usepackage{transparent} | 23 | \usepackage{transparent} |
24 | \newcommand{\incfig}[1]{% | ||
25 | \def\svgwidth{\columnwidth} | ||
26 | \import{./figures/}{#1.pdf_tex} | ||
27 | } | ||
28 | |||
29 | \pdfsuppresswarningpagegroup=1 | ||
30 | 24 | ||
31 | \begin{document} | 25 | \begin{document} |
32 | $0 | 26 | $0 |
@@ -120,3 +114,59 @@ context "math()" | |||
120 | snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA | 114 | snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA |
121 | \\frac{`!p snip.rv = match.group(1)`}{$1}$0 | 115 | \\frac{`!p snip.rv = match.group(1)`}{$1}$0 |
122 | endsnippet | 116 | endsnippet |
117 | |||
118 | snippet sec "Section" | ||
119 | \section{${1:${VISUAL:section name}}}% | ||
120 | \label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
121 | |||
122 | $0 | ||
123 | endsnippet | ||
124 | |||
125 | snippet sec* "Section" | ||
126 | \section*{${1:${VISUAL:section name}}}% | ||
127 | \label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
128 | |||
129 | ${0} | ||
130 | endsnippet | ||
131 | |||
132 | |||
133 | snippet sub "Subsection" | ||
134 | \subsection{${1:${VISUAL:subsection name}}}% | ||
135 | \label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
136 | |||
137 | $0 | ||
138 | endsnippet | ||
139 | |||
140 | snippet sub* "Subsection" | ||
141 | \subsection*{${1:${VISUAL:subsection name}}}% | ||
142 | \label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
143 | |||
144 | ${0} | ||
145 | endsnippet | ||
146 | |||
147 | snippet ssub "Subsubsection" | ||
148 | \subsubsection{${1:${VISUAL:subsubsection name}}}% | ||
149 | \label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
150 | |||
151 | $0 | ||
152 | endsnippet | ||
153 | |||
154 | snippet ssub* "Subsubsection" | ||
155 | \subsubsection*{${1:${VISUAL:subsubsection name}}}% | ||
156 | \label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
157 | |||
158 | ${0} | ||
159 | endsnippet | ||
160 | |||
161 | snippet "mint(ed)?( (\S+))?" "Minted code typeset" br | ||
162 | \begin{listing} | ||
163 | \begin{minted}[linenos,numbersep=5pt,frame=lines,framesep=2mm]{${1:`!p | ||
164 | snip.rv = match.group(3) if match.group(2) is not None else "language"`}} | ||
165 | ${2:${VISUAL:code}} | ||
166 | \end{minted} | ||
167 | \caption{${3:caption name}} | ||
168 | \label{lst:${4:${3/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
169 | \end{listing} | ||
170 | |||
171 | $0 | ||
172 | endsnippet | ||