[emacs] Add snippets for latex mode.

This commit is contained in:
Mikaël Capelle 2019-08-19 15:13:14 +00:00
parent c461099b60
commit 20385bf1f9
60 changed files with 544 additions and 0 deletions

View File

@ -0,0 +1 @@
text-mode

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : abs
# group: sections
# name : \abstract
# --
\begin{abstract}
$0
\end{abstract}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key : align
# group: environments
# name : \begin{align} ... \end{align}
# --
\begin{align}
$0
\end{align}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key : align*
# group: environments
# name : \begin{align*} ... \end{align*}
# --
\begin{align*}
$0
\end{align*}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Peter Urbak <peter@dragonwasrobot.com>
# key : arr
# group: environments
# name : \begin{array} ... \end{array}
# --
\begin{array}{$1}
$0
\end{array}

View File

@ -0,0 +1,28 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# contributor : Song Qiang <tsiangsung@gmail.com>
# key: article
# group: skeleton
# name: \documentclass{article} ...
# --
\documentclass[11pt]{article}
\usepackage{graphicx,amsmath,amssymb,subfigure,url,xspace}
\newcommand{\eg}{e.g.,\xspace}
\newcommand{\bigeg}{E.g.,\xspace}
\newcommand{\etal}{\textit{et~al.\xspace}}
\newcommand{\etc}{etc.\@\xspace}
\newcommand{\ie}{i.e.,\xspace}
\newcommand{\bigie}{I.e.,\xspace}
\title{${1:title}}
\author{${2:Author Name}}
\begin{document}
\maketitle
\bibliographystyle{${3:plain}}
\bibliography{${4:literature.bib}}
\end{document}

View File

@ -0,0 +1,37 @@
# -*- mode: snippet -*-
# contributor: Claudio Marforio <marforio@gmail.com>
# key: beamer
# group: skeleton
# name: \documentclass{beamer} ...
# --
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{graphicx,subfigure,url}
% example themes
\usetheme{Frankfurt}
\usecolortheme{seahorse}
\usecolortheme{rose}
% put page numbers
% \setbeamertemplate{footline}[frame number]{}
% remove navigation symbols
% \setbeamertemplate{navigation symbols}{}
\title{${1:Presentation Title}}
\author{${2:Author Name}}
\begin{document}
\frame[plain]{\titlepage}
\begin{frame}[plain]{Outline}
\tableofcontents
\end{frame}
\section{${3:Example Section}}
\begin{frame}{${4:Frame Title}}
\end{frame}
\end{document}

View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# contributor : Bjorn Reese <breese@users.sourceforge.net>
# key: begin
# group: environments
# name: \begin{environment} ... \end{environment}
# --
\begin{${1:$$(yas/choose-value (mapcar 'car (LaTeX-environment-list)))}}
$0
\end{$1}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: bib
# group: misc
# name: \bibliography
# --
\bibliographystyle{plain}
\bibliography{$1}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: big
# group: math
# name: \bigl( ... \bigr)
# --
\\${1:$$(yas/choose-value '("big" "Big" "bigg" "Bigg"))}l( $0 \\$1r)

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: François Garillot <francois@garillot.net>
# key: bigop
# group: math
# name: \bigop_{n}^{}
# --
\\big${1:$$(yas/choose-value '("oplus" "otimes" "odot" "cup" "cap" "uplus" "sqcup" "vee" "wedge"))}_{$2}^{$3}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: binom
# group: math
# name: \binom{n}{k}
# --
\binom{${1:n}}{${2:k}}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor: Claudio Marforio <marforio@gmail.com>
# key: block
# group: environments
# name : \begin{*block} ... \end{*block}
# --
\begin{${1:$$(yas/choose-value '("block" "exampleblock" "alertblock"))}}{${2:Block Title}}
\end{$1}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Márcio M. Ribeiro <marcio.mr@gmail.com>
# key: bf
# group: font
# name: {\bf ... }
# --
{\bf $1}$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: case
# group: math
# name: \begin{cases} ... \end{cases}
# --
\begin{cases}
$0 \\\\
\end{cases}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@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

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : cha*
# group: sections
# name : \chapter*
# --
\chapter*{${1:name}}
$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor : Marcio M. Ribeiro <marcio.mr@gmail.com>
# key: cite
# group: references
# name : \cite
# --
\cite{${1:label$(unless yas/modified-p (car (reftex-citation 't)))}}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: François Garillot <francois@garillot.net>
# key: coprod
# group: math
# name: \coprod_{n}^{}
# --
\coprod_{$1}^{$2}$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : desc
# group: environments
# name : \begin{description} ... \end{description}
# --
\begin{description}
\item[${1:label}] $0
\end{description}

View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: doc
# name: \documentclass
# --
\documentclass[$2]{${1:$$(yas/choose-value '("article" "report" "book" "letter"))}}
\begin{document}
$0
\end{document}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Márcio M. Ribeiro <marcio.mr@gmail.com>
# key: em
# group: font
# name: {\em ...}
# --
{\em $1}$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: enum
# group: environments
# name : \begin{enumerate} ... \end{enumerate}
# --
\begin{enumerate}
\item $0
\end{enumerate}

View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: eq
# group: math
# name: \begin{equation} ... \end{equation}
# --
\begin{equation}
\label{${1:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\end{equation}

View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: eqs
# group: math
# name: \begin{align} ... \end{align}
# --
\begin{${1:$$(yas/choose-value '("align" "align*" "multline" "gather" "subequations"))}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\end{$1}

View File

@ -0,0 +1,12 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : fig
# group: environments
# name : \begin{figure} ... \end{figure}
# --
\begin{figure}[htbp]
\centering
$0
\caption{${1:caption}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
\end{figure}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: frac
# group: math
# name: \frac{numerator}{denominator}
# --
\frac{${1:numerator}}{${2:denominator}}$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor: Claudio Marforio <marforio@gmail.com>
# key: frame
# group: environments
# name : \begin{frame} ... \end{frame}
# --
\begin{frame}{${1:Frame Title}}
\end{frame}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor : Peter Urbak <peter@dragonwasrobot.com>
# key : newgls
# group: misc
# name : \newglossaryentry{...}{...}
# --
\newglossaryentry{$1}{name={$1},
description={$2.}}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : graphics
# name : \includegraphics
# --
\includegraphics[width=${1:\linewidth}]{${2:file}}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# key: href
# group: environments
# name: \href{url}{text}
# --
\href{${1:url}}{${2:text}}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: int
# group: math
# name: \int_{n}^{}
# --
\\${1:$$(yas/choose-value '("int" "oint" "iint" "iiint" "iiiint" "idotsint"))}{$2}^{$3}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: it
# group: environments
# name: \item
# --
\item $0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key: itd
# group: environments
# name: \item[] (description)
# --
\item[${1:label}] $0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : item
# group: environments
# name : \begin{itemize} ... \end{itemize}
# --
\begin{itemize}
\item $0
\end{itemize}

View File

@ -0,0 +1,7 @@
-*- mode: snippet -*-
# contributor : Márcio M. Ribeiro <marcio.mr@gmail.com>
# key: lab
# group: references
# name : \label
# --
\label{${1:label$(unless yas/modified-p (reftex-label nil 'dont-insert))}}$0

View File

@ -0,0 +1,27 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# contributor : Song Qiang <tsiangsung@gmail.com>
# key: letter
# group: skeleton
# name: \documentclass{letter} ...
# --
\documentclass{letter}
\signature{${1:Foo Bar}}
\address{${2:Address line 1 \\\\
Address line 2 \\\\
Address line 3}}
\begin{document}
\begin{letter}
{${3:Recipient's address}}
\opening{Dear ${4:Sir}:}
$0
\closing{Yours Sincerely,}
\end{letter}
\end{document}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: François Garillot <francois@garillot.net>
# key: lim
# group: math
# name: \lim_{n}
# --
\lim_{$1}$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: math
# group: math
# name: displaymath \[ ... \]
# --
\[
$1
\]

View File

@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: matrix
# group: math
# name: \begin{matrix} ... \end{}
# --
\begin{${1:$$(yas/choose-value '("pmatrix" "bmatrix" "Bmatrix" "vmatrix" "Vmatrix" "smallmatrix"))}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\end{$1}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: minipage
# group: environments
# name: \begin{minipage}[position][width] ... \end{minipage}
# --
\begin{minipage}[${1:htbp}]{${2:1.0}${3:\linewidth}}
$0
\end{minipage}

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: par
# group: sections
# name : \paragraph
# --
\paragraph{${1:name}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: François Garillot <francois@garillot.net>
# key: prod
# group: math
# name: \prod_{n}^{}
# --
\prod_{$1}^{$2}$0

View File

@ -0,0 +1,7 @@
-*- mode: snippet -*-
# contributor : Márcio M. Ribeiro <marcio.mr@gmail.com>
# key: ref
# group: references
# name : \ref
# --
\ref{${1:label$(unless yas/modified-p (reftex-reference nil 'dont-insert))}}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key: sc
# group: font
# name: {\sc ...}
# --
{\scshape $1}$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@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

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : sec*
# group: sections
# name : \section*
# --
\section*{${1:name}}
$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@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

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: ssub*
# group: sections
# name : \subsubsection*
# --
\subsubsection*{${1:name}}
$0

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@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

View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: subfig
# group: environments
# name : \subfigure
# --
\subfigure[${1:caption}]{
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
}

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: sub*
# group: sections
# name : \subsection*
# --
\subsection*{${1:name}}
$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Song Qiang <tsiangsung@gmail.com>
# key: sum
# group: math
# name: \sum_{n}^{}
# --
\sum_{$1}^{$2}$0

View File

@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: table
# group: environments
# name : \begin{table} ... \end{table}
# --
\begin{table}[htbp]
\centering
\begin{tabular}{${3:format}}
$0
\end{tabular}
\caption{${1:caption}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
\end{table}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key: tt
# group: font
# name: {\tt ...}
# --
{\tt $1}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: url
# group: environments
# name: \url
# --
\url{${1:$$(yas/choose-value '("http" "ftp"))}://${2:address}}$0

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: use
# group: misc
# name: \usepackage
# --
\usepackage[$2]{$1}$0

View File

@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# contributor : Bjorn Reese <breese@users.sourceforge.net>
# contributor : Song Qiang <tsiangsung@gmail.com>
# key: verb
# group: environments
# name: \begin{verbatim} ... \end{verbatim}
# --
\begin{verbatim}
$0
\end{verbatim}