Merge pull request #80 from epsilonhalbe/patch-1

LaTeX snippets
This commit is contained in:
Honza Pokorny 2012-02-19 17:56:14 -08:00
commit 84826018eb

View File

@ -1,4 +1,20 @@
# recomendation: change the fold marker from {{{,}}} to (fold),(end) ; tex uses "{" and "}" a lot
#PREAMBLE
#newcommand
snippet nc
\newcommand{\${1:cmd}}[${2:opt}]{${3:realcmd}}${4}
#usepackage
snippet up
\usepackage[${1:[options}]{${2:package}}
#newunicodechar
snippet nuc
\newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}}
#DeclareMathOperator
snippet dmo
\DeclareMathOperator{${1}}{${2}}
#DOCUMENT
# \begin{}...\end{}
snippet begin
\begin{${1:env}}
@ -9,6 +25,10 @@ snippet tab
\begin{${1:tabular}}{${2:c}}
${3}
\end{$1}
snippet thm
\begin[${1:author}]{${2:thm}}
${3}
\end{$1}
snippet center
\begin{center}
${1}
@ -44,7 +64,7 @@ snippet enum
\item ${1}
\end{enumerate}
# Itemize
snippet item
snippet itemize
\begin{itemize}
\item ${1}
\end{itemize}
@ -124,6 +144,11 @@ snippet section
${1:Section}~\ref{${2:sec:}}${3}
snippet page
${1:page}~\pageref{${2}}${3}
snippet index
\index{${1:index}}${2}
#cite
snippet cite
\cite{${1}}${2}
#Formating text: italic, bold, underline, small capital, emphase ..
snippet it
\textit{${1:text}}
@ -153,11 +178,20 @@ snippet fig
\caption{${3}}
\label{fig:${4}}
\end{figure}
snippet tikz
\begin{figure}
\begin{center}
\begin{tikzpicture}[scale=${1:1}]
${2}
\end{tikzpicture}
\end{center}
\caption{${3}}
\label{fig:${4}}
\end{figure}
#math
snippet stackrel
\stackrel{${1:above}}{${2:below}} ${3}
snippet frac
\frac{${1}}{${2}}
\frac{${1:num}}{${2:denom}}
snippet sum
\sum^{${1:n}}_{${2:i=1}}{${3}}
#cite
snippet cite
\cite{${1}}