fix: add castel latex workflow
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
614ae12320
commit
5619e9b217
5 changed files with 138 additions and 583 deletions
|
@ -1,262 +1,209 @@
|
|||
# Document
|
||||
snippet importmath "amsmath amssymb"
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amssymb}
|
||||
global !p
|
||||
def math():
|
||||
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
|
||||
|
||||
def comment():
|
||||
return vim.eval('vimtex#syntax#in_comment()') == '1'
|
||||
|
||||
def env(name):
|
||||
[x,y] = vim.eval("vimtex#env#is_inside('" + name + "')")
|
||||
return x != '0' and y != '0'
|
||||
|
||||
endglobal
|
||||
|
||||
# General Formatting
|
||||
snippet beg "begin{} / end{}" bA
|
||||
\\begin{$1}
|
||||
$0
|
||||
\\end{$1}
|
||||
endsnippet
|
||||
|
||||
snippet importgeo "geometry"
|
||||
\usepackage[left=2cm,top=2cm]{geometry}
|
||||
endsnippet
|
||||
|
||||
snippet importenum "enum item"
|
||||
\usepackage{enumitem}
|
||||
endsnippet
|
||||
|
||||
snippet setlist "set list"
|
||||
\setlist[enumerate,$1]{label={\roman*.}}
|
||||
endsnippet
|
||||
|
||||
snippet titleneu "Lucas NEU Author Title"
|
||||
\title{$1}
|
||||
\author {
|
||||
Sta. Maria, Lucas \\\\
|
||||
\texttt{stamaria.l@northeastern.edu}
|
||||
}
|
||||
\date{`date +"%B %d, %Y"`}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet titlenor "Lucas Normal Author Title"
|
||||
\title{$1}
|
||||
\author {
|
||||
Sta. Maria, Lucas \\\\
|
||||
\texttt{stamaria.l@northeastern.edu}
|
||||
}
|
||||
\date{`date +"%B %d, %Y"`}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet worddoc "Word document"
|
||||
\documentclass{article}
|
||||
\usepackage{wordlike}
|
||||
\PassOptionsToPackage{margin=1in}{geometry}
|
||||
\usepackage[hang,flushmargin]{footmisc}
|
||||
\usepackage[parfill]{parskip}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# Text Formatting
|
||||
snippet bold "bold font"
|
||||
\textbf{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet ita "italic font"
|
||||
snippet tit "Italics" w
|
||||
\textit{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet boi "bold italic font"
|
||||
\textbf{\textit{$1}}$0
|
||||
snippet tob "Bold" w
|
||||
\textbf{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet ul "underline font"
|
||||
\underline{$1}$0
|
||||
endsnippet
|
||||
# Text Formatting
|
||||
|
||||
snippet ... "ldots"
|
||||
snippet ... "ldots" A
|
||||
\ldots
|
||||
endsnippet
|
||||
|
||||
snippet fn "footnote" i
|
||||
\footnote{$0}
|
||||
# Math Environments
|
||||
snippet im "Inline math" w
|
||||
\(${1}\)`!p
|
||||
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
|
||||
snip.rv = ' '
|
||||
else:
|
||||
snip.rv = ''
|
||||
`$2
|
||||
endsnippet
|
||||
|
||||
# General Shortcuts
|
||||
snippet beg "\begin{} / end{}"
|
||||
\begin{$1}
|
||||
$0
|
||||
\end{$1}
|
||||
snippet dm "Display math" w
|
||||
\[
|
||||
${1:${VISUAL}}
|
||||
\] $0
|
||||
endsnippet
|
||||
|
||||
snippet olist "ordered list"
|
||||
\begin{enumerate}
|
||||
\item $0
|
||||
\end{enumerate}
|
||||
# Math Snippets
|
||||
context "math()"
|
||||
snippet iff "iff" Ai
|
||||
\iff
|
||||
endsnippet
|
||||
|
||||
snippet ulist "unordered list"
|
||||
\begin{itemize}
|
||||
\item $0
|
||||
\end{itemize}
|
||||
context "math()"
|
||||
snippet => "implies" iA
|
||||
\Rightarrow
|
||||
endsnippet
|
||||
|
||||
# Math Shortcuts
|
||||
snippet * "cdot" iA
|
||||
\cdot
|
||||
context "math()"
|
||||
snippet =< "implied by" iA
|
||||
\Leftarrow
|
||||
endsnippet
|
||||
|
||||
snippet im "inline math"
|
||||
\$$0\$
|
||||
endsnippet
|
||||
|
||||
snippet dm "display math"
|
||||
\$\$
|
||||
$0
|
||||
\$\$
|
||||
endsnippet
|
||||
|
||||
snippet am "align math"
|
||||
\begin{align}
|
||||
$0
|
||||
\end{align}
|
||||
endsnippet
|
||||
|
||||
snippet nonum "no number"
|
||||
\nonumber $0
|
||||
endsnippet
|
||||
|
||||
# Math Symbols Shortcuts
|
||||
snippet mbb "\mathbb" iA
|
||||
$1\mathbb{$2}$0
|
||||
endsnippet
|
||||
|
||||
snippet rarr "right arrow" iA
|
||||
context "math()"
|
||||
snippet -> "maps to" iA
|
||||
\rightarrow
|
||||
endsnippet
|
||||
|
||||
snippet larr "left arrow" iA
|
||||
context "math()"
|
||||
snippet -< "maps from" iA
|
||||
\leftarrow
|
||||
endsnippet
|
||||
|
||||
snippet set "math set" w
|
||||
\\\{$1\\\}$0
|
||||
context "math()"
|
||||
snippet / "Fraction" i
|
||||
\\frac{$1}{$2}$0
|
||||
endsnippet
|
||||
|
||||
snippet tf "therefore" w
|
||||
\therefore$1$0
|
||||
context "math()"
|
||||
snippet '([A-Za-z])(\d)' "auto subscript" wrA
|
||||
`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
|
||||
endsnippet
|
||||
|
||||
snippet frac "\frac" w
|
||||
$1\frac{$2}{$3}$0
|
||||
context "math()"
|
||||
snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
|
||||
`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
|
||||
endsnippet
|
||||
|
||||
snippet sqq "square" iA
|
||||
^2
|
||||
snippet __ "subscript" iA
|
||||
_{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet cbb "cube" iA
|
||||
^3
|
||||
context "math()"
|
||||
snippet ceil "ceil" iA
|
||||
\left\lceil $1 \right\rceil $0
|
||||
endsnippet
|
||||
|
||||
snippet sss "superscript" iA
|
||||
^{$0}
|
||||
context "math()"
|
||||
snippet floor "floor" iA
|
||||
\left\lfloor $1 \right\rfloor$0
|
||||
endsnippet
|
||||
|
||||
snippet ssb "subscript" iA
|
||||
_{$0}
|
||||
context "math()"
|
||||
snippet ** "cdot" iA
|
||||
\cdot
|
||||
endsnippet
|
||||
|
||||
snippet land "logical and" iA
|
||||
\wedge$0
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet '(?<!\\)(sin|cos|arccot|cot|csc|ln|log|exp|star|perp)' "ln" rwA
|
||||
\\`!p snip.rv = match.group(1)`
|
||||
endsnippet
|
||||
|
||||
snippet lor "logical or" iA
|
||||
\vee$0
|
||||
priority 300
|
||||
context "math()"
|
||||
snippet dint "integral" wA
|
||||
\int_{${1}}^{${2}} ${3} $0
|
||||
endsnippet
|
||||
|
||||
snippet lnot "logical not" iA
|
||||
\neg$0
|
||||
priority 200
|
||||
context "math()"
|
||||
snippet '(?<!\\)(arcsin|arccos|arctan|arccot|arccsc|arcsec|pi|zeta|int)' "ln" rwA
|
||||
\\`!p snip.rv = match.group(1)`
|
||||
endsnippet
|
||||
|
||||
snippet lxor "logical xor" iA
|
||||
\veebar$0
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet -> "to" iA
|
||||
\to
|
||||
endsnippet
|
||||
|
||||
snippet sand "set and" i
|
||||
\cap$0
|
||||
priority 200
|
||||
context "math()"
|
||||
snippet <-> "leftrightarrow" iA
|
||||
\leftrightarrow
|
||||
endsnippet
|
||||
|
||||
snippet sor "set or" i
|
||||
\cup$0
|
||||
context "math()"
|
||||
snippet !> "mapsto" iA
|
||||
\mapsto
|
||||
endsnippet
|
||||
|
||||
snippet snot "set not" i
|
||||
\bar{$1}$0
|
||||
context "math()"
|
||||
snippet invs "inverse" iA
|
||||
^{-1}
|
||||
endsnippet
|
||||
|
||||
snippet cong "logical congruent" i
|
||||
\cong $0
|
||||
context "math()"
|
||||
snippet compl "complement" iA
|
||||
^{c}
|
||||
endsnippet
|
||||
|
||||
snippet ncong "logical not congruent" i
|
||||
\ncong $0
|
||||
context "math()"
|
||||
snippet set "set" wA
|
||||
\\{$1\\} $0
|
||||
endsnippet
|
||||
|
||||
snippet cap "set cap" i
|
||||
\cap $0
|
||||
context "math()"
|
||||
snippet cc "subset" Ai
|
||||
\subset
|
||||
endsnippet
|
||||
|
||||
snippet cup "set cup" i
|
||||
\cup $0
|
||||
snippet notin "not in " iA
|
||||
\not\in
|
||||
endsnippet
|
||||
|
||||
# Boxes
|
||||
snippet importcbox "import colored boxes"
|
||||
\usepackage[most]{tcolorbox}
|
||||
context "math()"
|
||||
snippet inn "in " iA
|
||||
\in
|
||||
endsnippet
|
||||
|
||||
snippet boxr "red box" wA
|
||||
\begin{tcolorbox}[colback=red!30!white,colframe=red!30!white, sharp corners]
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
snippet NN "n" iA
|
||||
\N
|
||||
endsnippet
|
||||
|
||||
snippet boxb "blue box" wA
|
||||
\begin{tcolorbox}[colback=blue!30!white,colframe=blue!30!white, sharp corners]
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
snippet Nn "cap" iA
|
||||
\cap
|
||||
endsnippet
|
||||
|
||||
snippet boxg "green box" wA
|
||||
\begin{tcolorbox}[colback=green!30!white,colframe=green!30!white, sharp corners]
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
snippet UU "cup" iA
|
||||
\cup
|
||||
endsnippet
|
||||
|
||||
snippet boxtr "red title box" wA
|
||||
\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black,title=$1]
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
priority 10
|
||||
context "math()"
|
||||
snippet "bar" "bar" riA
|
||||
\overline{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet boxtb "blue title box" wA
|
||||
\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black,title=$1]
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet "([a-zA-Z])bar" "bar" riA
|
||||
\overline{`!p snip.rv=match.group(1)`}
|
||||
endsnippet
|
||||
|
||||
snippet boxtg "green title box" wA
|
||||
\begin{tcolorbox}[colback=green!5!white, colframe=green!75!black,title=$1]
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
priority 10
|
||||
context "math()"
|
||||
snippet "hat" "hat" riA
|
||||
\hat{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet proposition "red box" w
|
||||
\begin{tcolorbox}[colback=red!30!white,colframe=red!30!white, sharp corners]
|
||||
\textbf{Proposition} \\\\
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
endsnippet
|
||||
|
||||
snippet theorem "blue box" w
|
||||
\begin{tcolorbox}[colback=blue!30!white,colframe=blue!30!white, sharp corners]
|
||||
\textbf{Theorem} \\\\
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
endsnippet
|
||||
|
||||
snippet definition "green box" w
|
||||
\begin{tcolorbox}[colback=green!30!white,colframe=green!30!white, sharp corners]
|
||||
\textbf{Definition} \\\\
|
||||
$0
|
||||
\end{tcolorbox}
|
||||
priority 100
|
||||
context "math()"
|
||||
snippet "([a-zA-Z])hat" "hat" riA
|
||||
\hat{`!p snip.rv=match.group(1)`}
|
||||
endsnippet
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue