Merge pull request #352 from feju/master

Various new snippets and fixes
This commit is contained in:
Honza Pokorny 2014-04-30 05:58:14 -03:00
commit 995ab73c95
3 changed files with 22 additions and 15 deletions

View File

@ -88,7 +88,7 @@ lapply(${1:list}, ${0:function})
endsnippet endsnippet
snippet sapply "sapply function" snippet sapply "sapply function"
lapply(${1:list}, ${0:function}) sapply(${1:list}, ${0:function})
endsnippet endsnippet
snippet vapply "vapply function" snippet vapply "vapply function"

View File

@ -35,7 +35,7 @@ for (${1:item} in ${2:list}) {
# functions # functions
snippet fun snippet fun
${1:name} = function (${2:variables}) { ${1:name} <- function (${2:variables}) {
${0} ${0}
} }
snippet ret snippet ret
@ -49,7 +49,7 @@ snippet c
snippet li snippet li
list(${0:items}) list(${0:items})
snippet mat snippet mat
matrix(${1:data}, nrow=${2:rows}, ncol=${0:cols}) matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
# apply functions # apply functions
snippet apply snippet apply
@ -110,7 +110,7 @@ snippet pl
snippet ggp snippet ggp
ggplot(${1:data}, aes(${0:aesthetics})) ggplot(${1:data}, aes(${0:aesthetics}))
snippet img snippet img
${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}") ${1:(jpeg,bmp,png,tiff)}(filename = '${2:filename}', width = ${3}, height = ${4}, unit = '${5}')
${0:plot} ${0:plot}
dev.off() dev.off()

View File

@ -21,11 +21,11 @@ snippet begin
# Tabular # Tabular
snippet tab snippet tab
\begin{${1:tabular}}{${2:c}} \begin{${1:tabular}}{${2:c}}
${0} ${0}
\end{$1} \end{$1}
snippet thm snippet thm
\begin[${1:author}]{${2:thm}} \begin[${1:author}]{${2:thm}}
${0} ${0}
\end{$2} \end{$2}
snippet center snippet center
\begin{center} \begin{center}
@ -34,6 +34,7 @@ snippet center
# Align(ed) # Align(ed)
snippet ali snippet ali
\begin{align${1:ed}} \begin{align${1:ed}}
\label{eq:${2}}
${0} ${0}
\end{align$1} \end{align$1}
# Gather(ed) # Gather(ed)
@ -44,6 +45,7 @@ snippet gat
# Equation # Equation
snippet eq snippet eq
\begin{equation} \begin{equation}
\label{eq:${2}}
${0} ${0}
\end{equation} \end{equation}
# Equation # Equation
@ -61,6 +63,9 @@ snippet eqnarray
\begin{eqnarray} \begin{eqnarray}
${0} ${0}
\end{eqnarray} \end{eqnarray}
# Label
snippet lab
\label{${1:eq:}${2:fig:}${3:tab:}${0}}
# Enumerate # Enumerate
snippet enum snippet enum
\begin{enumerate} \begin{enumerate}
@ -81,7 +86,7 @@ snippet desc
# Endless new item # Endless new item
snippet ]i snippet ]i
\item ${1} \item ${1}
${0:]i} ${0:]i}
# Matrix # Matrix
snippet mat snippet mat
\begin{${1:p/b/v/V/B/small}matrix} \begin{${1:p/b/v/V/B/small}matrix}
@ -169,14 +174,18 @@ snippet index
\index{${1:index}} ${0} \index{${1:index}} ${0}
#Citations #Citations
snippet citen snippet citen
\cite{$1} ${0} \citen{${1}} ${0}
# bibtex commands # natbib citations
snippet citep snippet citep
\citep{$1} ${0} \citep{${1}} ${0}
snippet citet snippet citet
\citet{$1} ${0} \citet{${1}} ${0}
snippet cite snippet cite
\cite[${1}]{${2}} ${0} \cite[${1}]{${2}} ${0}
snippet citea
\citeauthor{${1}} ${0}
snippet citey
\citeyear{${1}} ${0}
snippet fcite snippet fcite
\footcite[${1}]{${2}}${0} \footcite[${1}]{${2}}${0}
#Formating text: italic, bold, underline, small capital, emphase .. #Formating text: italic, bold, underline, small capital, emphase ..
@ -203,7 +212,7 @@ snippet ft
snippet fig snippet fig
\begin{figure} \begin{figure}
\begin{center} \begin{center}
\includegraphics[scale=${1}]{Figures/${2}} \includegraphics[scale=${1}]{Figures/${2}}
\end{center} \end{center}
\caption{${3}} \caption{${3}}
\label{fig:${4}} \label{fig:${4}}
@ -230,9 +239,7 @@ snippet sum
snippet lim snippet lim
\lim_{${1:x \to +\infty}} ${0} \lim_{${1:x \to +\infty}} ${0}
snippet frame snippet frame
\begin{frame}[<+->] \begin{frame}[${1:t}]{${2:title}}
\frametitle{${1:title}}
${0} ${0}
\end{frame} \end{frame}
snippet block snippet block