Merge pull request #131 from slagtermaarten/master

Tex: Added figure, item, Non-indented paragraph and Long parenthesis. Also cleaned up the snippets file.
This commit is contained in:
Holger Rapp 2014-01-26 21:29:12 -08:00
commit 0d37b48feb
2 changed files with 19 additions and 47 deletions

View File

@ -1,39 +1,26 @@
extends texmath extends texmath
###########################################################################
# LATEX SNIPPETS #
###########################################################################
snippet r "\\ref{}" w
\ref{$1}
endsnippet
###########################################################################
# TEXTMATE SNIPPETS #
###########################################################################
#################
# GENERAL STUFF #
#################
snippet "b(egin)?" "begin{} / end{}" br snippet "b(egin)?" "begin{} / end{}" br
\begin{${1:something}} \begin{${1:something}}
${0:${VISUAL}} ${0:${VISUAL}}
\end{$1} \end{$1}
endsnippet endsnippet
####################
# TABULARS, ARRAYS #
####################
snippet tab snippet tab
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}} \begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
$0${2/((?<=.)c|l|r)|./(?1: & )/g} $0${2/((?<=.)c|l|r)|./(?1: & )/g}
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}} \end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
endsnippet endsnippet
######################## snippet fig "Figure environment" b
# ENUM, DESCR, ITEMIZE # \begin{figure}${2:[htpb]}
######################## \centering
\includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
\caption{${4/(\w+)\.\w+/\u$1/}$0}
\label{fig:${4/(\w+)\.\w+/$1/}}
\end{figure}
endsnippet
snippet enum "Enumerate" b snippet enum "Enumerate" b
\begin{enumerate} \begin{enumerate}
\item $0 \item $0
@ -52,17 +39,16 @@ snippet desc "Description" b
\end{description} \end{description}
endsnippet endsnippet
##################################### snippet it "Individual item" b
# SECTIONS, CHAPTERS AND THEIR LIKE # \item ${1}
##################################### $0
endsnippet
snippet part "Part" b snippet part "Part" b
\part{${1:part name}} \part{${1:part name}}
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}} \label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}}
${0} ${0}
% part $2 (end)
endsnippet endsnippet
snippet cha "Chapter" b snippet cha "Chapter" b
@ -70,8 +56,6 @@ snippet cha "Chapter" b
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} \label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0} ${0}
% chapter $2 (end)
endsnippet endsnippet
snippet sec "Section" b snippet sec "Section" b
@ -79,18 +63,13 @@ snippet sec "Section" b
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} \label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0} ${0}
% section $2 (end)
endsnippet endsnippet
snippet sub "Subsection" b snippet sub "Subsection" b
\subsection{${1:subsection name}} \subsection{${1:subsection name}}
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} \label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0} ${0}
% subsection $2 (end)
endsnippet endsnippet
snippet ssub "Subsubsection" b snippet ssub "Subsubsection" b
@ -98,9 +77,6 @@ snippet ssub "Subsubsection" b
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} \label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0} ${0}
% subsubsection $2 (end)
endsnippet endsnippet
snippet par "Paragraph" b snippet par "Paragraph" b
@ -108,30 +84,25 @@ snippet par "Paragraph" b
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} \label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0} ${0}
% paragraph $2 (end)
endsnippet endsnippet
snippet subp "Subparagraph" b snippet subp "Subparagraph" b
\subparagraph{${1:subparagraph name}} \subparagraph{${1:subparagraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} \label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0} ${0}
% subparagraph $2 (end)
endsnippet endsnippet
############### snippet ni "Non-indented paragraph" b
# Utilities # \noindent
############### ${0}
endsnippet
snippet pac "Package" b snippet pac "Package" b
\usepackage[${1:options}]{${2:package}}$0 \usepackage[${1:options}]{${2:package}}$0
endsnippet endsnippet
snippet lp "Long parenthesis"
snippet lp "Long parenthesis"
\left(${1:${VISUAL:contents}}\right)$0 \left(${1:${VISUAL:contents}}\right)$0
endsnippet endsnippet
# vim:ft=snippets: # vim:ft=snippets:

View File

@ -1450,6 +1450,7 @@ Contributors listed in chronological order:
Bernhard Vallant (lazerscience) Bernhard Vallant (lazerscience)
Von Welch (von) Von Welch (von)
Nikola Petrov (nikolavp) Nikola Petrov (nikolavp)
Maarten Slagter (slagtermaarten)
Thank you for your support. Thank you for your support.