Skip to content

Commit

Permalink
Changing LaTeX snippets to be more like my TextMate LaTeX snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
lianos committed Jul 30, 2012
1 parent 6432778 commit 59e8a40
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
5 changes: 2 additions & 3 deletions my/yasnippets/latex-mode/cha.yasnippet
@@ -1,9 +1,8 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# contributor : Steve Lianoglou <slianoglouk@gmail.com>
# key : cha
# group: sections
# name : \chapter
# --
\chapter{${1:name}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\label{cha:${2:${1:$(replace-regexp-in-string "[^[:alnum:]]" "_" yas/text)}}}
8 changes: 4 additions & 4 deletions my/yasnippets/latex-mode/fig.yasnippet
Expand Up @@ -4,9 +4,9 @@
# group: environments
# name : \begin{figure} ... \end{figure}
# --
\begin{figure}[htbp]
\begin{figure}[${1:htbp}]
\centering
$0
\caption{${1:caption}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
\includegraphics[${2:sclale=${3:1}}]{${4:file}}
\caption{${5:caption}}
\label{fig:${6:label}}
\end{figure}
9 changes: 5 additions & 4 deletions my/yasnippets/latex-mode/sec.yasnippet
@@ -1,9 +1,10 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# contributor : Steve Lianoglou <slianoglou@gmail.com>
# key : sec
# group: sections
# name : \section
# --
\section{${1:name}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ${1:section name}
\section{$1}
\label{sec:${2:${1:$(replace-regexp-in-string "[^[:alnum:]]" "_" yas/text)}}}
9 changes: 5 additions & 4 deletions my/yasnippets/latex-mode/ssub.yasnippet
@@ -1,9 +1,10 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# contributor : Steve Lianoglou <slianoglou@gmail.com>
# key: ssub
# group: sections
# name : \subsubsection
# --
\subsubsection{${1:name}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
%% -----------------------------------------------------------------------------
%% ${1:subsubsection name}
\subsubsection{$1}
\label{ssub:${2:${1:$(replace-regexp-in-string "[^[:alnum:]]" "_" yas/text)}}}
9 changes: 5 additions & 4 deletions my/yasnippets/latex-mode/sub.yasnippet
@@ -1,9 +1,10 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# contributor : Steve Lianoglou <slianoglou@gmail.com>
# key: sub
# group: sections
# name : \subsection
# --
\subsection{${1:name}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
%% -----------------------------------------------------------------------------
%% ${1:subsection name}
\subsection{$1}
\label{sub:${2:${1:$(replace-regexp-in-string "[^[:alnum:]]" "_" yas/text)}}}

0 comments on commit 59e8a40

Please sign in to comment.