dotfiles/vim/.vim/own-snippets/tex.snippets

1099 lines
22 KiB
Plaintext
Raw Normal View History

2019-08-15 03:52:35 +00:00
global !p
texMathZones = ['texMathZone'+x for x in ['A', 'AS', 'B', 'BS', 'C', 'CS', 'D', 'DS', 'E', 'ES', 'F', 'FS', 'G', 'GS', 'H', 'HS', 'I', 'IS', 'J', 'JS', 'K', 'KS', 'L', 'LS', 'DS', 'V', 'W', 'X', 'Y', 'Z']]
texIgnoreMathZones = ['texMathText']
texMathZoneIds = vim.eval('map('+str(texMathZones)+", 'hlID(v:val)')")
texIgnoreMathZoneIds = vim.eval('map('+str(texIgnoreMathZones)+", 'hlID(v:val)')")
ignore = texIgnoreMathZoneIds[0]
def math():
synstackids = vim.eval("synstack(line('.'), col('.') - (col('.')>=2 ? 1 : 0))")
try:
first = next(
i for i in reversed(synstackids)
if i in texIgnoreMathZoneIds or i in texMathZoneIds
)
return first != ignore
except StopIteration:
return False
def smart_space(next_str, auto_str=" ", loose=False):
next_word = ""
if next_str:
if loose == True:
next_word = auto_str
elif next_str[0] in [",", ".", "-", "!", "?", " "]:
next_word = auto_str
return next_word
2019-08-19 01:03:51 +00:00
def add_variable_numbers(*inputs, **kwargs):
absolute = kwargs.pop("absolute", False)
total = 0
for t in inputs:
try:
i = int(t)
if absolute is True:
total += abs(i)
else:
total += i
except ValueError:
continue
return total
2019-08-15 03:52:35 +00:00
endglobal
snippet template "Main template (that should work without relying with style files)" bi
\documentclass[class=memoir, crop=false, oneside, 14pt]{standalone}
% all of the packages to be used
\usepackage[nocomments]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{fontawesome}
\usepackage[english]{babel}
\usepackage[rgb]{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{fancyhdr}
\usepackage{minted}
\usepackage[most]{tcolorbox}
\usepackage[colorlinks=true, linkcolor=., urlcolor=blue]{hyperref}
\usepackage{kpfonts}
% using the fancy header package
% http://linorg.usp.br/CTAN/macros/latex/contrib/fancyhdr/fancyhdr.pdf
\pagestyle{fancy}
% fill the header with the format
\fancyhead[L]{\doctitle}
\fancyhead[R]{\nouppercase{\rightmark}}
% fill the footer with the format
\fancyfoot[C]{\nouppercase{\leftmark}}
\fancyfoot[R]{\thepage}
% set the width of the horizontal bars in the header
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{1pt}
% set the paragraph formatting
\renewcommand{\baselinestretch}{1.35}
% set chapter style
\chapterstyle{bianchi}
% set chapter spacing for easier reading on digital screen
\setlength{\beforechapskip}{-\beforechapskip}
% document metadata
\author{${1:"Gabriel Arazas"}}
\title{${2:"New Title"}}
\date{`!p
`}
\begin{document}
% Frontmatter of the class note if it's compiled standalone
\renewcommand{\abstractname}{Summary}
\maketitle
\newpage
\frontmatter
\chapter{Preface}
$3
\newpage
\tableofcontents
\newpage
\listoffigures
\newpage
\mainmatter
% Core content (HINT: always start with chapter LaTeX tag)
$0
\end{document}
endsnippet
# Document structure tags
snippet chapter "Chapter element" bi
\chapter{$1}
\label{ch:$1}
$0
endsnippet
snippet section "Section tag" bi
\section{$1}
\label{sec:$1}
$0
endsnippet
snippet subsec "Subsection tag" bi
\subsection{$1}
\label{subsec:$1}
$0
endsnippet
# Common commands
snippet pack "Use package command" bis
\usepackage`!p snip.rv=smart_space(t[2], "[",loose=True)`$2`!p snip.rv=smart_space(t[2], "]",loose=True)`{$1}
2019-08-15 03:52:35 +00:00
$0
endsnippet
snippet letter "Make at letter block" bis
2019-08-15 03:52:35 +00:00
\makeatletter
$1
\makeatother
$0
endsnippet
snippet label "Create a label" bi
2019-08-15 03:52:35 +00:00
\label{$1}
$0
endsnippet
snippet ref "Create a reference for a label" bi
2019-08-15 03:52:35 +00:00
\ref{${1:<label to be referenced>}} $0
endsnippet
2019-08-24 16:25:57 +00:00
snippet eqref "Quick equation reference command" wi
Equation \ref{eq:$1} $0
endsnippet
snippet theoref "Quick theorem reference command" wi
Theorem \ref{th:$1} $0
endsnippet
2019-08-24 16:25:57 +00:00
snippet figref "Quick figure reference command" wi
figure \ref{fig:$1} $0
endsnippet
snippet tabref "Quick table referenece command" wi
table \ref{tab:$1} $0
endsnippet
snippet chref "Quick chapter reference command" wi
chapter \ref{ch:$1} $0
endsnippet
snippet secref "Quick section reference command" wi
section \ref{sec:$1} $0
endsnippet
snippet subsecref "Quick subsection reference command" wi
subsection \ref{subsec:$1} $0
endsnippet
snippet propref "Quick property reference command" wi
Property \ref{prop:$1} $0
endsnippet
snippet defref "Quick definition reference command" wi
Definition \ref{def:$1} $0
endsnippet
snippet foot "Footnote" w
2019-08-15 03:52:35 +00:00
\footnote{${1:<text>}} $0
endsnippet
# Common environments
snippet begin "Simple empty environment" bi
\begin{$1}
$2
\end{$1}
$0
endsnippet
snippet mi "Math mode (inline)" i
2019-08-15 03:52:35 +00:00
$${1}$`!p smart_space(t[2])`$2
endsnippet
snippet mb "Math block" bi
\begin{equation*}
2019-08-24 16:25:57 +00:00
`!p snip.rv=smart_space(t[1], "\label{eq:", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2
2019-08-15 03:52:35 +00:00
\end{equation*}
$0
endsnippet
snippet equation "Equation environment for mathematical typesetting" biw
2019-08-15 03:52:35 +00:00
\begin{equation}
\label{eq:$1}
$2
\end{equation}
$0
endsnippet
snippet figure "Figure environment" biw
2019-08-15 03:52:35 +00:00
\begin{figure}
\centering
\label{fig:$1}
$2
\caption{${3:$1}}
\end{figure}
$0
endsnippet
snippet graph "Quickly make a graph" bi
\begin{figure}[${1:ht}]
2019-08-15 03:52:35 +00:00
\centering
\begin{tikzpicture}
\begin{axis}[
xlabel=${2:$x$},
ylabel=${3:$y$},
2019-08-19 01:03:51 +00:00
axis lines = middle,
grid=major,
axis equal=false,
2019-08-21 12:33:45 +00:00
tick style={very thick},
major tick style=thick,
domain=${4:-10}:${5:10},`!p snip.rv = smart_space(t[6], "\n\t", loose=True)`$6
2019-08-15 03:52:35 +00:00
]
\addplot[samples=${7:`!p snip.rv = add_variable_numbers(t[4], t[5], 1, absolute=True)`},$8]{${9:x}};
2019-08-15 03:52:35 +00:00
\end{axis}
\end{tikzpicture}
\caption{$10}
\label{fig:${11:$10}}
2019-08-15 03:52:35 +00:00
\end{figure}
$0
endsnippet
snippet agraph "Quickly plot a graph without considering integers" bi
\begin{figure}[${1:ht}]
2019-08-15 03:52:35 +00:00
\centering
\begin{tikzpicture}
\begin{axis}[
xlabel=${2:$x$},
ylabel=${3:$y$},
2019-08-19 01:03:51 +00:00
axis lines = middle,
grid=major,
axis equal=false,
tick style={very thick},
major tick style=thick,
minor tick num=2,
domain=${4:-10}:${5:10},`!p snip.rv=smart_space(t[6], "\n\t", loose=True)`$6
2019-08-15 03:52:35 +00:00
]
\addplot[samples=${7:`!p snip.rv=add_variable_numbers(t[4], t[5], absolute=True)`}, $8]{${9:x}};
2019-08-15 03:52:35 +00:00
\end{axis}
\end{tikzpicture}
\caption{$10}
\label{fig:${11:$10}}
2019-08-15 03:52:35 +00:00
\end{figure}
$0
endsnippet
snippet plot "Add a plot line" i
\addplot[domain=$1:$2, samples=${3:`!p snip.rv=add_variable_numbers(t[1], t[2], 1, absolute=true)`}]`!p snip.rv=smart_space(t[4], ", ")`$4{${5: x}}
$0
endsnippet
2019-08-15 03:52:35 +00:00
# Common mathematical functions and symbols
# Also take note that most expressions are prepended with 'M' to mean mathematical usage
snippet === "Equivalent to" iw
2019-08-15 03:52:35 +00:00
\equiv
endsnippet
snippet ~= "Congruent to" iw
2019-08-15 03:52:35 +00:00
\cong
endsnippet
snippet ~~ "Approximately equal to" iw
2019-08-15 03:52:35 +00:00
\approx
endsnippet
snippet p= "Proportional to" iw
2019-08-15 03:52:35 +00:00
\propto
endsnippet
snippet != "Not equal" iw
2019-08-15 03:52:35 +00:00
\neq
endsnippet
snippet <= "Greater than or equal to" iw
2019-08-15 03:52:35 +00:00
\geq
endsnippet
snippet !> "Not greater than" iw
2019-08-15 03:52:35 +00:00
\ngtr
endsnippet
snippet >= "Less than or equal to" iw
2019-08-15 03:52:35 +00:00
\leq
endsnippet
snippet !< "Not less than" iw
2019-08-15 03:52:35 +00:00
\nless
endsnippet
snippet <-- "Precedes symbol" iw
2019-08-15 03:52:35 +00:00
\prec
endsnippet
snippet =<- "Precedes or equals" iw
2019-08-15 03:52:35 +00:00
\preceq
endsnippet
snippet !<- "Not precedes" iw
2019-08-15 03:52:35 +00:00
\nprec
endsnippet
snippet --> "Succeeds symbol" iw
2019-08-15 03:52:35 +00:00
\succ
endsnippet
snippet =-> "Succeeds or equals" iw
2019-08-15 03:52:35 +00:00
\succeq
endsnippet
snippet !-> "Not succeeds" iw
2019-08-15 03:52:35 +00:00
\nsucc
endsnippet
snippet << "Less order than" iw
2019-08-15 03:52:35 +00:00
\ll
endsnippet
snippet >> "Greater order than" iw
2019-08-15 03:52:35 +00:00
\gg
endsnippet
context "math()"
snippet int "Integral symbol" iw
2019-08-15 03:52:35 +00:00
\int
endsnippet
context "math()"
snippet -int "Integral with values" iw
2019-08-15 03:52:35 +00:00
\int_{${1:<lower bound>}}^{${2:<upper bound}}$0
endsnippet
context "math()"
snippet OO "Empty set" iw
2019-08-15 03:52:35 +00:00
\O
endsnippet
context "math()"
snippet -sq "Square superscript" iw
2019-08-15 03:52:35 +00:00
^{2}$0
endsnippet
context "math()"
snippet -cb "Cube superscript" iw
2019-08-15 03:52:35 +00:00
^{3}$0
endsnippet
context "math()"
snippet -- "Superscript" iwA
2019-08-15 03:52:35 +00:00
^{$1}$0
endsnippet
context "math()"
snippet __ "Subscript" iwA
2019-08-15 03:52:35 +00:00
_{$1}$0
endsnippet
snippet ... "Ellipsis" iw
2019-08-15 03:52:35 +00:00
\ldots
endsnippet
snippet c.. "Centered ellipsis" iw
2019-08-15 03:52:35 +00:00
\cdots
endsnippet
snippet v.. "Vertical ellipsis" iw
2019-08-15 03:52:35 +00:00
\vdots
endsnippet
snippet d.. "Diagonal ellipsis" iw
2019-08-15 03:52:35 +00:00
\ddots
endsnippet
context "math()"
snippet Mbc "Mathematical because symbol" iw
2019-08-15 03:52:35 +00:00
\because
endsnippet
context "math()"
snippet Mth "Mathematical therefore symbol" iw
2019-08-15 03:52:35 +00:00
\therefore
endsnippet
context "math()"
snippet exp "Expression" iw
2019-08-15 03:52:35 +00:00
\exp(${1:x}} $0
endsnippet
context "math()"
snippet frac "Fraction" iw
2019-08-15 03:52:35 +00:00
\frac{${1:<enumerator>}{${2:<denominator}}
$0
endsnippet
context "math()"
snippet "-(\d+|\w+) over (\d+|\w+)-" "Quick fraction" riwA
2019-08-15 03:52:35 +00:00
`!p snip.rv = f"\\frac{{{match.group(1)}}}{{{match.group(2)}}}"`
$0
endsnippet
context "math()"
snippet "-(\d+|\w+) / (\d+|\w+)-" "Quick fraction" riwA
2019-08-15 03:52:35 +00:00
`!p snip.rv = f"\\frac{{{match.group(1)}}}{{{match.group(2)}}}"`
$0
endsnippet
context "math()"
snippet mod "Mod operator (as binary operator)" iw
2019-08-15 03:52:35 +00:00
\bmod $0
endsnippet
## Common notations
context "math()"
snippet sum "Sigma notation symbol" iw
2019-08-15 03:52:35 +00:00
\sum
endsnippet
context "math()"
snippet -sum "Sigma notation" iw
2019-08-15 03:52:35 +00:00
\sum_{${1:<lower bound>}^{${2:<upper bound>}} f(${3:<function expression>})
$0
endsnippet
context "math()"
snippet prod "Product notation symbol" iw
2019-08-15 03:52:35 +00:00
\prod
endsnippet
context "math()"
snippet -prod "Product notation" iw
2019-08-15 03:52:35 +00:00
\prod_{${1:<lower bound>}^{${2:upper bound}} f(${3:<function expression>})
$0
endsnippet
context "math()"
snippet lim "Limit keyword" iw
2019-08-15 03:52:35 +00:00
\lim
endsnippet
context "math()"
snippet -lim "Limit operator" iw
2019-08-15 03:52:35 +00:00
\lim\limits_{${1:x \to \infty}}
endsnippet
context "math()"
snippet ooo "Infinity symbol" iw
2019-08-15 03:52:35 +00:00
\infty
endsnippet
context "math()"
snippet inf "Infinity symbol" iw
2019-08-15 03:52:35 +00:00
\infty
endsnippet
context "math()"
snippet choose "Choose function" iw
2019-08-15 03:52:35 +00:00
\binom{${1:<range>}}{${2:<N>}}
$0
endsnippet
context "math()"
snippet "-(\d+|\w+) choose (\d+|\w+)-" "Quick choose function" riwA
2019-08-15 03:52:35 +00:00
`!p snip.rv = f"\\binom{{{match.group(1)}}}{{{match.group(2)}}}"`
$0
endsnippet
## Common sets of numbers
context "math()"
snippet SN "Set of natural numbers" iw
2019-08-15 03:52:35 +00:00
\N
endsnippet
context "math()"
snippet SZ "Set of integers" iw
2019-08-15 03:52:35 +00:00
\Z
endsnippet
context "math()"
snippet SQ "Set of rational numbers" iw
2019-08-15 03:52:35 +00:00
\Q
endsnippet
context "math()"
snippet SA "Set of algebraic numbers" iw
2019-08-15 03:52:35 +00:00
\mathbb{A}
endsnippet
context "math()"
snippet SR "Set of real numbers" iw
2019-08-15 03:52:35 +00:00
\R
endsnippet
context "math()"
snippet SC "Set of complex numbers" iw
2019-08-15 03:52:35 +00:00
\C
endsnippet
## Common mathematical logic symbols
context "math()"
snippet Lin "Logical in symbol" iw
2019-08-15 03:52:35 +00:00
\in
endsnippet
context "math()"
snippet L!in "Logical not in symbol" iw
2019-08-15 03:52:35 +00:00
\notin
endsnippet
context "math()"
snippet Lon "Logical owns symbol" iw
2019-08-15 03:52:35 +00:00
\ni
endsnippet
context "math()"
snippet LSu "Logical set union" iw
2019-08-15 03:52:35 +00:00
\cup
endsnippet
context "math()"
snippet LSi "Logical set interaction" iw
2019-08-15 03:52:35 +00:00
\cap
endsnippet
context "math()"
snippet LSd "Logical set difference" iw
2019-08-15 03:52:35 +00:00
\setminus
endsnippet
context "math()"
snippet Lex "There exists at least one" iw
2019-08-15 03:52:35 +00:00
\exists
endsnippet
context "math()"
snippet Lex! "There exists one and only one" iw
2019-08-15 03:52:35 +00:00
\exists!
endsnippet
context "math()"
snippet L!ex "Not exists" iw
2019-08-15 03:52:35 +00:00
\nexists
endsnippet
context "math()"
snippet Lfa "For all" iw
2019-08-15 03:52:35 +00:00
\forall
endsnippet
context "math()"
snippet Lor "Logical 'or' symbol" iw
2019-08-15 03:52:35 +00:00
\lor
endsnippet
context "math()"
snippet Land "Logical 'and' symbol" iw
2019-08-15 03:52:35 +00:00
\land
endsnippet
context "math()"
snippet Lnot "Logical 'not' symbol" iw
2019-08-15 03:52:35 +00:00
\neg
endsnippet
context "math()"
snippet => "Implies" Aiw
2019-08-15 03:52:35 +00:00
\implies
endsnippet
context "math()"
snippet =< "Implied by" Aiw
2019-08-15 03:52:35 +00:00
\impliedby
endsnippet
context "math()"
snippet <=> "If and only if" iw
2019-08-15 03:52:35 +00:00
\iff
endsnippet
context "math()"
snippet iff "If and only if" iw
2019-08-15 03:52:35 +00:00
\iff
endsnippet
context "math()"
snippet (( "Subset" iw
2019-08-15 03:52:35 +00:00
\subset
endsnippet
context "math()"
snippet !( "Not a proper subset" iw
2019-08-15 03:52:35 +00:00
\not\subset
endsnippet
context "math()"
snippet =( "Subset is equal to" iw
2019-08-15 03:52:35 +00:00
\subseteq
endsnippet
context "math()"
snippet !=( "Not a subset of" iw
2019-08-15 03:52:35 +00:00
\nsubseteq
endsnippet
context "math()"
snippet )) "A proper subset of" iw
2019-08-15 03:52:35 +00:00
\supset
endsnippet
context "math()"
snippet !) "Not a proper superset of" iw
2019-08-15 03:52:35 +00:00
\not\supset
endsnippet
context "math()"
snippet =) "A subset of" iw
2019-08-15 03:52:35 +00:00
\supseteq
endsnippet
context "math()"
snippet !=) "Not a superset of" iw
2019-08-15 03:52:35 +00:00
\nsupseteq
endsnippet
## Common functions
### Trigonometric functions
context "math()"
snippet Msin "Sine function" iw
\sin`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mcos "Cosine function" iw
\cos`!p smart_space(t[1], "(", loose=True)`$1`!p smart_space(t[1], ")", loose=True)`
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mtan "Tangent function" iw
\tan`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mcsc "Cosecant function" iw
\csc`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Msec "Secant function" iw
\sec`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mcot "Cotangent function" iw
\cot`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
### Inverse trigonometric functions
context "math()"
snippet M!sin "Inverse sine keyword" iw
\arcsin`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!cos "Inverse cosine keyword" iw
\arccos`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!tan "Inverse tangent keyword" iw
\arctan`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!csc "Inverse cosecant keyword" iw
\arccsc`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!sec "Inverse secant keyword" iw
\arcsec`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!cot "Inverse cotangent" iw
\arccot`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
### Hyperbolic trigonometric functions
context "math()"
snippet Msinh "Hyperbolic sine" iw
\sinh`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mcosh "Hyperbolic cosine" iw
\cosh`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mtanh "Hyperbolic tangent" iw
\tanh`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mcsch "Hyperbolic cosecant" iw
\operatorname{csch}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Msech "Hyperbolic secant" iw
\operatorname{sech}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet Mcoth "Hyperbolic cotangent" iw
\coth`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
### Inverse hyperbolic trigonometric functions
context "math()"
snippet M!sinh "Inverse hyperbolic sine" iw
\operatorname{arsinh}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!cosh "Inverse hyperbolic cosine" iw
\operatorname{arcosh}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!tanh "Inverse hyperbolic tangent" iw
\operatorname{artanh}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!csch "Inverse hyperbolic cosecant" iw
\operatorname{arcsch}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!sech "Inverse hyperbolic secant" iw
\operatorname{arsech}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
context "math()"
snippet M!coth "Inverse hyperbolic cotangent" iw
\operatorname{arcoth}`!p snip.rv=smart_space(t[1], "(", loose=True)`$1`!p snip.rv=smart_space(t[1], ")", loose=True)` $0
2019-08-15 03:52:35 +00:00
endsnippet
## Common symbols found in geometry
snippet Gov "Overline" iw
2019-08-15 03:52:35 +00:00
\overline{$1}
endsnippet
snippet ----- "Overline" iw
2019-08-15 03:52:35 +00:00
\overline{$1}
endsnippet
snippet Gra "Right arrow" iw
2019-08-15 03:52:35 +00:00
\overrightarrow{$1}
endsnippet
snippet ----> "Right arrow" iw
2019-08-15 03:52:35 +00:00
\overrightarrow{$1}
endsnippet
snippet Gang "Angle symbol" iw
2019-08-15 03:52:35 +00:00
\angle
endsnippet
snippet Gman "Measured angle symbol" iw
2019-08-15 03:52:35 +00:00
\measuredangle
endsnippet
snippet Gtri "Triangle" iw
2019-08-15 03:52:35 +00:00
\triangle
endsnippet
snippet Gpar "Parallel with" iw
2019-08-15 03:52:35 +00:00
\|
endsnippet
snippet G!par "Not parallel with" iw
2019-08-15 03:52:35 +00:00
\nparallel
endsnippet
snippet Gper "Perpendicular to" iw
2019-08-15 03:52:35 +00:00
\perp
endsnippet
snippet G!per "Not perpendicular to" iw
2019-08-15 03:52:35 +00:00
\not\perp
endsnippet
# Text formatting
snippet bf "Boldface text" iw
2019-08-15 03:52:35 +00:00
\textbf{$1}$0
endsnippet
snippet it "Italic text" iw
2019-08-15 03:52:35 +00:00
\emph{$1}$0
endsnippet
snippet tt "Teletype font" iw
2019-08-15 03:52:35 +00:00
\texttt{$1}$0
endsnippet
snippet ol "Enumerated list (ordered list)" iw
2019-08-15 03:52:35 +00:00
\begin{enumerate}
$1
\end{enumerate}
$0
endsnippet
snippet ul "Itemized list (unordered list)" iw
2019-08-15 03:52:35 +00:00
\begin{itemize}
$1
\end{itemize}
$0
endsnippet
snippet li "List item for the OL/UL lists" iw
2019-08-15 03:52:35 +00:00
\item{$1}
$0
endsnippet
snippet a "URL links (with description)" iw
2019-08-24 16:25:57 +00:00
\href{${1:<url>}}{${2:<description>}} $0
2019-08-15 03:52:35 +00:00
endsnippet
snippet al "Reference links with label" iw
2019-08-15 03:52:35 +00:00
\autoref{${1:<label>}}$0
endsnippet
snippet code "Code listings with Minted package" iw
\begin{minted}
$3
\end{minted}
$0
endsnippet
# This specifically needs the captions and minted with [newfloat] option
# Please see the below link for references:
# https://tex.stackexchange.com/a/254177
snippet lcode "Code listings with label" iw
\begin{listing}[H]
\begin{minted}{${1:<language>}}
$2
\end{minted}
`!p snip.rv=smart_space(t[3], "\caption{", loose=True)`$3`!p snip.rv=smart_space(t[3], "}", loose=True)`
\label{lst:${4:$3}}
\end{listing}
endsnippet
2019-08-15 03:52:35 +00:00
# Greek letters
context "math()"
snippet GAA "Uppercase Greek letter alpha" w
2019-08-15 03:52:35 +00:00
\Alpha
endsnippet
context "math()"
snippet GAa "Lowercase Greek letter alpha" w
2019-08-15 03:52:35 +00:00
\alpha
endsnippet
context "math()"
snippet GBB "Uppercase Greek letter beta" w
2019-08-15 03:52:35 +00:00
\Beta
endsnippet
context "math()"
snippet GBb "Lowercase Greek letter beta" w
2019-08-15 03:52:35 +00:00
\beta
endsnippet
context "math()"
snippet GCC "Uppercase Greek letter gamma" w
2019-08-15 03:52:35 +00:00
\Gamma
endsnippet
context "math()"
snippet GCc "Lowercase Greek letter gamma" w
2019-08-15 03:52:35 +00:00
\gamma
endsnippet
context "math()"
snippet GDD "Uppercase Greek letter delta" w
2019-08-15 03:52:35 +00:00
\Delta
endsnippet
context "math()"
snippet GDd "Lowercase Greek letter delta" w
2019-08-15 03:52:35 +00:00
\delta
endsnippet
context "math()"
snippet GEE "Uppercase Greek letter epsilon" w
2019-08-15 03:52:35 +00:00
\Epsilon
endsnippet
context "math()"
snippet GEe "Lowercase Greek letter epsilon" w
2019-08-15 03:52:35 +00:00
\epsilon
endsnippet
context "math()"
snippet GVEe "Variation Greek letter epsilon" w
2019-08-15 03:52:35 +00:00
\varepsilon
endsnippet
context "math()"
snippet GTT "Uppercase Greek letter theta" w
2019-08-15 03:52:35 +00:00
\Theta
endsnippet
context "math()"
snippet GTt "Lowercase Greek letter theta" w
2019-08-15 03:52:35 +00:00
\theta
endsnippet
context "math()"
snippet GLL "Uppercase Greek letter lambda" w
2019-08-15 03:52:35 +00:00
\Lambda
endsnippet
context "math()"
snippet GLl "Lowercase Greek letter lambda" w
2019-08-15 03:52:35 +00:00
\lambda
endsnippet
context "math()"
snippet GPP "Uppercase Greek letter pi" w
2019-08-15 03:52:35 +00:00
\Pi
endsnippet
context "math()"
snippet GPp "Lowercase Greek letter pi" w
2019-08-15 03:52:35 +00:00
\pi
endsnippet
context "math()"
snippet GVPp "Variation Greek letter pi" w
2019-08-15 03:52:35 +00:00
\varpi
endsnippet
context "math()"
snippet GSS "Uppercase Greek letter sigma" w
2019-08-15 03:52:35 +00:00
\Sigma
endsnippet
context "math()"
snippet GSs "Lowercase Greek letter sigma" w
2019-08-15 03:52:35 +00:00
\sigma
endsnippet
context "math()"
snippet GPH "Uppercase Greek letter phi" w
2019-08-15 03:52:35 +00:00
\Phi
endsnippet
context "math()"
snippet GPh "Lowercase Greek letter phi" w
2019-08-15 03:52:35 +00:00
\phi
endsnippet
context "math()"
snippet GVPh "Variation Greek letter phi" w
2019-08-15 03:52:35 +00:00
\varphi
endsnippet
context "math()"
snippet GPS "Uppercase Greek letter psi" w
2019-08-15 03:52:35 +00:00
\Psi
endsnippet
context "math()"
snippet GPs "Lowercase Greek letter psi" w
2019-08-15 03:52:35 +00:00
\psi
endsnippet
context "math()"
snippet GOO "Uppercase Greek letter omega" w
2019-08-15 03:52:35 +00:00
\Omega
endsnippet
context "math()"
snippet GOo "Lowercase Greek letter omega" w
2019-08-15 03:52:35 +00:00
\omega
endsnippet
# Custom commands and environment (for my class notes)
# Do not use this if you don't have the following packages and
# does not have my custom document style file:
# * tcolorbox
# * xcolor
# * fontawesome
snippet dnote "Doc note admonition block" iw
2019-08-15 03:52:35 +00:00
\begin{-doc-note}
$1
\end{-doc-note}
$0
endsnippet
snippet dinfo "Doc info admonition block" iw
2019-08-15 03:52:35 +00:00
\begin{-doc-info}
$1
\end{-doc-info}
$0
endsnippet
snippet dtheo "Doc theorem block" iw
\begin{-doc-theorem}{${1:<Theorem title>}}{${2:<marker>}}
$3
2019-08-15 03:52:35 +00:00
\end{-doc-theorem}
$0
endsnippet
snippet ddef "Doc definition block" iw
2019-08-15 03:52:35 +00:00
\begin{-doc-definition}
`!p snip.rv=smart_space(t[1], "\label{def:", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2
2019-08-15 03:52:35 +00:00
\end{-doc-definition}
$0
endsnippet
snippet dprop "Doc property block" iw
\begin{-doc-property}
`!p snip.rv=smart_space(t[1], "\label{prop:", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2
\end{-doc-property}
$0
endsnippet
snippet dwarn "Doc warning callout block" iw
2019-08-15 03:52:35 +00:00
\begin{-doc-warning}
$1
\end{-doc-warning}
$0
endsnippet
snippet dcrit "Doc critical callout block" iw
2019-08-15 03:52:35 +00:00
\begin{-doc-critical}
$1
\end{-doc-critical}
$0
endsnippet
snippet dlist "Doc listings callout block" iw
\begin{-doc-listing}{${1:<title>}}{${2:<label name>}}{${3:<language>}}
$4
\end{-doc-listing}
endsnippet